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 | 5 |
6 #include "src/v8.h" | 6 #include "src/v8.h" |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
9 | 9 |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // Dictionary load failed, go slow (but don't miss). | 265 // Dictionary load failed, go slow (but don't miss). |
266 __ bind(&slow); | 266 __ bind(&slow); |
267 GenerateRuntimeGetProperty(masm); | 267 GenerateRuntimeGetProperty(masm); |
268 } | 268 } |
269 | 269 |
270 | 270 |
271 // A register that isn't one of the parameters to the load ic. | 271 // A register that isn't one of the parameters to the load ic. |
272 static const Register LoadIC_TempRegister() { return a3; } | 272 static const Register LoadIC_TempRegister() { return a3; } |
273 | 273 |
274 | 274 |
| 275 static void LoadIC_PushArgs(MacroAssembler* masm) { |
| 276 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 277 Register name = LoadDescriptor::NameRegister(); |
| 278 if (FLAG_vector_ics) { |
| 279 Register slot = VectorLoadICDescriptor::SlotRegister(); |
| 280 Register vector = VectorLoadICDescriptor::VectorRegister(); |
| 281 |
| 282 __ Push(receiver, name, slot, vector); |
| 283 } else { |
| 284 __ Push(receiver, name); |
| 285 } |
| 286 } |
| 287 |
| 288 |
275 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 289 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
276 // The return address is in ra. | 290 // The return address is in ra. |
277 Isolate* isolate = masm->isolate(); | 291 Isolate* isolate = masm->isolate(); |
278 | 292 |
279 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, t0); | 293 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, t0); |
280 | 294 |
281 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 295 LoadIC_PushArgs(masm); |
282 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | |
283 | 296 |
284 // Perform tail call to the entry. | 297 // Perform tail call to the entry. |
285 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); | 298 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); |
286 __ TailCallExternalReference(ref, 2, 1); | 299 int arg_count = FLAG_vector_ics ? 4 : 2; |
| 300 __ TailCallExternalReference(ref, arg_count, 1); |
287 } | 301 } |
288 | 302 |
289 | 303 |
290 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 304 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
291 // The return address is in ra. | 305 // The return address is in ra. |
292 | 306 |
293 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); | 307 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
294 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); | 308 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
295 | 309 |
296 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); | 310 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 GenerateMiss(masm); | 421 GenerateMiss(masm); |
408 } | 422 } |
409 | 423 |
410 | 424 |
411 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 425 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
412 // The return address is in ra. | 426 // The return address is in ra. |
413 Isolate* isolate = masm->isolate(); | 427 Isolate* isolate = masm->isolate(); |
414 | 428 |
415 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, t0); | 429 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, a3, t0); |
416 | 430 |
417 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | 431 LoadIC_PushArgs(masm); |
418 | 432 |
419 // Perform tail call to the entry. | 433 // Perform tail call to the entry. |
420 ExternalReference ref = | 434 ExternalReference ref = |
421 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); | 435 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); |
422 | 436 |
423 __ TailCallExternalReference(ref, 2, 1); | 437 int arg_count = FLAG_vector_ics ? 4 : 2; |
| 438 __ TailCallExternalReference(ref, arg_count, 1); |
424 } | 439 } |
425 | 440 |
426 | 441 |
427 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 442 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
428 // The return address is in ra. | 443 // The return address is in ra. |
429 | 444 |
430 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); | 445 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); |
431 | 446 |
432 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); | 447 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
433 } | 448 } |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 patcher.ChangeBranchCondition(ne); | 1019 patcher.ChangeBranchCondition(ne); |
1005 } else { | 1020 } else { |
1006 DCHECK(Assembler::IsBne(branch_instr)); | 1021 DCHECK(Assembler::IsBne(branch_instr)); |
1007 patcher.ChangeBranchCondition(eq); | 1022 patcher.ChangeBranchCondition(eq); |
1008 } | 1023 } |
1009 } | 1024 } |
1010 } | 1025 } |
1011 } // namespace v8::internal | 1026 } // namespace v8::internal |
1012 | 1027 |
1013 #endif // V8_TARGET_ARCH_MIPS | 1028 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |