| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 if (create_implicit_receiver) { | 356 if (create_implicit_receiver) { |
| 357 // If the result is an object (in the ECMA sense), we should get rid | 357 // If the result is an object (in the ECMA sense), we should get rid |
| 358 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 | 358 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 |
| 359 // on page 74. | 359 // on page 74. |
| 360 Label use_receiver, exit; | 360 Label use_receiver, exit; |
| 361 | 361 |
| 362 // If the result is a smi, it is *not* an object in the ECMA sense. | 362 // If the result is a smi, it is *not* an object in the ECMA sense. |
| 363 __ JumpIfSmi(eax, &use_receiver); | 363 __ JumpIfSmi(eax, &use_receiver); |
| 364 | 364 |
| 365 // If the type of the result (stored in its map) is less than | 365 // If the type of the result (stored in its map) is less than |
| 366 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 366 // FIRST_JS_RECEIVER_TYPE, it is not an object in the ECMA sense. |
| 367 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); | 367 __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, ecx); |
| 368 __ j(above_equal, &exit); | 368 __ j(above_equal, &exit); |
| 369 | 369 |
| 370 // Throw away the result of the constructor invocation and use the | 370 // Throw away the result of the constructor invocation and use the |
| 371 // on-stack receiver as the result. | 371 // on-stack receiver as the result. |
| 372 __ bind(&use_receiver); | 372 __ bind(&use_receiver); |
| 373 __ mov(eax, Operand(esp, 0)); | 373 __ mov(eax, Operand(esp, 0)); |
| 374 | 374 |
| 375 // Restore the arguments count and leave the construct frame. The | 375 // Restore the arguments count and leave the construct frame. The |
| 376 // arguments | 376 // arguments |
| 377 // count is stored below the reciever and the new.target. | 377 // count is stored below the reciever and the new.target. |
| (...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 | 1994 |
| 1995 __ bind(&ok); | 1995 __ bind(&ok); |
| 1996 __ ret(0); | 1996 __ ret(0); |
| 1997 } | 1997 } |
| 1998 | 1998 |
| 1999 #undef __ | 1999 #undef __ |
| 2000 } // namespace internal | 2000 } // namespace internal |
| 2001 } // namespace v8 | 2001 } // namespace v8 |
| 2002 | 2002 |
| 2003 #endif // V8_TARGET_ARCH_X87 | 2003 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |