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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3167 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 3167 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
3168 cmp(ecx, isolate()->factory()->null_value()); | 3168 cmp(ecx, isolate()->factory()->null_value()); |
3169 j(not_equal, &next); | 3169 j(not_equal, &next); |
3170 } | 3170 } |
3171 | 3171 |
3172 | 3172 |
3173 void MacroAssembler::TestJSArrayForAllocationMemento( | 3173 void MacroAssembler::TestJSArrayForAllocationMemento( |
3174 Register receiver_reg, | 3174 Register receiver_reg, |
3175 Register scratch_reg, | 3175 Register scratch_reg, |
3176 Label* no_memento_found) { | 3176 Label* no_memento_found) { |
3177 ExternalReference new_space_start = | 3177 Label map_check; |
3178 ExternalReference::new_space_start(isolate()); | 3178 Label top_check; |
3179 ExternalReference new_space_allocation_top = | 3179 ExternalReference new_space_allocation_top = |
3180 ExternalReference::new_space_allocation_top_address(isolate()); | 3180 ExternalReference::new_space_allocation_top_address(isolate()); |
| 3181 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
| 3182 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
3181 | 3183 |
3182 lea(scratch_reg, Operand(receiver_reg, | 3184 // Bail out if the object is not in new space. |
3183 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); | 3185 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
3184 cmp(scratch_reg, Immediate(new_space_start)); | 3186 // If the object is in new space, we need to check whether it is on the same |
3185 j(less, no_memento_found); | 3187 // page as the current top. |
| 3188 lea(scratch_reg, Operand(receiver_reg, kMementoEndOffset)); |
| 3189 xor_(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); |
| 3190 test(scratch_reg, Immediate(~Page::kPageAlignmentMask)); |
| 3191 j(zero, &top_check); |
| 3192 // The object is on a different page than allocation top. Bail out if the |
| 3193 // object sits on the page boundary as no memento can follow and we cannot |
| 3194 // touch the memory following it. |
| 3195 lea(scratch_reg, Operand(receiver_reg, kMementoEndOffset)); |
| 3196 xor_(scratch_reg, receiver_reg); |
| 3197 test(scratch_reg, Immediate(~Page::kPageAlignmentMask)); |
| 3198 j(not_zero, no_memento_found); |
| 3199 // Continue with the actual map check. |
| 3200 jmp(&map_check); |
| 3201 // If top is on the same page as the current object, we need to check whether |
| 3202 // we are below top. |
| 3203 bind(&top_check); |
| 3204 lea(scratch_reg, Operand(receiver_reg, kMementoEndOffset)); |
3186 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); | 3205 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); |
3187 j(greater, no_memento_found); | 3206 j(greater, no_memento_found); |
3188 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), | 3207 // Memento map check. |
3189 Immediate(isolate()->factory()->allocation_memento_map())); | 3208 bind(&map_check); |
| 3209 mov(scratch_reg, Operand(receiver_reg, kMementoMapOffset)); |
| 3210 cmp(scratch_reg, Immediate(isolate()->factory()->allocation_memento_map())); |
3190 } | 3211 } |
3191 | 3212 |
3192 | 3213 |
3193 void MacroAssembler::JumpIfDictionaryInPrototypeChain( | 3214 void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
3194 Register object, | 3215 Register object, |
3195 Register scratch0, | 3216 Register scratch0, |
3196 Register scratch1, | 3217 Register scratch1, |
3197 Label* found) { | 3218 Label* found) { |
3198 DCHECK(!scratch1.is(scratch0)); | 3219 DCHECK(!scratch1.is(scratch0)); |
3199 Factory* factory = isolate()->factory(); | 3220 Factory* factory = isolate()->factory(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3240 mov(eax, dividend); | 3261 mov(eax, dividend); |
3241 shr(eax, 31); | 3262 shr(eax, 31); |
3242 add(edx, eax); | 3263 add(edx, eax); |
3243 } | 3264 } |
3244 | 3265 |
3245 | 3266 |
3246 } // namespace internal | 3267 } // namespace internal |
3247 } // namespace v8 | 3268 } // namespace v8 |
3248 | 3269 |
3249 #endif // V8_TARGET_ARCH_X87 | 3270 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |