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 3309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 3320 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
3321 cmp(ecx, isolate()->factory()->null_value()); | 3321 cmp(ecx, isolate()->factory()->null_value()); |
3322 j(not_equal, &next); | 3322 j(not_equal, &next); |
3323 } | 3323 } |
3324 | 3324 |
3325 | 3325 |
3326 void MacroAssembler::TestJSArrayForAllocationMemento( | 3326 void MacroAssembler::TestJSArrayForAllocationMemento( |
3327 Register receiver_reg, | 3327 Register receiver_reg, |
3328 Register scratch_reg, | 3328 Register scratch_reg, |
3329 Label* no_memento_found) { | 3329 Label* no_memento_found) { |
3330 ExternalReference new_space_start = | 3330 Label map_check; |
3331 ExternalReference::new_space_start(isolate()); | 3331 Label top_check; |
3332 ExternalReference new_space_allocation_top = | 3332 ExternalReference new_space_allocation_top = |
3333 ExternalReference::new_space_allocation_top_address(isolate()); | 3333 ExternalReference::new_space_allocation_top_address(isolate()); |
| 3334 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
| 3335 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
3334 | 3336 |
3335 lea(scratch_reg, Operand(receiver_reg, | 3337 // Bail out if the object is not in new space. |
3336 JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); | 3338 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
3337 cmp(scratch_reg, Immediate(new_space_start)); | 3339 // If the object is in new space, we need to check whether it is on the same |
3338 j(less, no_memento_found); | 3340 // page as the current top. |
| 3341 lea(scratch_reg, Operand(receiver_reg, kMementoEndOffset)); |
| 3342 xor_(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); |
| 3343 test(scratch_reg, Immediate(~Page::kPageAlignmentMask)); |
| 3344 j(zero, &top_check); |
| 3345 // The object is on a different page than allocation top. Bail out if the |
| 3346 // object sits on the page boundary as no memento can follow and we cannot |
| 3347 // touch the memory following it. |
| 3348 lea(scratch_reg, Operand(receiver_reg, kMementoEndOffset)); |
| 3349 xor_(scratch_reg, receiver_reg); |
| 3350 test(scratch_reg, Immediate(~Page::kPageAlignmentMask)); |
| 3351 j(not_zero, no_memento_found); |
| 3352 // Continue with the actual map check. |
| 3353 jmp(&map_check); |
| 3354 // If top is on the same page as the current object, we need to check whether |
| 3355 // we are below top. |
| 3356 bind(&top_check); |
| 3357 lea(scratch_reg, Operand(receiver_reg, kMementoEndOffset)); |
3339 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); | 3358 cmp(scratch_reg, Operand::StaticVariable(new_space_allocation_top)); |
3340 j(greater, no_memento_found); | 3359 j(greater, no_memento_found); |
3341 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), | 3360 // Memento map check. |
3342 Immediate(isolate()->factory()->allocation_memento_map())); | 3361 bind(&map_check); |
| 3362 mov(scratch_reg, Operand(receiver_reg, kMementoMapOffset)); |
| 3363 cmp(scratch_reg, Immediate(isolate()->factory()->allocation_memento_map())); |
3343 } | 3364 } |
3344 | 3365 |
3345 | 3366 |
3346 void MacroAssembler::JumpIfDictionaryInPrototypeChain( | 3367 void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
3347 Register object, | 3368 Register object, |
3348 Register scratch0, | 3369 Register scratch0, |
3349 Register scratch1, | 3370 Register scratch1, |
3350 Label* found) { | 3371 Label* found) { |
3351 DCHECK(!scratch1.is(scratch0)); | 3372 DCHECK(!scratch1.is(scratch0)); |
3352 Factory* factory = isolate()->factory(); | 3373 Factory* factory = isolate()->factory(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3393 mov(eax, dividend); | 3414 mov(eax, dividend); |
3394 shr(eax, 31); | 3415 shr(eax, 31); |
3395 add(edx, eax); | 3416 add(edx, eax); |
3396 } | 3417 } |
3397 | 3418 |
3398 | 3419 |
3399 } // namespace internal | 3420 } // namespace internal |
3400 } // namespace v8 | 3421 } // namespace v8 |
3401 | 3422 |
3402 #endif // V8_TARGET_ARCH_IA32 | 3423 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |