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

Side by Side Diff: src/x64/macro-assembler-x64.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 unified diff | Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/heap/test-heap.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 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 bind(&done); 244 bind(&done);
245 } 245 }
246 } 246 }
247 247
248 248
249 void MacroAssembler::InNewSpace(Register object, 249 void MacroAssembler::InNewSpace(Register object,
250 Register scratch, 250 Register scratch,
251 Condition cc, 251 Condition cc,
252 Label* branch, 252 Label* branch,
253 Label::Distance distance) { 253 Label::Distance distance) {
254 if (serializer_enabled()) { 254 const int mask =
255 // Can't do arithmetic on external references if it might get serialized. 255 (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE);
256 // The mask isn't really an address. We load it as an external reference in 256 CheckPageFlag(object, scratch, mask, cc, branch, distance);
257 // case the size of the new space is different between the snapshot maker
258 // and the running system.
259 if (scratch.is(object)) {
260 Move(kScratchRegister, ExternalReference::new_space_mask(isolate()));
261 andp(scratch, kScratchRegister);
262 } else {
263 Move(scratch, ExternalReference::new_space_mask(isolate()));
264 andp(scratch, object);
265 }
266 Move(kScratchRegister, ExternalReference::new_space_start(isolate()));
267 cmpp(scratch, kScratchRegister);
268 j(cc, branch, distance);
269 } else {
270 DCHECK(kPointerSize == kInt64Size
271 ? is_int32(static_cast<int64_t>(isolate()->heap()->NewSpaceMask()))
272 : kPointerSize == kInt32Size);
273 intptr_t new_space_start =
274 reinterpret_cast<intptr_t>(isolate()->heap()->NewSpaceStart());
275 Move(kScratchRegister, reinterpret_cast<Address>(-new_space_start),
276 Assembler::RelocInfoNone());
277 if (scratch.is(object)) {
278 addp(scratch, kScratchRegister);
279 } else {
280 leap(scratch, Operand(object, kScratchRegister, times_1, 0));
281 }
282 andp(scratch,
283 Immediate(static_cast<int32_t>(isolate()->heap()->NewSpaceMask())));
284 j(cc, branch, distance);
285 }
286 } 257 }
287 258
288 259
289 void MacroAssembler::RecordWriteField( 260 void MacroAssembler::RecordWriteField(
290 Register object, 261 Register object,
291 int offset, 262 int offset,
292 Register value, 263 Register value,
293 Register dst, 264 Register dst,
294 SaveFPRegsMode save_fp, 265 SaveFPRegsMode save_fp,
295 RememberedSetAction remembered_set_action, 266 RememberedSetAction remembered_set_action,
(...skipping 5299 matching lines...) Expand 10 before | Expand all | Expand 10 after
5595 movl(rax, dividend); 5566 movl(rax, dividend);
5596 shrl(rax, Immediate(31)); 5567 shrl(rax, Immediate(31));
5597 addl(rdx, rax); 5568 addl(rdx, rax);
5598 } 5569 }
5599 5570
5600 5571
5601 } // namespace internal 5572 } // namespace internal
5602 } // namespace v8 5573 } // namespace v8
5603 5574
5604 #endif // V8_TARGET_ARCH_X64 5575 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698