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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 // Dictionary load failed, go slow (but don't miss). | 133 // Dictionary load failed, go slow (but don't miss). |
134 __ bind(&slow); | 134 __ bind(&slow); |
135 GenerateRuntimeGetProperty(masm); | 135 GenerateRuntimeGetProperty(masm); |
136 } | 136 } |
137 | 137 |
138 | 138 |
139 // A register that isn't one of the parameters to the load ic. | 139 // A register that isn't one of the parameters to the load ic. |
140 static const Register LoadIC_TempRegister() { return a3; } | 140 static const Register LoadIC_TempRegister() { return a3; } |
141 | 141 |
142 | |
143 static void LoadIC_PushArgs(MacroAssembler* masm) { | |
144 Register receiver = LoadDescriptor::ReceiverRegister(); | |
145 Register name = LoadDescriptor::NameRegister(); | |
146 Register slot = LoadDescriptor::SlotRegister(); | |
147 Register vector = LoadWithVectorDescriptor::VectorRegister(); | |
148 | |
149 __ Push(receiver, name, slot, vector); | |
150 } | |
151 | |
152 | |
153 void LoadIC::GenerateMiss(MacroAssembler* masm) { | |
154 // The return address is on the stack. | |
155 Isolate* isolate = masm->isolate(); | |
156 | |
157 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), | |
158 LoadWithVectorDescriptor::VectorRegister())); | |
159 __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, a4, a5); | |
160 | |
161 LoadIC_PushArgs(masm); | |
162 | |
163 // Perform tail call to the entry. | |
164 __ TailCallRuntime(Runtime::kLoadIC_Miss); | |
165 } | |
166 | |
167 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 142 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
168 // The return address is in ra. | 143 // The return address is in ra. |
169 | 144 |
170 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 145 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
171 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 146 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
172 | 147 |
173 // Do tail-call to runtime routine. | 148 // Do tail-call to runtime routine. |
174 __ TailCallRuntime(Runtime::kGetProperty); | 149 __ TailCallRuntime(Runtime::kGetProperty); |
175 } | 150 } |
176 | 151 |
177 | |
178 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | |
179 // The return address is in ra. | |
180 Isolate* isolate = masm->isolate(); | |
181 | |
182 DCHECK(!AreAliased(a4, a5, LoadWithVectorDescriptor::SlotRegister(), | |
183 LoadWithVectorDescriptor::VectorRegister())); | |
184 __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, a4, a5); | |
185 | |
186 LoadIC_PushArgs(masm); | |
187 | |
188 // Perform tail call to the entry. | |
189 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss); | |
190 } | |
191 | |
192 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | |
193 // The return address is in ra. | |
194 | |
195 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | |
196 | |
197 // Do tail-call to runtime routine. | |
198 __ TailCallRuntime(Runtime::kKeyedGetProperty); | |
199 } | |
200 | |
201 static void StoreIC_PushArgs(MacroAssembler* masm) { | 152 static void StoreIC_PushArgs(MacroAssembler* masm) { |
202 __ Push(StoreWithVectorDescriptor::ValueRegister(), | 153 __ Push(StoreWithVectorDescriptor::ValueRegister(), |
203 StoreWithVectorDescriptor::SlotRegister(), | 154 StoreWithVectorDescriptor::SlotRegister(), |
204 StoreWithVectorDescriptor::VectorRegister(), | 155 StoreWithVectorDescriptor::VectorRegister(), |
205 StoreWithVectorDescriptor::ReceiverRegister(), | 156 StoreWithVectorDescriptor::ReceiverRegister(), |
206 StoreWithVectorDescriptor::NameRegister()); | 157 StoreWithVectorDescriptor::NameRegister()); |
207 } | 158 } |
208 | 159 |
209 | 160 |
210 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 161 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 break; | 327 break; |
377 default: | 328 default: |
378 UNIMPLEMENTED(); | 329 UNIMPLEMENTED(); |
379 } | 330 } |
380 patcher.ChangeBranchCondition(branch_instr, opcode); | 331 patcher.ChangeBranchCondition(branch_instr, opcode); |
381 } | 332 } |
382 } // namespace internal | 333 } // namespace internal |
383 } // namespace v8 | 334 } // namespace v8 |
384 | 335 |
385 #endif // V8_TARGET_ARCH_MIPS64 | 336 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |