OLD | NEW |
---|---|
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 Loading... | |
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 | 443 Code::Age Code::GetCodeAge(Isolate* isolate, byte* sequence) { |
444 void Code::GetCodeAgeAndParity(Isolate* isolate, byte* sequence, Age* age, | |
445 MarkingParity* parity) { | |
446 if (IsYoungSequence(isolate, sequence)) { | 444 if (IsYoungSequence(isolate, sequence)) { |
447 *age = kNoAgeCodeAge; | 445 return kNoAgeCodeAge; |
448 *parity = NO_MARKING_PARITY; | |
449 } else { | 446 } else { |
Hannes Payer (out of office)
2016/11/28 09:49:10
Remove the else case (also in the other codegen-*
rmcilroy
2016/11/28 10:06:24
Not sure what you mean by this. I can't remove the
rmcilroy
2016/11/29 11:42:02
Done.
| |
450 Address target_address = Memory::Address_at( | 447 Address target_address = Memory::Address_at( |
451 sequence + (kNoCodeAgeSequenceLength - Assembler::kInstrSize)); | 448 sequence + (kNoCodeAgeSequenceLength - Assembler::kInstrSize)); |
452 Code* stub = GetCodeFromTargetAddress(target_address); | 449 Code* stub = GetCodeFromTargetAddress(target_address); |
453 GetCodeAgeAndParity(stub, age, parity); | 450 return GetAgeOfCodeAgeStub(stub); |
454 } | 451 } |
455 } | 452 } |
456 | 453 |
457 | 454 void Code::PatchPlatformCodeAge(Isolate* isolate, byte* sequence, |
458 void Code::PatchPlatformCodeAge(Isolate* isolate, | 455 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(); | 456 uint32_t young_length = isolate->code_aging_helper()->young_sequence_length(); |
463 if (age == kNoAgeCodeAge) { | 457 if (age == kNoAgeCodeAge) { |
464 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); | 458 isolate->code_aging_helper()->CopyYoungSequenceTo(sequence); |
465 Assembler::FlushICache(isolate, sequence, young_length); | 459 Assembler::FlushICache(isolate, sequence, young_length); |
466 } else { | 460 } else { |
467 Code* stub = GetCodeAgeStub(isolate, age, parity); | 461 Code* stub = GetCodeAgeStub(isolate, age); |
468 CodePatcher patcher(isolate, sequence, | 462 CodePatcher patcher(isolate, sequence, |
469 young_length / Assembler::kInstrSize); | 463 young_length / Assembler::kInstrSize); |
470 patcher.masm()->add(r0, pc, Operand(-8)); | 464 patcher.masm()->add(r0, pc, Operand(-8)); |
471 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 465 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
472 patcher.masm()->emit_code_stub_address(stub); | 466 patcher.masm()->emit_code_stub_address(stub); |
473 } | 467 } |
474 } | 468 } |
475 | 469 |
476 | |
477 } // namespace internal | 470 } // namespace internal |
478 } // namespace v8 | 471 } // namespace v8 |
479 | 472 |
480 #endif // V8_TARGET_ARCH_ARM | 473 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |