OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_S390 | 8 #if V8_TARGET_ARCH_S390 |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 3336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3347 | 3347 |
3348 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, | 3348 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
3349 Register scratch_reg, | 3349 Register scratch_reg, |
3350 Register scratch2_reg, | 3350 Register scratch2_reg, |
3351 Label* no_memento_found) { | 3351 Label* no_memento_found) { |
3352 Label map_check; | 3352 Label map_check; |
3353 Label top_check; | 3353 Label top_check; |
3354 ExternalReference new_space_allocation_top_adr = | 3354 ExternalReference new_space_allocation_top_adr = |
3355 ExternalReference::new_space_allocation_top_address(isolate()); | 3355 ExternalReference::new_space_allocation_top_address(isolate()); |
3356 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; | 3356 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
3357 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; | 3357 const int kMementoLastWordOffset = |
| 3358 kMementoMapOffset + AllocationMemento::kSize - kPointerSize; |
3358 | 3359 |
3359 DCHECK(!AreAliased(receiver_reg, scratch_reg)); | 3360 DCHECK(!AreAliased(receiver_reg, scratch_reg)); |
3360 | 3361 |
3361 // Bail out if the object is not in new space. | 3362 // Bail out if the object is not in new space. |
3362 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); | 3363 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
3363 | 3364 |
3364 DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); | 3365 DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); |
3365 | 3366 |
3366 // If the object is in new space, we need to check whether it is on the same | 3367 // If the object is in new space, we need to check whether it is on the same |
3367 // page as the current top. | 3368 // page as the current top. |
3368 AddP(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); | 3369 AddP(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
3369 mov(ip, Operand(new_space_allocation_top_adr)); | 3370 mov(ip, Operand(new_space_allocation_top_adr)); |
3370 LoadP(ip, MemOperand(ip)); | 3371 LoadP(ip, MemOperand(ip)); |
3371 XorP(r0, scratch_reg, ip); | 3372 XorP(r0, scratch_reg, ip); |
3372 AndP(r0, r0, Operand(~Page::kPageAlignmentMask)); | 3373 AndP(r0, r0, Operand(~Page::kPageAlignmentMask)); |
3373 beq(&top_check, Label::kNear); | 3374 beq(&top_check, Label::kNear); |
3374 // The object is on a different page than allocation top. Bail out if the | 3375 // The object is on a different page than allocation top. Bail out if the |
3375 // object sits on the page boundary as no memento can follow and we cannot | 3376 // object sits on the page boundary as no memento can follow and we cannot |
3376 // touch the memory following it. | 3377 // touch the memory following it. |
3377 XorP(r0, scratch_reg, receiver_reg); | 3378 XorP(r0, scratch_reg, receiver_reg); |
3378 AndP(r0, r0, Operand(~Page::kPageAlignmentMask)); | 3379 AndP(r0, r0, Operand(~Page::kPageAlignmentMask)); |
3379 bne(no_memento_found); | 3380 bne(no_memento_found); |
3380 // Continue with the actual map check. | 3381 // Continue with the actual map check. |
3381 b(&map_check, Label::kNear); | 3382 b(&map_check, Label::kNear); |
3382 // If top is on the same page as the current object, we need to check whether | 3383 // If top is on the same page as the current object, we need to check whether |
3383 // we are below top. | 3384 // we are below top. |
3384 bind(&top_check); | 3385 bind(&top_check); |
3385 CmpP(scratch_reg, ip); | 3386 CmpP(scratch_reg, ip); |
3386 bgt(no_memento_found); | 3387 bge(no_memento_found); |
3387 // Memento map check. | 3388 // Memento map check. |
3388 bind(&map_check); | 3389 bind(&map_check); |
3389 LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); | 3390 LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |
3390 CmpP(scratch_reg, Operand(isolate()->factory()->allocation_memento_map())); | 3391 CmpP(scratch_reg, Operand(isolate()->factory()->allocation_memento_map())); |
3391 } | 3392 } |
3392 | 3393 |
3393 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3, | 3394 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3, |
3394 Register reg4, Register reg5, | 3395 Register reg4, Register reg5, |
3395 Register reg6) { | 3396 Register reg6) { |
3396 RegList regs = 0; | 3397 RegList regs = 0; |
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5306 } | 5307 } |
5307 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); | 5308 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); |
5308 ExtractBit(r0, dividend, 31); | 5309 ExtractBit(r0, dividend, 31); |
5309 AddP(result, r0); | 5310 AddP(result, r0); |
5310 } | 5311 } |
5311 | 5312 |
5312 } // namespace internal | 5313 } // namespace internal |
5313 } // namespace v8 | 5314 } // namespace v8 |
5314 | 5315 |
5315 #endif // V8_TARGET_ARCH_S390 | 5316 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |