Reviewers: akos.palfi.imgtec, balazs.kilvady, Benedikt Meurer,

Message:
PTAL

Description:
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, ...

Please review this at https://codereview.chromium.org/1309163006/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+4, -8 lines):
  M src/mips/macro-assembler-mips.cc
  M src/mips64/macro-assembler-mips64.cc


Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index cad08049f2ab17218e444c576f265ab03e07ad0a..9dc042bf41d10ab44f6b22f7dc40ee41c94b6468 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));
   }
 }

Index: src/mips64/macro-assembler-mips64.cc
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc index d1f8bf396e2dc93ca5eb71fb59f33101a4f30b14..602cb54f3c787ece26faeb32ab16c3398154234b 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));
   }
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to