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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2574 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); | 2574 __ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); |
2575 __ movzx_b(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); | 2575 __ movzx_b(temp2, FieldOperand(temp, Map::kInstanceTypeOffset)); |
2576 __ sub(Operand(temp2), Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 2576 __ sub(Operand(temp2), Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
2577 __ cmp(Operand(temp2), Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - | 2577 __ cmp(Operand(temp2), Immediate(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - |
2578 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 2578 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
2579 __ j(above, is_false); | 2579 __ j(above, is_false); |
2580 } | 2580 } |
2581 | 2581 |
2582 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. | 2582 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. |
2583 // Check if the constructor in the map is a function. | 2583 // Check if the constructor in the map is a function. |
2584 __ mov(temp, FieldOperand(temp, Map::kConstructorOffset)); | 2584 __ GetMapConstructor(temp, temp, temp2); |
2585 // Objects with a non-function constructor have class 'Object'. | 2585 // Objects with a non-function constructor have class 'Object'. |
2586 __ CmpObjectType(temp, JS_FUNCTION_TYPE, temp2); | 2586 __ CmpInstanceType(temp2, JS_FUNCTION_TYPE); |
2587 if (String::Equals(class_name, isolate()->factory()->Object_string())) { | 2587 if (String::Equals(class_name, isolate()->factory()->Object_string())) { |
2588 __ j(not_equal, is_true); | 2588 __ j(not_equal, is_true); |
2589 } else { | 2589 } else { |
2590 __ j(not_equal, is_false); | 2590 __ j(not_equal, is_false); |
2591 } | 2591 } |
2592 | 2592 |
2593 // temp now contains the constructor function. Grab the | 2593 // temp now contains the constructor function. Grab the |
2594 // instance class name from there. | 2594 // instance class name from there. |
2595 __ mov(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset)); | 2595 __ mov(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset)); |
2596 __ mov(temp, FieldOperand(temp, | 2596 __ mov(temp, FieldOperand(temp, |
(...skipping 3181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5778 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5778 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5779 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5779 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5780 } | 5780 } |
5781 | 5781 |
5782 | 5782 |
5783 #undef __ | 5783 #undef __ |
5784 | 5784 |
5785 } } // namespace v8::internal | 5785 } } // namespace v8::internal |
5786 | 5786 |
5787 #endif // V8_TARGET_ARCH_IA32 | 5787 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |