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

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

Issue 1845463003: Remove usages of Heap::NewSpaceStart and its external reference (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Only use 1 constant, reordered checks a bit to have earlier bail outs for old space Created 4 years, 8 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 | « src/mips64/macro-assembler-mips64.h ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/base/division-by-constant.h" 9 #include "src/base/division-by-constant.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 6694 matching lines...) Expand 10 before | Expand all | Expand 10 after
6705 li(result_reg, Operand(255)); 6705 li(result_reg, Operand(255));
6706 Branch(&done); 6706 Branch(&done);
6707 6707
6708 // In 0-255 range, round and truncate. 6708 // In 0-255 range, round and truncate.
6709 bind(&in_bounds); 6709 bind(&in_bounds);
6710 cvt_w_d(temp_double_reg, input_reg); 6710 cvt_w_d(temp_double_reg, input_reg);
6711 mfc1(result_reg, temp_double_reg); 6711 mfc1(result_reg, temp_double_reg);
6712 bind(&done); 6712 bind(&done);
6713 } 6713 }
6714 6714
6715 6715 void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg,
6716 void MacroAssembler::TestJSArrayForAllocationMemento( 6716 Register scratch_reg,
6717 Register receiver_reg, 6717 Label* no_memento_found) {
6718 Register scratch_reg, 6718 Label map_check;
6719 Label* no_memento_found, 6719 Label top_check;
6720 Condition cond,
6721 Label* allocation_memento_present) {
6722 ExternalReference new_space_start =
6723 ExternalReference::new_space_start(isolate());
6724 ExternalReference new_space_allocation_top = 6720 ExternalReference new_space_allocation_top =
6725 ExternalReference::new_space_allocation_top_address(isolate()); 6721 ExternalReference::new_space_allocation_top_address(isolate());
6726 Daddu(scratch_reg, receiver_reg, 6722 const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag;
6727 Operand(JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); 6723 const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize;
6728 Branch(no_memento_found, lt, scratch_reg, Operand(new_space_start)); 6724
6725 // Bail out if the object is not in new space.
6726 JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found);
6727 // If the object is in new space, we need to check whether it is on the same
6728 // page as the current top.
6729 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
6730 Xor(scratch_reg, scratch_reg, Operand(new_space_allocation_top));
6731 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask));
6732 Branch(&top_check, eq, scratch_reg, Operand(zero_reg));
6733 // The object is on a different page than allocation top. Bail out if the
6734 // object sits on the page boundary as no memento can follow and we cannot
6735 // touch the memory following it.
6736 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
6737 Xor(scratch_reg, scratch_reg, Operand(receiver_reg));
6738 And(scratch_reg, scratch_reg, Operand(~Page::kPageAlignmentMask));
6739 Branch(no_memento_found, ne, scratch_reg, Operand(zero_reg));
6740 // Continue with the actual map check.
6741 jmp(&map_check);
6742 // If top is on the same page as the current object, we need to check whether
6743 // we are below top.
6744 bind(&top_check);
6745 Addu(scratch_reg, receiver_reg, Operand(kMementoEndOffset));
6729 li(at, Operand(new_space_allocation_top)); 6746 li(at, Operand(new_space_allocation_top));
6730 ld(at, MemOperand(at)); 6747 lw(at, MemOperand(at));
6731 Branch(no_memento_found, gt, scratch_reg, Operand(at)); 6748 Branch(no_memento_found, gt, scratch_reg, Operand(at));
6732 ld(scratch_reg, MemOperand(scratch_reg, -AllocationMemento::kSize)); 6749 // Memento map check.
6733 if (allocation_memento_present) { 6750 bind(&map_check);
6734 Branch(allocation_memento_present, cond, scratch_reg, 6751 lw(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset));
6735 Operand(isolate()->factory()->allocation_memento_map())); 6752 Branch(no_memento_found, ne, scratch_reg,
6736 } 6753 Operand(isolate()->factory()->allocation_memento_map()));
6737 } 6754 }
6738 6755
6739 6756
6740 Register GetRegisterThatIsNotOneOf(Register reg1, 6757 Register GetRegisterThatIsNotOneOf(Register reg1,
6741 Register reg2, 6758 Register reg2,
6742 Register reg3, 6759 Register reg3,
6743 Register reg4, 6760 Register reg4,
6744 Register reg5, 6761 Register reg5,
6745 Register reg6) { 6762 Register reg6) {
6746 RegList regs = 0; 6763 RegList regs = 0;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
6883 if (mag.shift > 0) sra(result, result, mag.shift); 6900 if (mag.shift > 0) sra(result, result, mag.shift);
6884 srl(at, dividend, 31); 6901 srl(at, dividend, 31);
6885 Addu(result, result, Operand(at)); 6902 Addu(result, result, Operand(at));
6886 } 6903 }
6887 6904
6888 6905
6889 } // namespace internal 6906 } // namespace internal
6890 } // namespace v8 6907 } // namespace v8
6891 6908
6892 #endif // V8_TARGET_ARCH_MIPS64 6909 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698