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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 | 283 |
284 | 284 |
285 // A register that isn't one of the parameters to the load ic. | 285 // A register that isn't one of the parameters to the load ic. |
286 static const Register LoadIC_TempRegister() { return r3; } | 286 static const Register LoadIC_TempRegister() { return r3; } |
287 | 287 |
288 | 288 |
289 static void LoadIC_PushArgs(MacroAssembler* masm) { | 289 static void LoadIC_PushArgs(MacroAssembler* masm) { |
290 Register receiver = LoadDescriptor::ReceiverRegister(); | 290 Register receiver = LoadDescriptor::ReceiverRegister(); |
291 Register name = LoadDescriptor::NameRegister(); | 291 Register name = LoadDescriptor::NameRegister(); |
292 Register slot = VectorLoadICDescriptor::SlotRegister(); | 292 Register slot = LoadDescriptor::SlotRegister(); |
293 Register vector = VectorLoadICDescriptor::VectorRegister(); | 293 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
294 | 294 |
295 __ Push(receiver, name, slot, vector); | 295 __ Push(receiver, name, slot, vector); |
296 } | 296 } |
297 | 297 |
298 | 298 |
299 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 299 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
300 // The return address is in lr. | 300 // The return address is in lr. |
301 Isolate* isolate = masm->isolate(); | 301 Isolate* isolate = masm->isolate(); |
302 | 302 |
303 DCHECK(!AreAliased(r4, r5, VectorLoadICDescriptor::SlotRegister(), | 303 DCHECK(!AreAliased(r4, r5, LoadWithVectorDescriptor::SlotRegister(), |
304 VectorLoadICDescriptor::VectorRegister())); | 304 LoadWithVectorDescriptor::VectorRegister())); |
305 __ IncrementCounter(isolate->counters()->load_miss(), 1, r4, r5); | 305 __ IncrementCounter(isolate->counters()->load_miss(), 1, r4, r5); |
306 | 306 |
307 LoadIC_PushArgs(masm); | 307 LoadIC_PushArgs(masm); |
308 | 308 |
309 // Perform tail call to the entry. | 309 // Perform tail call to the entry. |
310 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); | 310 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); |
311 int arg_count = 4; | 311 int arg_count = 4; |
312 __ TailCallExternalReference(ref, arg_count, 1); | 312 __ TailCallExternalReference(ref, arg_count, 1); |
313 } | 313 } |
314 | 314 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 __ Ret(); | 429 __ Ret(); |
430 __ bind(&slow); | 430 __ bind(&slow); |
431 GenerateMiss(masm); | 431 GenerateMiss(masm); |
432 } | 432 } |
433 | 433 |
434 | 434 |
435 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 435 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
436 // The return address is in lr. | 436 // The return address is in lr. |
437 Isolate* isolate = masm->isolate(); | 437 Isolate* isolate = masm->isolate(); |
438 | 438 |
439 DCHECK(!AreAliased(r4, r5, VectorLoadICDescriptor::SlotRegister(), | 439 DCHECK(!AreAliased(r4, r5, LoadWithVectorDescriptor::SlotRegister(), |
440 VectorLoadICDescriptor::VectorRegister())); | 440 LoadWithVectorDescriptor::VectorRegister())); |
441 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r4, r5); | 441 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r4, r5); |
442 | 442 |
443 LoadIC_PushArgs(masm); | 443 LoadIC_PushArgs(masm); |
444 | 444 |
445 // Perform tail call to the entry. | 445 // Perform tail call to the entry. |
446 ExternalReference ref = | 446 ExternalReference ref = |
447 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); | 447 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); |
448 int arg_count = 4; | 448 int arg_count = 4; |
449 __ TailCallExternalReference(ref, arg_count, 1); | 449 __ TailCallExternalReference(ref, arg_count, 1); |
450 } | 450 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 // If the receiver is a fast-case object, check the stub cache. Otherwise | 516 // If the receiver is a fast-case object, check the stub cache. Otherwise |
517 // probe the dictionary. | 517 // probe the dictionary. |
518 __ ldr(r3, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); | 518 __ ldr(r3, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); |
519 __ ldr(r4, FieldMemOperand(r3, HeapObject::kMapOffset)); | 519 __ ldr(r4, FieldMemOperand(r3, HeapObject::kMapOffset)); |
520 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); | 520 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); |
521 __ cmp(r4, ip); | 521 __ cmp(r4, ip); |
522 __ b(eq, &probe_dictionary); | 522 __ b(eq, &probe_dictionary); |
523 | 523 |
524 // The handlers in the stub cache expect a vector and slot. Since we won't | 524 // The handlers in the stub cache expect a vector and slot. Since we won't |
525 // change the IC from any downstream misses, a dummy vector can be used. | 525 // change the IC from any downstream misses, a dummy vector can be used. |
526 Register vector = VectorLoadICDescriptor::VectorRegister(); | 526 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
527 Register slot = VectorLoadICDescriptor::SlotRegister(); | 527 Register slot = LoadWithVectorDescriptor::SlotRegister(); |
528 DCHECK(!AreAliased(vector, slot, r4, r5, r6, r9)); | 528 DCHECK(!AreAliased(vector, slot, r4, r5, r6, r9)); |
529 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( | 529 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( |
530 masm->isolate()->factory()->keyed_load_dummy_vector()); | 530 masm->isolate()->factory()->keyed_load_dummy_vector()); |
531 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); | 531 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); |
532 __ LoadRoot(vector, Heap::kKeyedLoadDummyVectorRootIndex); | 532 __ LoadRoot(vector, Heap::kKeyedLoadDummyVectorRootIndex); |
533 __ mov(slot, Operand(Smi::FromInt(int_slot))); | 533 __ mov(slot, Operand(Smi::FromInt(int_slot))); |
534 | 534 |
535 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 535 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
536 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 536 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
537 masm->isolate()->stub_cache()->GenerateProbe( | 537 masm->isolate()->stub_cache()->GenerateProbe( |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 patcher.EmitCondition(ne); | 971 patcher.EmitCondition(ne); |
972 } else { | 972 } else { |
973 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 973 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
974 patcher.EmitCondition(eq); | 974 patcher.EmitCondition(eq); |
975 } | 975 } |
976 } | 976 } |
977 } | 977 } |
978 } // namespace v8::internal | 978 } // namespace v8::internal |
979 | 979 |
980 #endif // V8_TARGET_ARCH_ARM | 980 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |