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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 a3; } | 142 static const Register LoadIC_TempRegister() { return a3; } |
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 ra. | |
157 Isolate* isolate = masm->isolate(); | |
158 | |
159 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), | |
160 LoadWithVectorDescriptor::VectorRegister())); | |
161 __ IncrementCounter(isolate->counters()->ic_load_miss(), 1, t0, t1); | |
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 ra. | 145 // The return address is in ra. |
171 | 146 |
172 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 147 __ mov(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 ra. | |
182 Isolate* isolate = masm->isolate(); | |
183 | |
184 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), | |
185 LoadWithVectorDescriptor::VectorRegister())); | |
186 __ IncrementCounter(isolate->counters()->ic_keyed_load_miss(), 1, t0, t1); | |
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 ra. | |
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 break; | 331 break; |
381 default: | 332 default: |
382 UNIMPLEMENTED(); | 333 UNIMPLEMENTED(); |
383 } | 334 } |
384 patcher.ChangeBranchCondition(branch_instr, opcode); | 335 patcher.ChangeBranchCondition(branch_instr, opcode); |
385 } | 336 } |
386 } // namespace internal | 337 } // namespace internal |
387 } // namespace v8 | 338 } // namespace v8 |
388 | 339 |
389 #endif // V8_TARGET_ARCH_MIPS | 340 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |