| 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 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2864 Label done, null, function, non_function_constructor; | 2864 Label done, null, function, non_function_constructor; |
| 2865 | 2865 |
| 2866 VisitForAccumulatorValue(args->at(0)); | 2866 VisitForAccumulatorValue(args->at(0)); |
| 2867 | 2867 |
| 2868 // If the object is not a JSReceiver, we return null. | 2868 // If the object is not a JSReceiver, we return null. |
| 2869 __ JumpIfSmi(rax, &null, Label::kNear); | 2869 __ JumpIfSmi(rax, &null, Label::kNear); |
| 2870 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 2870 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 2871 __ CmpObjectType(rax, FIRST_JS_RECEIVER_TYPE, rax); | 2871 __ CmpObjectType(rax, FIRST_JS_RECEIVER_TYPE, rax); |
| 2872 __ j(below, &null, Label::kNear); | 2872 __ j(below, &null, Label::kNear); |
| 2873 | 2873 |
| 2874 // Return 'Function' for JSFunction objects. | 2874 // Return 'Function' for JSFunction and JSBoundFunction objects. |
| 2875 __ CmpInstanceType(rax, JS_FUNCTION_TYPE); | 2875 __ CmpInstanceType(rax, FIRST_FUNCTION_TYPE); |
| 2876 __ j(equal, &function, Label::kNear); | 2876 STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE); |
| 2877 __ j(above_equal, &function, Label::kNear); |
| 2877 | 2878 |
| 2878 // Check if the constructor in the map is a JS function. | 2879 // Check if the constructor in the map is a JS function. |
| 2879 __ GetMapConstructor(rax, rax, rbx); | 2880 __ GetMapConstructor(rax, rax, rbx); |
| 2880 __ CmpInstanceType(rbx, JS_FUNCTION_TYPE); | 2881 __ CmpInstanceType(rbx, JS_FUNCTION_TYPE); |
| 2881 __ j(not_equal, &non_function_constructor, Label::kNear); | 2882 __ j(not_equal, &non_function_constructor, Label::kNear); |
| 2882 | 2883 |
| 2883 // rax now contains the constructor function. Grab the | 2884 // rax now contains the constructor function. Grab the |
| 2884 // instance class name from there. | 2885 // instance class name from there. |
| 2885 __ movp(rax, FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset)); | 2886 __ movp(rax, FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset)); |
| 2886 __ movp(rax, FieldOperand(rax, SharedFunctionInfo::kInstanceClassNameOffset)); | 2887 __ movp(rax, FieldOperand(rax, SharedFunctionInfo::kInstanceClassNameOffset)); |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3970 DCHECK_EQ( | 3971 DCHECK_EQ( |
| 3971 isolate->builtins()->OnStackReplacement()->entry(), | 3972 isolate->builtins()->OnStackReplacement()->entry(), |
| 3972 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3973 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3973 return ON_STACK_REPLACEMENT; | 3974 return ON_STACK_REPLACEMENT; |
| 3974 } | 3975 } |
| 3975 | 3976 |
| 3976 } // namespace internal | 3977 } // namespace internal |
| 3977 } // namespace v8 | 3978 } // namespace v8 |
| 3978 | 3979 |
| 3979 #endif // V8_TARGET_ARCH_X64 | 3980 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |