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

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

Issue 1647123002: Write barrier for storing a code entry, and usage in CompileLazy builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE and comment response. 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/mips64/macro-assembler-mips64.h ('k') | src/snapshot/serialize.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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 value); 364 value);
365 365
366 // Clobber clobbered registers when running with the debug-code flag 366 // Clobber clobbered registers when running with the debug-code flag
367 // turned on to provoke errors. 367 // turned on to provoke errors.
368 if (emit_debug_code()) { 368 if (emit_debug_code()) {
369 li(address, Operand(bit_cast<int64_t>(kZapValue + 12))); 369 li(address, Operand(bit_cast<int64_t>(kZapValue + 12)));
370 li(value, Operand(bit_cast<int64_t>(kZapValue + 16))); 370 li(value, Operand(bit_cast<int64_t>(kZapValue + 16)));
371 } 371 }
372 } 372 }
373 373
374 void MacroAssembler::RecordWriteCodeEntryField(Register js_function,
375 Register code_entry,
376 Register scratch) {
377 const int offset = JSFunction::kCodeEntryOffset;
378
379 // Since a code entry (value) is always in old space, we don't need to update
380 // remembered set. If incremental marking is off, there is nothing for us to
381 // do.
382 if (!FLAG_incremental_marking) return;
383
384 DCHECK(js_function.is(a1));
385 DCHECK(code_entry.is(a4));
386 DCHECK(scratch.is(a5));
387 AssertNotSmi(js_function);
388
389 if (emit_debug_code()) {
390 Daddu(scratch, js_function, Operand(offset - kHeapObjectTag));
391 ld(at, MemOperand(scratch));
392 Assert(eq, kWrongAddressOrValuePassedToRecordWrite, at,
393 Operand(code_entry));
394 }
395
396 // First, check if a write barrier is even needed. The tests below
397 // catch stores of Smis and stores into young gen.
398 Label done;
399
400 CheckPageFlag(code_entry, scratch,
401 MemoryChunk::kPointersToHereAreInterestingMask, eq, &done);
402 CheckPageFlag(js_function, scratch,
403 MemoryChunk::kPointersFromHereAreInterestingMask, eq, &done);
404
405 const Register dst = scratch;
406 Daddu(dst, js_function, Operand(offset - kHeapObjectTag));
407
408 // Save caller-saved registers. js_function and code_entry are in the
409 // caller-saved register list.
410 DCHECK(kJSCallerSaved & js_function.bit());
411 DCHECK(kJSCallerSaved & code_entry.bit());
412 MultiPush(kJSCallerSaved | ra.bit());
413
414 int argument_count = 3;
415
416 PrepareCallCFunction(argument_count, code_entry);
417
418 Move(a0, js_function);
419 Move(a1, dst);
420 li(a2, Operand(ExternalReference::isolate_address(isolate())));
421
422 {
423 AllowExternalCallThatCantCauseGC scope(this);
424 CallCFunction(
425 ExternalReference::incremental_marking_record_write_code_entry_function(
426 isolate()),
427 argument_count);
428 }
429
430 // Restore caller-saved registers.
431 MultiPop(kJSCallerSaved | ra.bit());
432
433 bind(&done);
434 }
374 435
375 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests. 436 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
376 Register address, 437 Register address,
377 Register scratch, 438 Register scratch,
378 SaveFPRegsMode fp_mode, 439 SaveFPRegsMode fp_mode,
379 RememberedSetFinalAction and_then) { 440 RememberedSetFinalAction and_then) {
380 Label done; 441 Label done;
381 if (emit_debug_code()) { 442 if (emit_debug_code()) {
382 Label ok; 443 Label ok;
383 JumpIfNotInNewSpace(object, scratch, &ok); 444 JumpIfNotInNewSpace(object, scratch, &ok);
(...skipping 6102 matching lines...) Expand 10 before | Expand all | Expand 10 after
6486 if (mag.shift > 0) sra(result, result, mag.shift); 6547 if (mag.shift > 0) sra(result, result, mag.shift);
6487 srl(at, dividend, 31); 6548 srl(at, dividend, 31);
6488 Addu(result, result, Operand(at)); 6549 Addu(result, result, Operand(at));
6489 } 6550 }
6490 6551
6491 6552
6492 } // namespace internal 6553 } // namespace internal
6493 } // namespace v8 6554 } // namespace v8
6494 6555
6495 #endif // V8_TARGET_ARCH_MIPS64 6556 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | src/snapshot/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698