| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2705 Label done, null, function, non_function_constructor; | 2705 Label done, null, function, non_function_constructor; |
| 2706 | 2706 |
| 2707 VisitForAccumulatorValue(args->at(0)); | 2707 VisitForAccumulatorValue(args->at(0)); |
| 2708 | 2708 |
| 2709 // If the object is not a JSReceiver, we return null. | 2709 // If the object is not a JSReceiver, we return null. |
| 2710 __ JumpIfSmi(rax, &null, Label::kNear); | 2710 __ JumpIfSmi(rax, &null, Label::kNear); |
| 2711 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 2711 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 2712 __ CmpObjectType(rax, FIRST_JS_RECEIVER_TYPE, rax); | 2712 __ CmpObjectType(rax, FIRST_JS_RECEIVER_TYPE, rax); |
| 2713 __ j(below, &null, Label::kNear); | 2713 __ j(below, &null, Label::kNear); |
| 2714 | 2714 |
| 2715 // Return 'Function' for JSFunction objects. | 2715 // Return 'Function' for JSFunction and JSBoundFunction objects. |
| 2716 __ CmpInstanceType(rax, JS_FUNCTION_TYPE); | 2716 __ CmpInstanceType(rax, FIRST_FUNCTION_TYPE); |
| 2717 __ j(equal, &function, Label::kNear); | 2717 STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE); |
| 2718 __ j(above_equal, &function, Label::kNear); |
| 2718 | 2719 |
| 2719 // Check if the constructor in the map is a JS function. | 2720 // Check if the constructor in the map is a JS function. |
| 2720 __ GetMapConstructor(rax, rax, rbx); | 2721 __ GetMapConstructor(rax, rax, rbx); |
| 2721 __ CmpInstanceType(rbx, JS_FUNCTION_TYPE); | 2722 __ CmpInstanceType(rbx, JS_FUNCTION_TYPE); |
| 2722 __ j(not_equal, &non_function_constructor, Label::kNear); | 2723 __ j(not_equal, &non_function_constructor, Label::kNear); |
| 2723 | 2724 |
| 2724 // rax now contains the constructor function. Grab the | 2725 // rax now contains the constructor function. Grab the |
| 2725 // instance class name from there. | 2726 // instance class name from there. |
| 2726 __ movp(rax, FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset)); | 2727 __ movp(rax, FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset)); |
| 2727 __ movp(rax, FieldOperand(rax, SharedFunctionInfo::kInstanceClassNameOffset)); | 2728 __ movp(rax, FieldOperand(rax, SharedFunctionInfo::kInstanceClassNameOffset)); |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3811 DCHECK_EQ( | 3812 DCHECK_EQ( |
| 3812 isolate->builtins()->OnStackReplacement()->entry(), | 3813 isolate->builtins()->OnStackReplacement()->entry(), |
| 3813 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3814 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3814 return ON_STACK_REPLACEMENT; | 3815 return ON_STACK_REPLACEMENT; |
| 3815 } | 3816 } |
| 3816 | 3817 |
| 3817 } // namespace internal | 3818 } // namespace internal |
| 3818 } // namespace v8 | 3819 } // namespace v8 |
| 3819 | 3820 |
| 3820 #endif // V8_TARGET_ARCH_X64 | 3821 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |