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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 Handle<TypeFeedbackVector> dummy_vector = | 346 Handle<TypeFeedbackVector> dummy_vector = |
347 TypeFeedbackVector::DummyVector(masm->isolate()); | 347 TypeFeedbackVector::DummyVector(masm->isolate()); |
348 int slot_index = dummy_vector->GetIndex( | 348 int slot_index = dummy_vector->GetIndex( |
349 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 349 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
350 __ Move(vector, dummy_vector); | 350 __ Move(vector, dummy_vector); |
351 __ Move(slot, Smi::FromInt(slot_index)); | 351 __ Move(slot, Smi::FromInt(slot_index)); |
352 | 352 |
353 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 353 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
354 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 354 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
355 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, | 355 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
356 false, receiver, key, | 356 receiver, key, |
357 megamorphic_scratch, no_reg); | 357 megamorphic_scratch, no_reg); |
358 // Cache miss. | 358 // Cache miss. |
359 GenerateMiss(masm); | 359 GenerateMiss(masm); |
360 | 360 |
361 // Do a quick inline probe of the receiver's dictionary, if it | 361 // Do a quick inline probe of the receiver's dictionary, if it |
362 // exists. | 362 // exists. |
363 __ bind(&probe_dictionary); | 363 __ bind(&probe_dictionary); |
364 // rbx: elements | 364 // rbx: elements |
365 | 365 |
366 __ movp(rax, FieldOperand(receiver, JSObject::kMapOffset)); | 366 __ movp(rax, FieldOperand(receiver, JSObject::kMapOffset)); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 Handle<TypeFeedbackVector> dummy_vector = | 574 Handle<TypeFeedbackVector> dummy_vector = |
575 TypeFeedbackVector::DummyVector(masm->isolate()); | 575 TypeFeedbackVector::DummyVector(masm->isolate()); |
576 int slot_index = dummy_vector->GetIndex( | 576 int slot_index = dummy_vector->GetIndex( |
577 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 577 FeedbackVectorICSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
578 __ Move(vector, dummy_vector); | 578 __ Move(vector, dummy_vector); |
579 __ Move(slot, Smi::FromInt(slot_index)); | 579 __ Move(slot, Smi::FromInt(slot_index)); |
580 } | 580 } |
581 | 581 |
582 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 582 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
583 Code::ComputeHandlerFlags(Code::STORE_IC)); | 583 Code::ComputeHandlerFlags(Code::STORE_IC)); |
584 masm->isolate()->stub_cache()->GenerateProbe( | 584 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::STORE_IC, flags, |
585 masm, Code::STORE_IC, flags, false, receiver, key, rbx, no_reg); | 585 receiver, key, rbx, no_reg); |
586 // Cache miss. | 586 // Cache miss. |
587 __ jmp(&miss); | 587 __ jmp(&miss); |
588 | 588 |
589 // Extra capacity case: Check if there is extra capacity to | 589 // Extra capacity case: Check if there is extra capacity to |
590 // perform the store and update the length. Used for adding one | 590 // perform the store and update the length. Used for adding one |
591 // element to the array by writing to array[array.length]. | 591 // element to the array by writing to array[array.length]. |
592 __ bind(&extra); | 592 __ bind(&extra); |
593 // receiver is a JSArray. | 593 // receiver is a JSArray. |
594 // rbx: receiver's elements array (a FixedArray) | 594 // rbx: receiver's elements array (a FixedArray) |
595 // flags: smicompare (receiver.length(), rbx) | 595 // flags: smicompare (receiver.length(), rbx) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 } | 734 } |
735 | 735 |
736 | 736 |
737 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 737 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
738 // The return address is on the stack. | 738 // The return address is on the stack. |
739 | 739 |
740 // Get the receiver from the stack and probe the stub cache. | 740 // Get the receiver from the stack and probe the stub cache. |
741 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 741 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
742 Code::ComputeHandlerFlags(Code::STORE_IC)); | 742 Code::ComputeHandlerFlags(Code::STORE_IC)); |
743 masm->isolate()->stub_cache()->GenerateProbe( | 743 masm->isolate()->stub_cache()->GenerateProbe( |
744 masm, Code::STORE_IC, flags, false, StoreDescriptor::ReceiverRegister(), | 744 masm, Code::STORE_IC, flags, StoreDescriptor::ReceiverRegister(), |
745 StoreDescriptor::NameRegister(), rbx, no_reg); | 745 StoreDescriptor::NameRegister(), rbx, no_reg); |
746 | 746 |
747 // Cache miss: Jump to runtime. | 747 // Cache miss: Jump to runtime. |
748 GenerateMiss(masm); | 748 GenerateMiss(masm); |
749 } | 749 } |
750 | 750 |
751 | 751 |
752 static void StoreIC_PushArgs(MacroAssembler* masm) { | 752 static void StoreIC_PushArgs(MacroAssembler* masm) { |
753 Register receiver = StoreDescriptor::ReceiverRegister(); | 753 Register receiver = StoreDescriptor::ReceiverRegister(); |
754 Register name = StoreDescriptor::NameRegister(); | 754 Register name = StoreDescriptor::NameRegister(); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 Condition cc = | 878 Condition cc = |
879 (check == ENABLE_INLINED_SMI_CHECK) | 879 (check == ENABLE_INLINED_SMI_CHECK) |
880 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 880 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
881 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 881 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
882 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 882 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
883 } | 883 } |
884 } // namespace internal | 884 } // namespace internal |
885 } // namespace v8 | 885 } // namespace v8 |
886 | 886 |
887 #endif // V8_TARGET_ARCH_X64 | 887 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |