From 444a933931b405bd33485e8c299ee850b47a9531 Mon Sep 17 00:00:00 2001 From: "paul.lind" Date: Tue, 8 Sep 2015 12:29:22 -0700 Subject: [PATCH] MIPS: Fix MacroAssembler::AssertFunction() Porting mistake in ccbb4ff0 '[builtins] Unify the various versions of [[Call]] with a Call builtin.', which only showed as debug assertion in later commit db2ba190 '[runtime] Replace many buggy uses of %_CallFunction with %_Call.' Use temporary register rather than push/pop of 'object' register. BUG= TEST=cctest/test-api/SetFunctionEntryHook, cctest/test-serialize/PerIsolateSnapshotBlobs, ... Review URL: https://codereview.chromium.org/1309163006 Cr-Commit-Position: refs/heads/master@{#30643} --- src/mips/macro-assembler-mips.cc | 6 ++---- src/mips64/macro-assembler-mips64.cc | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index cad08049f2..9dc042bf41 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -5180,10 +5180,8 @@ void MacroAssembler::AssertFunction(Register object) { STATIC_ASSERT(kSmiTag == 0); SmiTst(object, t0); Check(ne, kOperandIsASmiAndNotAFunction, t0, Operand(zero_reg)); - push(object); - GetObjectType(object, object, object); - pop(object); - Check(eq, kOperandIsNotAFunction, object, Operand(JS_FUNCTION_TYPE)); + GetObjectType(object, t0, t0); + Check(eq, kOperandIsNotAFunction, t0, Operand(JS_FUNCTION_TYPE)); } } diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc index d1f8bf396e..602cb54f3c 100644 --- a/src/mips64/macro-assembler-mips64.cc +++ b/src/mips64/macro-assembler-mips64.cc @@ -5378,10 +5378,8 @@ void MacroAssembler::AssertFunction(Register object) { STATIC_ASSERT(kSmiTag == 0); SmiTst(object, t0); Check(ne, kOperandIsASmiAndNotAFunction, t0, Operand(zero_reg)); - push(object); - GetObjectType(object, object, object); - pop(object); - Check(eq, kOperandIsNotAFunction, object, Operand(JS_FUNCTION_TYPE)); + GetObjectType(object, t0, t0); + Check(eq, kOperandIsNotAFunction, t0, Operand(JS_FUNCTION_TYPE)); } }