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

Unified 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: mips ports 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/macro-assembler-arm64.h ('k') | src/arm64/simulator-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/macro-assembler-arm64.cc
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc
index 5067c43a42ef2518befa6eb109cae1f675fe4272..2229747de2dc81a2c5ce17418884e107c55a122f 100644
--- a/src/arm64/macro-assembler-arm64.cc
+++ b/src/arm64/macro-assembler-arm64.cc
@@ -1574,10 +1574,9 @@ void MacroAssembler::InNewSpace(Register object,
Label* branch) {
DCHECK(cond == eq || cond == ne);
UseScratchRegisterScope temps(this);
- Register temp = temps.AcquireX();
- And(temp, object, ExternalReference::new_space_mask(isolate()));
- Cmp(temp, ExternalReference::new_space_start(isolate()));
- B(cond, branch);
+ const int mask =
+ (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE);
+ CheckPageFlag(object, temps.AcquireSameSizeAs(object), mask, cond, branch);
}
@@ -3991,6 +3990,17 @@ int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
}
}
+void MacroAssembler::CheckPageFlag(const Register& object,
+ const Register& scratch, int mask,
+ Condition cc, Label* condition_met) {
+ And(scratch, object, ~Page::kPageAlignmentMask);
+ Ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset));
+ if (cc == eq) {
+ TestAndBranchIfAnySet(scratch, mask, condition_met);
+ } else {
+ TestAndBranchIfAllClear(scratch, mask, condition_met);
+ }
+}
void MacroAssembler::CheckPageFlagSet(const Register& object,
const Register& scratch,
« no previous file with comments | « src/arm64/macro-assembler-arm64.h ('k') | src/arm64/simulator-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698