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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 346 |
347 if (create_implicit_receiver) { | 347 if (create_implicit_receiver) { |
348 // If the result is an object (in the ECMA sense), we should get rid | 348 // If the result is an object (in the ECMA sense), we should get rid |
349 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 | 349 // of the receiver and use the result; see ECMA-262 section 13.2.2-7 |
350 // on page 74. | 350 // on page 74. |
351 Label use_receiver, exit; | 351 Label use_receiver, exit; |
352 // If the result is a smi, it is *not* an object in the ECMA sense. | 352 // If the result is a smi, it is *not* an object in the ECMA sense. |
353 __ JumpIfSmi(rax, &use_receiver); | 353 __ JumpIfSmi(rax, &use_receiver); |
354 | 354 |
355 // If the type of the result (stored in its map) is less than | 355 // If the type of the result (stored in its map) is less than |
356 // FIRST_SPEC_OBJECT_TYPE, it is not an object in the ECMA sense. | 356 // FIRST_JS_RECEIVER_TYPE, it is not an object in the ECMA sense. |
357 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 357 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
358 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); | 358 __ CmpObjectType(rax, FIRST_JS_RECEIVER_TYPE, rcx); |
359 __ j(above_equal, &exit); | 359 __ j(above_equal, &exit); |
360 | 360 |
361 // Throw away the result of the constructor invocation and use the | 361 // Throw away the result of the constructor invocation and use the |
362 // on-stack receiver as the result. | 362 // on-stack receiver as the result. |
363 __ bind(&use_receiver); | 363 __ bind(&use_receiver); |
364 __ movp(rax, Operand(rsp, 0)); | 364 __ movp(rax, Operand(rsp, 0)); |
365 | 365 |
366 // Restore the arguments count and leave the construct frame. The | 366 // Restore the arguments count and leave the construct frame. The |
367 // arguments count is stored below the reciever and the new.target. | 367 // arguments count is stored below the reciever and the new.target. |
368 __ bind(&exit); | 368 __ bind(&exit); |
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 __ ret(0); | 2062 __ ret(0); |
2063 } | 2063 } |
2064 | 2064 |
2065 | 2065 |
2066 #undef __ | 2066 #undef __ |
2067 | 2067 |
2068 } // namespace internal | 2068 } // namespace internal |
2069 } // namespace v8 | 2069 } // namespace v8 |
2070 | 2070 |
2071 #endif // V8_TARGET_ARCH_X64 | 2071 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |