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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2716 Label done, null, function, non_function_constructor; | 2716 Label done, null, function, non_function_constructor; |
2717 | 2717 |
2718 VisitForAccumulatorValue(args->at(0)); | 2718 VisitForAccumulatorValue(args->at(0)); |
2719 | 2719 |
2720 // If the object is not a JSReceiver, we return null. | 2720 // If the object is not a JSReceiver, we return null. |
2721 __ JumpIfSmi(eax, &null, Label::kNear); | 2721 __ JumpIfSmi(eax, &null, Label::kNear); |
2722 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 2722 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
2723 __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, eax); | 2723 __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, eax); |
2724 __ j(below, &null, Label::kNear); | 2724 __ j(below, &null, Label::kNear); |
2725 | 2725 |
2726 // Return 'Function' for JSFunction objects. | 2726 // Return 'Function' for JSFunction and JSBoundFunction objects. |
2727 __ CmpInstanceType(eax, JS_FUNCTION_TYPE); | 2727 __ CmpInstanceType(eax, FIRST_FUNCTION_TYPE); |
2728 __ j(equal, &function, Label::kNear); | 2728 STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE); |
| 2729 __ j(above_equal, &function, Label::kNear); |
2729 | 2730 |
2730 // Check if the constructor in the map is a JS function. | 2731 // Check if the constructor in the map is a JS function. |
2731 __ GetMapConstructor(eax, eax, ebx); | 2732 __ GetMapConstructor(eax, eax, ebx); |
2732 __ CmpInstanceType(ebx, JS_FUNCTION_TYPE); | 2733 __ CmpInstanceType(ebx, JS_FUNCTION_TYPE); |
2733 __ j(not_equal, &non_function_constructor, Label::kNear); | 2734 __ j(not_equal, &non_function_constructor, Label::kNear); |
2734 | 2735 |
2735 // eax now contains the constructor function. Grab the | 2736 // eax now contains the constructor function. Grab the |
2736 // instance class name from there. | 2737 // instance class name from there. |
2737 __ mov(eax, FieldOperand(eax, JSFunction::kSharedFunctionInfoOffset)); | 2738 __ mov(eax, FieldOperand(eax, JSFunction::kSharedFunctionInfoOffset)); |
2738 __ mov(eax, FieldOperand(eax, SharedFunctionInfo::kInstanceClassNameOffset)); | 2739 __ mov(eax, FieldOperand(eax, SharedFunctionInfo::kInstanceClassNameOffset)); |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3829 isolate->builtins()->OnStackReplacement()->entry(), | 3830 isolate->builtins()->OnStackReplacement()->entry(), |
3830 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3831 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3831 return ON_STACK_REPLACEMENT; | 3832 return ON_STACK_REPLACEMENT; |
3832 } | 3833 } |
3833 | 3834 |
3834 | 3835 |
3835 } // namespace internal | 3836 } // namespace internal |
3836 } // namespace v8 | 3837 } // namespace v8 |
3837 | 3838 |
3838 #endif // V8_TARGET_ARCH_IA32 | 3839 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |