Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: src/s390/macro-assembler-s390.cc

Issue 2072723002: S390: [Heap] Fix comparing against new space top pointer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3636 matching lines...) Expand 10 before | Expand all | Expand 10 after
3647 StoreP(src, mem, scratch); 3647 StoreP(src, mem, scratch);
3648 } 3648 }
3649 } 3649 }
3650 3650
3651 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, 3651 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg,
3652 Register scratch_reg, 3652 Register scratch_reg,
3653 Register scratch2_reg, 3653 Register scratch2_reg,
3654 Label* no_memento_found) { 3654 Label* no_memento_found) {
3655 Label map_check; 3655 Label map_check;
3656 Label top_check; 3656 Label top_check;
3657 ExternalReference new_space_allocation_top = 3657 ExternalReference new_space_allocation_top_adr =
3658 ExternalReference::new_space_allocation_top_address(isolate()); 3658 ExternalReference::new_space_allocation_top_address(isolate());
3659 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; 3659 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag;
3660 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; 3660 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize;
3661 3661
3662 DCHECK(!AreAliased(receiver_reg, scratch_reg)); 3662 DCHECK(!AreAliased(receiver_reg, scratch_reg));
3663 3663
3664 // Bail out if the object is not in new space. 3664 // Bail out if the object is not in new space.
3665 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); 3665 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found);
3666 3666
3667 DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); 3667 DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0);
3668 AddP(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
3669 3668
3670 // If the object is in new space, we need to check whether it is on the same 3669 // If the object is in new space, we need to check whether it is on the same
3671 // page as the current top. 3670 // page as the current top.
3672 XorP(r0, scratch_reg, Operand(new_space_allocation_top)); 3671 AddP(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
3672 mov(ip, Operand(new_space_allocation_top_adr));
3673 LoadP(ip, MemOperand(ip));
3674 XorP(r0, scratch_reg, ip);
3673 AndP(r0, r0, Operand(~Page::kPageAlignmentMask)); 3675 AndP(r0, r0, Operand(~Page::kPageAlignmentMask));
3674 beq(&top_check, Label::kNear); 3676 beq(&top_check, Label::kNear);
3675 // The object is on a different page than allocation top. Bail out if the 3677 // The object is on a different page than allocation top. Bail out if the
3676 // object sits on the page boundary as no memento can follow and we cannot 3678 // object sits on the page boundary as no memento can follow and we cannot
3677 // touch the memory following it. 3679 // touch the memory following it.
3678 XorP(r0, scratch_reg, receiver_reg); 3680 XorP(r0, scratch_reg, receiver_reg);
3679 AndP(r0, r0, Operand(~Page::kPageAlignmentMask)); 3681 AndP(r0, r0, Operand(~Page::kPageAlignmentMask));
3680 bne(no_memento_found); 3682 bne(no_memento_found);
3681 // Continue with the actual map check. 3683 // Continue with the actual map check.
3682 b(&map_check, Label::kNear); 3684 b(&map_check, Label::kNear);
3683 // If top is on the same page as the current object, we need to check whether 3685 // If top is on the same page as the current object, we need to check whether
3684 // we are below top. 3686 // we are below top.
3685 bind(&top_check); 3687 bind(&top_check);
3686 CmpP(scratch_reg, Operand(new_space_allocation_top)); 3688 CmpP(scratch_reg, ip);
3687 bgt(no_memento_found); 3689 bgt(no_memento_found);
3688 // Memento map check. 3690 // Memento map check.
3689 bind(&map_check); 3691 bind(&map_check);
3690 LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); 3692 LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset));
3691 CmpP(scratch_reg, Operand(isolate()->factory()->allocation_memento_map())); 3693 CmpP(scratch_reg, Operand(isolate()->factory()->allocation_memento_map()));
3692 } 3694 }
3693 3695
3694 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3, 3696 Register GetRegisterThatIsNotOneOf(Register reg1, Register reg2, Register reg3,
3695 Register reg4, Register reg5, 3697 Register reg4, Register reg5,
3696 Register reg6) { 3698 Register reg6) {
(...skipping 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after
5523 } 5525 }
5524 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); 5526 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift));
5525 ExtractBit(r0, dividend, 31); 5527 ExtractBit(r0, dividend, 31);
5526 AddP(result, r0); 5528 AddP(result, r0);
5527 } 5529 }
5528 5530
5529 } // namespace internal 5531 } // namespace internal
5530 } // namespace v8 5532 } // namespace v8
5531 5533
5532 #endif // V8_TARGET_ARCH_S390 5534 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698