OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 // Dictionary load failed, go slow (but don't miss). | 135 // Dictionary load failed, go slow (but don't miss). |
136 __ bind(&slow); | 136 __ bind(&slow); |
137 GenerateRuntimeGetProperty(masm); | 137 GenerateRuntimeGetProperty(masm); |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 // A register that isn't one of the parameters to the load ic. | 141 // A register that isn't one of the parameters to the load ic. |
142 static const Register LoadIC_TempRegister() { return r6; } | 142 static const Register LoadIC_TempRegister() { return r6; } |
143 | 143 |
144 | |
145 static void LoadIC_PushArgs(MacroAssembler* masm) { | |
146 Register receiver = LoadDescriptor::ReceiverRegister(); | |
147 Register name = LoadDescriptor::NameRegister(); | |
148 Register slot = LoadDescriptor::SlotRegister(); | |
149 Register vector = LoadWithVectorDescriptor::VectorRegister(); | |
150 | |
151 __ Push(receiver, name, slot, vector); | |
152 } | |
153 | |
154 | |
155 void LoadIC::GenerateMiss(MacroAssembler* masm) { | |
156 // The return address is in lr. | |
157 Isolate* isolate = masm->isolate(); | |
158 | |
159 DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), | |
160 LoadWithVectorDescriptor::VectorRegister())); | |
161 __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, r7, r8); | |
162 | |
163 LoadIC_PushArgs(masm); | |
164 | |
165 // Perform tail call to the entry. | |
166 __ TailCallRuntime(Runtime::kLoadIC_Miss); | |
167 } | |
168 | |
169 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 144 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
170 // The return address is in lr. | 145 // The return address is in lr. |
171 | 146 |
172 __ mr(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 147 __ mr(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
173 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 148 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
174 | 149 |
175 // Do tail-call to runtime routine. | 150 // Do tail-call to runtime routine. |
176 __ TailCallRuntime(Runtime::kGetProperty); | 151 __ TailCallRuntime(Runtime::kGetProperty); |
177 } | 152 } |
178 | 153 |
179 | |
180 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | |
181 // The return address is in lr. | |
182 Isolate* isolate = masm->isolate(); | |
183 | |
184 DCHECK(!AreAliased(r7, r8, LoadWithVectorDescriptor::SlotRegister(), | |
185 LoadWithVectorDescriptor::VectorRegister())); | |
186 __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, r7, r8); | |
187 | |
188 LoadIC_PushArgs(masm); | |
189 | |
190 // Perform tail call to the entry. | |
191 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); | |
192 } | |
193 | |
194 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | |
195 // The return address is in lr. | |
196 | |
197 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | |
198 | |
199 // Do tail-call to runtime routine. | |
200 __ TailCallRuntime(Runtime::kKeyedGetProperty); | |
201 } | |
202 | |
203 static void StoreIC_PushArgs(MacroAssembler* masm) { | 154 static void StoreIC_PushArgs(MacroAssembler* masm) { |
204 __ Push(StoreWithVectorDescriptor::ValueRegister(), | 155 __ Push(StoreWithVectorDescriptor::ValueRegister(), |
205 StoreWithVectorDescriptor::SlotRegister(), | 156 StoreWithVectorDescriptor::SlotRegister(), |
206 StoreWithVectorDescriptor::VectorRegister(), | 157 StoreWithVectorDescriptor::VectorRegister(), |
207 StoreWithVectorDescriptor::ReceiverRegister(), | 158 StoreWithVectorDescriptor::ReceiverRegister(), |
208 StoreWithVectorDescriptor::NameRegister()); | 159 StoreWithVectorDescriptor::NameRegister()); |
209 } | 160 } |
210 | 161 |
211 | 162 |
212 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 163 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 patcher.EmitCondition(ne); | 304 patcher.EmitCondition(ne); |
354 } else { | 305 } else { |
355 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 306 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
356 patcher.EmitCondition(eq); | 307 patcher.EmitCondition(eq); |
357 } | 308 } |
358 } | 309 } |
359 } // namespace internal | 310 } // namespace internal |
360 } // namespace v8 | 311 } // namespace v8 |
361 | 312 |
362 #endif // V8_TARGET_ARCH_PPC | 313 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |