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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 | 111 |
112 void MacroAssembler::CompareRoot(const Operand& with, | 112 void MacroAssembler::CompareRoot(const Operand& with, |
113 Heap::RootListIndex index) { | 113 Heap::RootListIndex index) { |
114 DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index)); | 114 DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index)); |
115 cmp(with, isolate()->heap()->root_handle(index)); | 115 cmp(with, isolate()->heap()->root_handle(index)); |
116 } | 116 } |
117 | 117 |
118 | 118 |
| 119 void MacroAssembler::PushRoot(Heap::RootListIndex index) { |
| 120 DCHECK(isolate()->heap()->RootCanBeTreatedAsConstant(index)); |
| 121 Push(isolate()->heap()->root_handle(index)); |
| 122 } |
| 123 |
| 124 |
119 void MacroAssembler::InNewSpace( | 125 void MacroAssembler::InNewSpace( |
120 Register object, | 126 Register object, |
121 Register scratch, | 127 Register scratch, |
122 Condition cc, | 128 Condition cc, |
123 Label* condition_met, | 129 Label* condition_met, |
124 Label::Distance condition_met_distance) { | 130 Label::Distance condition_met_distance) { |
125 DCHECK(cc == equal || cc == not_equal); | 131 DCHECK(cc == equal || cc == not_equal); |
126 if (scratch.is(object)) { | 132 if (scratch.is(object)) { |
127 and_(scratch, Immediate(~Page::kPageAlignmentMask)); | 133 and_(scratch, Immediate(~Page::kPageAlignmentMask)); |
128 } else { | 134 } else { |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 Check(not_equal, kOperandIsASmiAndNotAName); | 803 Check(not_equal, kOperandIsASmiAndNotAName); |
798 push(object); | 804 push(object); |
799 mov(object, FieldOperand(object, HeapObject::kMapOffset)); | 805 mov(object, FieldOperand(object, HeapObject::kMapOffset)); |
800 CmpInstanceType(object, LAST_NAME_TYPE); | 806 CmpInstanceType(object, LAST_NAME_TYPE); |
801 pop(object); | 807 pop(object); |
802 Check(below_equal, kOperandIsNotAName); | 808 Check(below_equal, kOperandIsNotAName); |
803 } | 809 } |
804 } | 810 } |
805 | 811 |
806 | 812 |
| 813 void MacroAssembler::AssertFunction(Register object) { |
| 814 if (emit_debug_code()) { |
| 815 test(object, Immediate(kSmiTagMask)); |
| 816 Check(not_equal, kOperandIsASmiAndNotAFunction); |
| 817 Push(object); |
| 818 CmpObjectType(object, JS_FUNCTION_TYPE, object); |
| 819 Pop(object); |
| 820 Check(equal, kOperandIsNotAFunction); |
| 821 } |
| 822 } |
| 823 |
| 824 |
807 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) { | 825 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) { |
808 if (emit_debug_code()) { | 826 if (emit_debug_code()) { |
809 Label done_checking; | 827 Label done_checking; |
810 AssertNotSmi(object); | 828 AssertNotSmi(object); |
811 cmp(object, isolate()->factory()->undefined_value()); | 829 cmp(object, isolate()->factory()->undefined_value()); |
812 j(equal, &done_checking); | 830 j(equal, &done_checking); |
813 cmp(FieldOperand(object, 0), | 831 cmp(FieldOperand(object, 0), |
814 Immediate(isolate()->factory()->allocation_site_map())); | 832 Immediate(isolate()->factory()->allocation_site_map())); |
815 Assert(equal, kExpectedUndefinedOrCell); | 833 Assert(equal, kExpectedUndefinedOrCell); |
816 bind(&done_checking); | 834 bind(&done_checking); |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2090 // A variable occurring in such a scope should have slot type LOOKUP and | 2108 // A variable occurring in such a scope should have slot type LOOKUP and |
2091 // not CONTEXT. | 2109 // not CONTEXT. |
2092 if (emit_debug_code()) { | 2110 if (emit_debug_code()) { |
2093 cmp(FieldOperand(dst, HeapObject::kMapOffset), | 2111 cmp(FieldOperand(dst, HeapObject::kMapOffset), |
2094 isolate()->factory()->with_context_map()); | 2112 isolate()->factory()->with_context_map()); |
2095 Check(not_equal, kVariableResolvedToWithContext); | 2113 Check(not_equal, kVariableResolvedToWithContext); |
2096 } | 2114 } |
2097 } | 2115 } |
2098 | 2116 |
2099 | 2117 |
| 2118 void MacroAssembler::LoadGlobalProxy(Register dst) { |
| 2119 mov(dst, GlobalObjectOperand()); |
| 2120 mov(dst, FieldOperand(dst, GlobalObject::kGlobalProxyOffset)); |
| 2121 } |
| 2122 |
| 2123 |
2100 void MacroAssembler::LoadTransitionedArrayMapConditional( | 2124 void MacroAssembler::LoadTransitionedArrayMapConditional( |
2101 ElementsKind expected_kind, | 2125 ElementsKind expected_kind, |
2102 ElementsKind transitioned_kind, | 2126 ElementsKind transitioned_kind, |
2103 Register map_in_out, | 2127 Register map_in_out, |
2104 Register scratch, | 2128 Register scratch, |
2105 Label* no_map_match) { | 2129 Label* no_map_match) { |
2106 // Load the global or builtins object from the current context. | 2130 // Load the global or builtins object from the current context. |
2107 mov(scratch, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 2131 mov(scratch, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
2108 mov(scratch, FieldOperand(scratch, GlobalObject::kNativeContextOffset)); | 2132 mov(scratch, FieldOperand(scratch, GlobalObject::kNativeContextOffset)); |
2109 | 2133 |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3163 mov(eax, dividend); | 3187 mov(eax, dividend); |
3164 shr(eax, 31); | 3188 shr(eax, 31); |
3165 add(edx, eax); | 3189 add(edx, eax); |
3166 } | 3190 } |
3167 | 3191 |
3168 | 3192 |
3169 } // namespace internal | 3193 } // namespace internal |
3170 } // namespace v8 | 3194 } // namespace v8 |
3171 | 3195 |
3172 #endif // V8_TARGET_ARCH_IA32 | 3196 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |