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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 } | 289 } |
290 | 290 |
291 | 291 |
292 // A register that isn't one of the parameters to the load ic. | 292 // A register that isn't one of the parameters to the load ic. |
293 static const Register LoadIC_TempRegister() { return a3; } | 293 static const Register LoadIC_TempRegister() { return a3; } |
294 | 294 |
295 | 295 |
296 static void LoadIC_PushArgs(MacroAssembler* masm) { | 296 static void LoadIC_PushArgs(MacroAssembler* masm) { |
297 Register receiver = LoadDescriptor::ReceiverRegister(); | 297 Register receiver = LoadDescriptor::ReceiverRegister(); |
298 Register name = LoadDescriptor::NameRegister(); | 298 Register name = LoadDescriptor::NameRegister(); |
299 Register slot = VectorLoadICDescriptor::SlotRegister(); | 299 Register slot = LoadDescriptor::SlotRegister(); |
300 Register vector = VectorLoadICDescriptor::VectorRegister(); | 300 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
301 | 301 |
302 __ Push(receiver, name, slot, vector); | 302 __ Push(receiver, name, slot, vector); |
303 } | 303 } |
304 | 304 |
305 | 305 |
306 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 306 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
307 // The return address is in ra. | 307 // The return address is in ra. |
308 Isolate* isolate = masm->isolate(); | 308 Isolate* isolate = masm->isolate(); |
309 | 309 |
310 DCHECK(!AreAliased(t0, t1, VectorLoadICDescriptor::SlotRegister(), | 310 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), |
311 VectorLoadICDescriptor::VectorRegister())); | 311 LoadWithVectorDescriptor::VectorRegister())); |
312 __ IncrementCounter(isolate->counters()->load_miss(), 1, t0, t1); | 312 __ IncrementCounter(isolate->counters()->load_miss(), 1, t0, t1); |
313 | 313 |
314 LoadIC_PushArgs(masm); | 314 LoadIC_PushArgs(masm); |
315 | 315 |
316 // Perform tail call to the entry. | 316 // Perform tail call to the entry. |
317 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); | 317 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); |
318 int arg_count = 4; | 318 int arg_count = 4; |
319 __ TailCallExternalReference(ref, arg_count, 1); | 319 __ TailCallExternalReference(ref, arg_count, 1); |
320 } | 320 } |
321 | 321 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 __ mov(v0, a0); // (In delay slot) return the value stored in v0. | 438 __ mov(v0, a0); // (In delay slot) return the value stored in v0. |
439 __ bind(&slow); | 439 __ bind(&slow); |
440 GenerateMiss(masm); | 440 GenerateMiss(masm); |
441 } | 441 } |
442 | 442 |
443 | 443 |
444 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 444 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
445 // The return address is in ra. | 445 // The return address is in ra. |
446 Isolate* isolate = masm->isolate(); | 446 Isolate* isolate = masm->isolate(); |
447 | 447 |
448 DCHECK(!AreAliased(t0, t1, VectorLoadICDescriptor::SlotRegister(), | 448 DCHECK(!AreAliased(t0, t1, LoadWithVectorDescriptor::SlotRegister(), |
449 VectorLoadICDescriptor::VectorRegister())); | 449 LoadWithVectorDescriptor::VectorRegister())); |
450 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, t0, t1); | 450 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, t0, t1); |
451 | 451 |
452 LoadIC_PushArgs(masm); | 452 LoadIC_PushArgs(masm); |
453 | 453 |
454 // Perform tail call to the entry. | 454 // Perform tail call to the entry. |
455 ExternalReference ref = | 455 ExternalReference ref = |
456 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); | 456 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); |
457 | 457 |
458 int arg_count = 4; | 458 int arg_count = 4; |
459 __ TailCallExternalReference(ref, arg_count, 1); | 459 __ TailCallExternalReference(ref, arg_count, 1); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 // If the receiver is a fast-case object, check the stub cache. Otherwise | 526 // If the receiver is a fast-case object, check the stub cache. Otherwise |
527 // probe the dictionary. | 527 // probe the dictionary. |
528 __ lw(a3, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 528 __ lw(a3, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
529 __ lw(t0, FieldMemOperand(a3, HeapObject::kMapOffset)); | 529 __ lw(t0, FieldMemOperand(a3, HeapObject::kMapOffset)); |
530 __ LoadRoot(at, Heap::kHashTableMapRootIndex); | 530 __ LoadRoot(at, Heap::kHashTableMapRootIndex); |
531 __ Branch(&probe_dictionary, eq, t0, Operand(at)); | 531 __ Branch(&probe_dictionary, eq, t0, Operand(at)); |
532 | 532 |
533 // The handlers in the stub cache expect a vector and slot. Since we won't | 533 // The handlers in the stub cache expect a vector and slot. Since we won't |
534 // change the IC from any downstream misses, a dummy vector can be used. | 534 // change the IC from any downstream misses, a dummy vector can be used. |
535 Register vector = VectorLoadICDescriptor::VectorRegister(); | 535 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
536 Register slot = VectorLoadICDescriptor::SlotRegister(); | 536 Register slot = LoadWithVectorDescriptor::SlotRegister(); |
537 DCHECK(!AreAliased(vector, slot, t0, t1, t2, t5)); | 537 DCHECK(!AreAliased(vector, slot, t0, t1, t2, t5)); |
538 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( | 538 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( |
539 masm->isolate()->factory()->keyed_load_dummy_vector()); | 539 masm->isolate()->factory()->keyed_load_dummy_vector()); |
540 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); | 540 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); |
541 __ LoadRoot(vector, Heap::kKeyedLoadDummyVectorRootIndex); | 541 __ LoadRoot(vector, Heap::kKeyedLoadDummyVectorRootIndex); |
542 __ li(slot, Operand(Smi::FromInt(int_slot))); | 542 __ li(slot, Operand(Smi::FromInt(int_slot))); |
543 | 543 |
544 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 544 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
545 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 545 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
546 masm->isolate()->stub_cache()->GenerateProbe( | 546 masm->isolate()->stub_cache()->GenerateProbe( |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 patcher.ChangeBranchCondition(ne); | 978 patcher.ChangeBranchCondition(ne); |
979 } else { | 979 } else { |
980 DCHECK(Assembler::IsBne(branch_instr)); | 980 DCHECK(Assembler::IsBne(branch_instr)); |
981 patcher.ChangeBranchCondition(eq); | 981 patcher.ChangeBranchCondition(eq); |
982 } | 982 } |
983 } | 983 } |
984 } | 984 } |
985 } // namespace v8::internal | 985 } // namespace v8::internal |
986 | 986 |
987 #endif // V8_TARGET_ARCH_MIPS | 987 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |