OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 2560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2571 Handle<String> class_name, | 2571 Handle<String> class_name, |
2572 Register input, | 2572 Register input, |
2573 Register temp, | 2573 Register temp, |
2574 Register temp2) { | 2574 Register temp2) { |
2575 DCHECK(!input.is(temp)); | 2575 DCHECK(!input.is(temp)); |
2576 DCHECK(!input.is(temp2)); | 2576 DCHECK(!input.is(temp2)); |
2577 DCHECK(!temp.is(temp2)); | 2577 DCHECK(!temp.is(temp2)); |
2578 | 2578 |
2579 __ JumpIfSmi(input, is_false); | 2579 __ JumpIfSmi(input, is_false); |
2580 | 2580 |
2581 if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) { | 2581 if (String::Equals(isolate()->factory()->Function_string(), class_name)) { |
2582 // Assuming the following assertions, we can use the same compares to test | 2582 // Assuming the following assertions, we can use the same compares to test |
2583 // for both being a function type and being in the object type range. | 2583 // for both being a function type and being in the object type range. |
2584 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 2584 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
2585 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE == | 2585 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE == |
2586 FIRST_SPEC_OBJECT_TYPE + 1); | 2586 FIRST_SPEC_OBJECT_TYPE + 1); |
2587 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == | 2587 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == |
2588 LAST_SPEC_OBJECT_TYPE - 1); | 2588 LAST_SPEC_OBJECT_TYPE - 1); |
2589 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 2589 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
2590 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); | 2590 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); |
2591 __ j(below, is_false); | 2591 __ j(below, is_false); |
(...skipping 10 matching lines...) Expand all Loading... |
2602 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 2602 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
2603 __ j(above, is_false); | 2603 __ j(above, is_false); |
2604 } | 2604 } |
2605 | 2605 |
2606 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. | 2606 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. |
2607 // Check if the constructor in the map is a function. | 2607 // Check if the constructor in the map is a function. |
2608 __ movp(temp, FieldOperand(temp, Map::kConstructorOffset)); | 2608 __ movp(temp, FieldOperand(temp, Map::kConstructorOffset)); |
2609 | 2609 |
2610 // Objects with a non-function constructor have class 'Object'. | 2610 // Objects with a non-function constructor have class 'Object'. |
2611 __ CmpObjectType(temp, JS_FUNCTION_TYPE, kScratchRegister); | 2611 __ CmpObjectType(temp, JS_FUNCTION_TYPE, kScratchRegister); |
2612 if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Object"))) { | 2612 if (String::Equals(class_name, isolate()->factory()->Object_string())) { |
2613 __ j(not_equal, is_true); | 2613 __ j(not_equal, is_true); |
2614 } else { | 2614 } else { |
2615 __ j(not_equal, is_false); | 2615 __ j(not_equal, is_false); |
2616 } | 2616 } |
2617 | 2617 |
2618 // temp now contains the constructor function. Grab the | 2618 // temp now contains the constructor function. Grab the |
2619 // instance class name from there. | 2619 // instance class name from there. |
2620 __ movp(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset)); | 2620 __ movp(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset)); |
2621 __ movp(temp, FieldOperand(temp, | 2621 __ movp(temp, FieldOperand(temp, |
2622 SharedFunctionInfo::kInstanceClassNameOffset)); | 2622 SharedFunctionInfo::kInstanceClassNameOffset)); |
(...skipping 3229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5852 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5852 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5853 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5853 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5854 } | 5854 } |
5855 | 5855 |
5856 | 5856 |
5857 #undef __ | 5857 #undef __ |
5858 | 5858 |
5859 } } // namespace v8::internal | 5859 } } // namespace v8::internal |
5860 | 5860 |
5861 #endif // V8_TARGET_ARCH_X64 | 5861 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |