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

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

Issue 1632913003: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm Created 4 years, 10 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 Cmp(scratch1, 1567 Cmp(scratch1,
1568 Operand(isolate()->factory()->allocation_memento_map())); 1568 Operand(isolate()->factory()->allocation_memento_map()));
1569 } 1569 }
1570 1570
1571 1571
1572 void MacroAssembler::InNewSpace(Register object, 1572 void MacroAssembler::InNewSpace(Register object,
1573 Condition cond, 1573 Condition cond,
1574 Label* branch) { 1574 Label* branch) {
1575 DCHECK(cond == eq || cond == ne); 1575 DCHECK(cond == eq || cond == ne);
1576 UseScratchRegisterScope temps(this); 1576 UseScratchRegisterScope temps(this);
1577 Register temp = temps.AcquireX(); 1577 const int mask =
1578 And(temp, object, ExternalReference::new_space_mask(isolate())); 1578 (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE);
1579 Cmp(temp, ExternalReference::new_space_start(isolate())); 1579 CheckPageFlag(object, temps.AcquireSameSizeAs(object), mask, cond, branch);
1580 B(cond, branch);
1581 } 1580 }
1582 1581
1583 1582
1584 void MacroAssembler::AssertSmi(Register object, BailoutReason reason) { 1583 void MacroAssembler::AssertSmi(Register object, BailoutReason reason) {
1585 if (emit_debug_code()) { 1584 if (emit_debug_code()) {
1586 STATIC_ASSERT(kSmiTag == 0); 1585 STATIC_ASSERT(kSmiTag == 0);
1587 Tst(object, kSmiTagMask); 1586 Tst(object, kSmiTagMask);
1588 Check(eq, reason); 1587 Check(eq, reason);
1589 } 1588 }
1590 } 1589 }
(...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after
3983 } else if ((reg_code == 29) || (reg_code == 30)) { 3982 } else if ((reg_code == 29) || (reg_code == 30)) {
3984 // Also skip jssp. 3983 // Also skip jssp.
3985 return reg_code - 3; 3984 return reg_code - 3;
3986 } else { 3985 } else {
3987 // This register has no safepoint register slot. 3986 // This register has no safepoint register slot.
3988 UNREACHABLE(); 3987 UNREACHABLE();
3989 return -1; 3988 return -1;
3990 } 3989 }
3991 } 3990 }
3992 3991
3992 void MacroAssembler::CheckPageFlag(const Register& object,
3993 const Register& scratch, int mask,
3994 Condition cc, Label* condition_met) {
3995 And(scratch, object, ~Page::kPageAlignmentMask);
3996 Ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
3997 if (cc == eq) {
3998 TestAndBranchIfAnySet(scratch, mask, condition_met);
3999 } else {
4000 TestAndBranchIfAllClear(scratch, mask, condition_met);
4001 }
4002 }
3993 4003
3994 void MacroAssembler::CheckPageFlagSet(const Register& object, 4004 void MacroAssembler::CheckPageFlagSet(const Register& object,
3995 const Register& scratch, 4005 const Register& scratch,
3996 int mask, 4006 int mask,
3997 Label* if_any_set) { 4007 Label* if_any_set) {
3998 And(scratch, object, ~Page::kPageAlignmentMask); 4008 And(scratch, object, ~Page::kPageAlignmentMask);
3999 Ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); 4009 Ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
4000 TestAndBranchIfAnySet(scratch, mask, if_any_set); 4010 TestAndBranchIfAnySet(scratch, mask, if_any_set);
4001 } 4011 }
4002 4012
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
4952 } 4962 }
4953 4963
4954 4964
4955 #undef __ 4965 #undef __
4956 4966
4957 4967
4958 } // namespace internal 4968 } // namespace internal
4959 } // namespace v8 4969 } // namespace v8
4960 4970
4961 #endif // V8_TARGET_ARCH_ARM64 4971 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698