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 | 75 Code::Age Code::GetCodeAge(Isolate* isolate, byte* sequence) { |
76 void Code::GetCodeAgeAndParity(Isolate* isolate, byte* sequence, Age* age, | |
77 MarkingParity* parity) { | |
78 if (IsYoungSequence(isolate, sequence)) { | 76 if (IsYoungSequence(isolate, sequence)) { |
79 *age = kNoAgeCodeAge; | 77 return kNoAgeCodeAge; |
80 *parity = NO_MARKING_PARITY; | |
81 } else { | 78 } else { |
82 byte* target = sequence + kCodeAgeStubEntryOffset; | 79 byte* target = sequence + kCodeAgeStubEntryOffset; |
83 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); | 80 Code* stub = GetCodeFromTargetAddress(Memory::Address_at(target)); |
84 GetCodeAgeAndParity(stub, age, parity); | 81 return GetAgeOfCodeAgeStub(stub); |
85 } | 82 } |
86 } | 83 } |
87 | 84 |
88 | 85 void Code::PatchPlatformCodeAge(Isolate* isolate, byte* sequence, |
89 void Code::PatchPlatformCodeAge(Isolate* isolate, | 86 Code::Age age) { |
90 byte* sequence, | |
91 Code::Age age, | |
92 MarkingParity parity) { | |
93 PatchingAssembler patcher(isolate, sequence, | 87 PatchingAssembler patcher(isolate, sequence, |
94 kNoCodeAgeSequenceLength / kInstructionSize); | 88 kNoCodeAgeSequenceLength / kInstructionSize); |
95 if (age == kNoAgeCodeAge) { | 89 if (age == kNoAgeCodeAge) { |
96 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); | 90 MacroAssembler::EmitFrameSetupForCodeAgePatching(&patcher); |
97 } else { | 91 } else { |
98 Code * stub = GetCodeAgeStub(isolate, age, parity); | 92 Code* stub = GetCodeAgeStub(isolate, age); |
99 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); | 93 MacroAssembler::EmitCodeAgeSequence(&patcher, stub); |
100 } | 94 } |
101 } | 95 } |
102 | 96 |
103 | 97 |
104 void StringCharLoadGenerator::Generate(MacroAssembler* masm, | 98 void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
105 Register string, | 99 Register string, |
106 Register index, | 100 Register index, |
107 Register result, | 101 Register result, |
108 Label* call_runtime) { | 102 Label* call_runtime) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 __ Ldrb(result, MemOperand(string, index, SXTW)); | 177 __ Ldrb(result, MemOperand(string, index, SXTW)); |
184 __ Bind(&done); | 178 __ Bind(&done); |
185 } | 179 } |
186 | 180 |
187 #undef __ | 181 #undef __ |
188 | 182 |
189 } // namespace internal | 183 } // namespace internal |
190 } // namespace v8 | 184 } // namespace v8 |
191 | 185 |
192 #endif // V8_TARGET_ARCH_ARM64 | 186 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |