Revision: 22586
Author:   [email protected]
Date:     Thu Jul 24 09:12:34 2014 UTC
Log:      X87: Only to the relevant checks in LoadFunctionPrototype

port r22550.

original commit message:
  Only to the relevant checks in LoadFunctionPrototype

BUG=
[email protected]

Review URL: https://codereview.chromium.org/410223002

Patch from Chunyang Dai <[email protected]>.
http://code.google.com/p/v8/source/detail?r=22586

Modified:
 /branches/bleeding_edge/src/x87/macro-assembler-x87.cc

=======================================
--- /branches/bleeding_edge/src/x87/macro-assembler-x87.cc Tue Jul 15 09:46:10 2014 UTC +++ /branches/bleeding_edge/src/x87/macro-assembler-x87.cc Thu Jul 24 09:12:34 2014 UTC
@@ -1869,27 +1869,27 @@
                                              Register scratch,
                                              Label* miss,
                                              bool miss_on_bound_function) {
-  // Check that the receiver isn't a smi.
-  JumpIfSmi(function, miss);
+  Label non_instance;
+  if (miss_on_bound_function) {
+    // Check that the receiver isn't a smi.
+    JumpIfSmi(function, miss);

-  // Check that the function really is a function.
-  CmpObjectType(function, JS_FUNCTION_TYPE, result);
-  j(not_equal, miss);
+    // Check that the function really is a function.
+    CmpObjectType(function, JS_FUNCTION_TYPE, result);
+    j(not_equal, miss);

-  if (miss_on_bound_function) {
     // If a bound function, go to miss label.
     mov(scratch,
         FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
     BooleanBitTest(scratch, SharedFunctionInfo::kCompilerHintsOffset,
                    SharedFunctionInfo::kBoundFunction);
     j(not_zero, miss);
+
+    // Make sure that the function has an instance prototype.
+    movzx_b(scratch, FieldOperand(result, Map::kBitFieldOffset));
+    test(scratch, Immediate(1 << Map::kHasNonInstancePrototype));
+    j(not_zero, &non_instance);
   }
-
-  // Make sure that the function has an instance prototype.
-  Label non_instance;
-  movzx_b(scratch, FieldOperand(result, Map::kBitFieldOffset));
-  test(scratch, Immediate(1 << Map::kHasNonInstancePrototype));
-  j(not_zero, &non_instance);

   // Get the prototype or initial map from the function.
   mov(result,
@@ -1908,12 +1908,15 @@

   // Get the prototype from the initial map.
   mov(result, FieldOperand(result, Map::kPrototypeOffset));
-  jmp(&done);
+
+  if (miss_on_bound_function) {
+    jmp(&done);

-  // Non-instance prototype: Fetch prototype from constructor field
-  // in initial map.
-  bind(&non_instance);
-  mov(result, FieldOperand(result, Map::kConstructorOffset));
+    // Non-instance prototype: Fetch prototype from constructor field
+    // in initial map.
+    bind(&non_instance);
+    mov(result, FieldOperand(result, Map::kConstructorOffset));
+  }

   // All done.
   bind(&done);

--
--
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