Index: src/arm64/macro-assembler-arm64.cc |
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc |
index 0b2954e18f54ee9b78eeb5b6ff3a517e62b5876e..cce03af879de9b4b7aabedddfc996957b81c378e 100644 |
--- a/src/arm64/macro-assembler-arm64.cc |
+++ b/src/arm64/macro-assembler-arm64.cc |
@@ -5020,7 +5020,8 @@ void MacroAssembler::EmitFrameSetupForCodeAgePatching() { |
// TODO(jbramley): Other architectures use the internal memcpy to copy the |
// sequence. If this is a performance bottleneck, we should consider caching |
// the sequence and copying it in the same way. |
- InstructionAccurateScope scope(this, kCodeAgeSequenceSize / kInstructionSize); |
+ InstructionAccurateScope scope(this, |
+ kNoCodeAgeSequenceLength / kInstructionSize); |
ASSERT(jssp.Is(StackPointer())); |
EmitFrameSetupForCodeAgePatching(this); |
} |
@@ -5028,7 +5029,8 @@ void MacroAssembler::EmitFrameSetupForCodeAgePatching() { |
void MacroAssembler::EmitCodeAgeSequence(Code* stub) { |
- InstructionAccurateScope scope(this, kCodeAgeSequenceSize / kInstructionSize); |
+ InstructionAccurateScope scope(this, |
+ kNoCodeAgeSequenceLength / kInstructionSize); |
ASSERT(jssp.Is(StackPointer())); |
EmitCodeAgeSequence(this, stub); |
} |
@@ -5052,7 +5054,7 @@ void MacroAssembler::EmitFrameSetupForCodeAgePatching(Assembler * assm) { |
__ stp(fp, lr, MemOperand(jssp, 2 * kXRegSize)); |
__ add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); |
- __ AssertSizeOfCodeGeneratedSince(&start, kCodeAgeSequenceSize); |
+ __ AssertSizeOfCodeGeneratedSince(&start, kNoCodeAgeSequenceLength); |
} |
@@ -5075,25 +5077,13 @@ void MacroAssembler::EmitCodeAgeSequence(Assembler * assm, |
__ AssertSizeOfCodeGeneratedSince(&start, kCodeAgeStubEntryOffset); |
if (stub) { |
__ dc64(reinterpret_cast<uint64_t>(stub->instruction_start())); |
- __ AssertSizeOfCodeGeneratedSince(&start, kCodeAgeSequenceSize); |
+ __ AssertSizeOfCodeGeneratedSince(&start, kNoCodeAgeSequenceLength); |
} |
} |
-bool MacroAssembler::IsYoungSequence(byte* sequence) { |
- // Generate a young sequence to compare with. |
- const int length = kCodeAgeSequenceSize / kInstructionSize; |
- static bool initialized = false; |
- static byte young[kCodeAgeSequenceSize]; |
- if (!initialized) { |
- PatchingAssembler patcher(young, length); |
- // The young sequence is the frame setup code for FUNCTION code types. It is |
- // generated by FullCodeGenerator::Generate. |
- MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); |
- initialized = true; |
- } |
- |
- bool is_young = (memcmp(sequence, young, kCodeAgeSequenceSize) == 0); |
+bool MacroAssembler::IsYoungSequence(Isolate* isolate, byte* sequence) { |
+ bool is_young = isolate->no_code_age_sequence()->Match(sequence); |
ASSERT(is_young || IsCodeAgeSequence(sequence)); |
return is_young; |
} |
@@ -5107,6 +5097,7 @@ bool MacroAssembler::IsCodeAgeSequence(byte* sequence) { |
const int length = kCodeAgeStubEntryOffset / kInstructionSize; |
static bool initialized = false; |
static byte old[kCodeAgeStubEntryOffset]; |
+ // TODO(mvstanton): this static isn't thread safe. |
Sven Panne
2014/05/05 07:54:14
Perhaps NoCodeAgeSequence should have a more gener
mvstanton
2014/05/06 09:55:45
I changed it to CodeAgingHelper, and it can determ
|
if (!initialized) { |
PatchingAssembler patcher(old, length); |
MacroAssembler::EmitCodeAgeSequence(&patcher, NULL); |