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

Side by Side Diff: src/mips/macro-assembler-mips.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/mips/macro-assembler-mips.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 // Copyright 2012 the V8 project authors. All rights reserved. 2 // Copyright 2012 the V8 project authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #include <limits.h> // For LONG_MIN, LONG_MAX. 6 #include <limits.h> // For LONG_MIN, LONG_MAX.
7 7
8 #if V8_TARGET_ARCH_MIPS 8 #if V8_TARGET_ARCH_MIPS
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 value); 362 value);
363 363
364 // Clobber clobbered registers when running with the debug-code flag 364 // Clobber clobbered registers when running with the debug-code flag
365 // turned on to provoke errors. 365 // turned on to provoke errors.
366 if (emit_debug_code()) { 366 if (emit_debug_code()) {
367 li(address, Operand(bit_cast<int32_t>(kZapValue + 12))); 367 li(address, Operand(bit_cast<int32_t>(kZapValue + 12)));
368 li(value, Operand(bit_cast<int32_t>(kZapValue + 16))); 368 li(value, Operand(bit_cast<int32_t>(kZapValue + 16)));
369 } 369 }
370 } 370 }
371 371
372 void MacroAssembler::RecordWriteCodeEntryField(Register js_function,
373 Register code_entry,
374 Register scratch) {
375 const int offset = JSFunction::kCodeEntryOffset;
376
377 // Since a code entry (value) is always in old space, we don't need to update
378 // remembered set. If incremental marking is off, there is nothing for us to
379 // do.
380 if (!FLAG_incremental_marking) return;
381
382 DCHECK(js_function.is(a1));
383 DCHECK(code_entry.is(t0));
384 DCHECK(scratch.is(t1));
385 AssertNotSmi(js_function);
386
387 if (emit_debug_code()) {
388 Addu(scratch, js_function, Operand(offset - kHeapObjectTag));
389 lw(at, MemOperand(scratch));
390 Assert(eq, kWrongAddressOrValuePassedToRecordWrite, at,
391 Operand(code_entry));
392 }
393
394 // First, check if a write barrier is even needed. The tests below
395 // catch stores of Smis and stores into young gen.
396 Label done;
397
398 CheckPageFlag(code_entry, scratch,
399 MemoryChunk::kPointersToHereAreInterestingMask, eq, &done);
400 CheckPageFlag(js_function, scratch,
401 MemoryChunk::kPointersFromHereAreInterestingMask, eq, &done);
402
403 const Register dst = scratch;
404 Addu(dst, js_function, Operand(offset - kHeapObjectTag));
405
406 // Save caller-saved registers. js_function and code_entry are in the
407 // caller-saved register list.
408 DCHECK(kJSCallerSaved & js_function.bit());
409 DCHECK(kJSCallerSaved & code_entry.bit());
410 MultiPush(kJSCallerSaved | ra.bit());
411
412 int argument_count = 3;
413
414 PrepareCallCFunction(argument_count, 0, code_entry);
415
416 mov(a0, js_function);
417 mov(a1, dst);
418 li(a2, Operand(ExternalReference::isolate_address(isolate())));
419
420 {
421 AllowExternalCallThatCantCauseGC scope(this);
422 CallCFunction(
423 ExternalReference::incremental_marking_record_write_code_entry_function(
424 isolate()),
425 argument_count);
426 }
427
428 // Restore caller-saved registers.
429 MultiPop(kJSCallerSaved | ra.bit());
430
431 bind(&done);
432 }
372 433
373 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests. 434 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
374 Register address, 435 Register address,
375 Register scratch, 436 Register scratch,
376 SaveFPRegsMode fp_mode, 437 SaveFPRegsMode fp_mode,
377 RememberedSetFinalAction and_then) { 438 RememberedSetFinalAction and_then) {
378 Label done; 439 Label done;
379 if (emit_debug_code()) { 440 if (emit_debug_code()) {
380 Label ok; 441 Label ok;
381 JumpIfNotInNewSpace(object, scratch, &ok); 442 JumpIfNotInNewSpace(object, scratch, &ok);
(...skipping 5386 matching lines...) Expand 10 before | Expand all | Expand 10 after
5768 if (mag.shift > 0) sra(result, result, mag.shift); 5829 if (mag.shift > 0) sra(result, result, mag.shift);
5769 srl(at, dividend, 31); 5830 srl(at, dividend, 31);
5770 Addu(result, result, Operand(at)); 5831 Addu(result, result, Operand(at));
5771 } 5832 }
5772 5833
5773 5834
5774 } // namespace internal 5835 } // namespace internal
5775 } // namespace v8 5836 } // namespace v8
5776 5837
5777 #endif // V8_TARGET_ARCH_MIPS 5838 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698