OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/arm64/codegen-arm64.h" | 5 #include "src/arm64/codegen-arm64.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/arm64/simulator-arm64.h" | 9 #include "src/arm64/simulator-arm64.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 bool CodeAgingHelper::IsOld(byte* candidate) const { | 65 bool CodeAgingHelper::IsOld(byte* candidate) const { |
66 return memcmp(candidate, old_sequence_.start(), kCodeAgeStubEntryOffset) == 0; | 66 return memcmp(candidate, old_sequence_.start(), kCodeAgeStubEntryOffset) == 0; |
67 } | 67 } |
68 #endif | 68 #endif |
69 | 69 |
70 | 70 |
71 bool Code::IsYoungSequence(Isolate* isolate, byte* sequence) { | 71 bool Code::IsYoungSequence(Isolate* isolate, byte* sequence) { |
72 return MacroAssembler::IsYoungSequence(isolate, sequence); | 72 return MacroAssembler::IsYoungSequence(isolate, sequence); |
73 } | 73 } |
74 | 74 |
| 75 Code::Age Code::GetCodeAge(Isolate* isolate, byte* sequence) { |
| 76 if (IsYoungSequence(isolate, sequence)) return kNoAgeCodeAge; |
75 | 77 |
76 void Code::GetCodeAgeAndParity(Isolate* isolate, byte* sequence, Age* age, | 78 byte* target = sequence + kCodeAgeStubEntryOffset; |
77 MarkingParity* parity) { | 79 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); |
78 if (IsYoungSequence(isolate, sequence)) { | 80 return GetAgeOfCodeAgeStub(stub); |
79 *age = kNoAgeCodeAge; | |
80 *parity = NO_MARKING_PARITY; | |
81 } else { | |
82 byte* target = sequence + kCodeAgeStubEntryOffset; | |
83 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); | |
84 GetCodeAgeAndParity(stub, age, parity); | |
85 } | |
86 } | 81 } |
87 | 82 |
88 | 83 void Code::PatchPlatformCodeAge(Isolate* isolate, byte* sequence, |
89 void Code::PatchPlatformCodeAge(Isolate* isolate, | 84 Code::Age age) { |
90 byte* sequence, | |
91 Code::Age age, | |
92 MarkingParity parity) { | |
93 PatchingAssembler patcher(isolate, sequence, | 85 PatchingAssembler patcher(isolate, sequence, |
94 kNoCodeAgeSequenceLength / kInstructionSize); | 86 kNoCodeAgeSequenceLength / kInstructionSize); |
95 if (age == kNoAgeCodeAge) { | 87 if (age == kNoAgeCodeAge) { |
96 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); | 88 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); |
97 } else { | 89 } else { |
98 Code * stub = GetCodeAgeStub(isolate, age, parity); | 90 Code* stub = GetCodeAgeStub(isolate, age); |
99 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); | 91 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); |
100 } | 92 } |
101 } | 93 } |
102 | 94 |
103 | 95 |
104 void StringCharLoadGenerator::Generate(MacroAssembler* masm, | 96 void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
105 Register string, | 97 Register string, |
106 Register index, | 98 Register index, |
107 Register result, | 99 Register result, |
108 Label* call_runtime) { | 100 Label* call_runtime) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 __ Ldrb(result, MemOperand(string, index, SXTW)); | 175 __ Ldrb(result, MemOperand(string, index, SXTW)); |
184 __ Bind(&done); | 176 __ Bind(&done); |
185 } | 177 } |
186 | 178 |
187 #undef __ | 179 #undef __ |
188 | 180 |
189 } // namespace internal | 181 } // namespace internal |
190 } // namespace v8 | 182 } // namespace v8 |
191 | 183 |
192 #endif // V8_TARGET_ARCH_ARM64 | 184 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |