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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 2529173002: [Heap] Remove concept of MarkingParity. (Closed)
Patch Set: Rebase Created 4 years 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 | « no previous file | src/arm64/codegen-arm64.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 "src/arm/codegen-arm.h" 5 #include "src/arm/codegen-arm.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 } 433 }
434 #endif 434 #endif
435 435
436 436
437 bool Code::IsYoungSequence(Isolate* isolate, byte* sequence) { 437 bool Code::IsYoungSequence(Isolate* isolate, byte* sequence) {
438 bool result = isolate->code_aging_helper()->IsYoung(sequence); 438 bool result = isolate->code_aging_helper()->IsYoung(sequence);
439 DCHECK(result || isolate->code_aging_helper()->IsOld(sequence)); 439 DCHECK(result || isolate->code_aging_helper()->IsOld(sequence));
440 return result; 440 return result;
441 } 441 }
442 442
443 Code::Age Code::GetCodeAge(Isolate* isolate, byte* sequence) {
444 if (IsYoungSequence(isolate, sequence)) return kNoAgeCodeAge;
443 445
444 void Code::GetCodeAgeAndParity(Isolate* isolate, byte* sequence, Age* age, 446 Address target_address = Memory::Address_at(
445 MarkingParity* parity) { 447 sequence + (kNoCodeAgeSequenceLength - Assembler::kInstrSize));
446 if (IsYoungSequence(isolate, sequence)) { 448 Code* stub = GetCodeFromTargetAddress(target_address);
447 *age = kNoAgeCodeAge; 449 return GetAgeOfCodeAgeStub(stub);
448 *parity = NO_MARKING_PARITY;
449 } else {
450 Address target_address = Memory::Address_at(
451 sequence + (kNoCodeAgeSequenceLength - Assembler::kInstrSize));
452 Code* stub = GetCodeFromTargetAddress(target_address);
453 GetCodeAgeAndParity(stub, age, parity);
454 }
455 } 450 }
456 451
457 452 void Code::PatchPlatformCodeAge(Isolate* isolate, byte* sequence,
458 void Code::PatchPlatformCodeAge(Isolate* isolate, 453 Code::Age age) {
459 byte* sequence,
460 Code::Age age,
461 MarkingParity parity) {
462 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); 454 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length();
463 if (age == kNoAgeCodeAge) { 455 if (age == kNoAgeCodeAge) {
464 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); 456 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence);
465 Assembler::FlushICache(isolate, sequence, young_length); 457 Assembler::FlushICache(isolate, sequence, young_length);
466 } else { 458 } else {
467 Code* stub = GetCodeAgeStub(isolate, age, parity); 459 Code* stub = GetCodeAgeStub(isolate, age);
468 CodePatcher patcher(isolate, sequence, 460 CodePatcher patcher(isolate, sequence,
469 young_length / Assembler::kInstrSize); 461 young_length / Assembler::kInstrSize);
470 patcher.masm()->add(r0, pc, Operand(-8)); 462 patcher.masm()->add(r0, pc, Operand(-8));
471 patcher.masm()->ldr(pc, MemOperand(pc, -4)); 463 patcher.masm()->ldr(pc, MemOperand(pc, -4));
472 patcher.masm()->emit_code_stub_address(stub); 464 patcher.masm()->emit_code_stub_address(stub);
473 } 465 }
474 } 466 }
475 467
476
477 } // namespace internal 468 } // namespace internal
478 } // namespace v8 469 } // namespace v8
479 470
480 #endif // V8_TARGET_ARCH_ARM 471 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698