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_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 __ j(equal, &probe_dictionary); | 333 __ j(equal, &probe_dictionary); |
334 | 334 |
335 Register megamorphic_scratch = rdi; | 335 Register megamorphic_scratch = rdi; |
336 // The handlers in the stub cache expect a vector and slot. Since we won't | 336 // The handlers in the stub cache expect a vector and slot. Since we won't |
337 // change the IC from any downstream misses, a dummy vector can be used. | 337 // change the IC from any downstream misses, a dummy vector can be used. |
338 Register vector = LoadWithVectorDescriptor::VectorRegister(); | 338 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
339 Register slot = LoadDescriptor::SlotRegister(); | 339 Register slot = LoadDescriptor::SlotRegister(); |
340 DCHECK(!AreAliased(megamorphic_scratch, vector, slot)); | 340 DCHECK(!AreAliased(megamorphic_scratch, vector, slot)); |
341 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( | 341 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( |
342 masm->isolate()->factory()->keyed_load_dummy_vector()); | 342 masm->isolate()->factory()->keyed_load_dummy_vector()); |
343 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); | 343 int slot_index = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); |
344 __ Move(vector, dummy_vector); | 344 __ Move(vector, dummy_vector); |
345 __ Move(slot, Smi::FromInt(int_slot)); | 345 __ Move(slot, Smi::FromInt(slot_index)); |
346 | 346 |
347 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 347 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
348 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 348 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
349 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, | 349 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, |
350 false, receiver, key, | 350 false, receiver, key, |
351 megamorphic_scratch, no_reg); | 351 megamorphic_scratch, no_reg); |
352 // Cache miss. | 352 // Cache miss. |
353 GenerateMiss(masm); | 353 GenerateMiss(masm); |
354 | 354 |
355 // Do a quick inline probe of the receiver's dictionary, if it | 355 // Do a quick inline probe of the receiver's dictionary, if it |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 __ bind(&slow); | 549 __ bind(&slow); |
550 __ Integer32ToSmi(key, key); | 550 __ Integer32ToSmi(key, key); |
551 __ bind(&slow_with_tagged_index); | 551 __ bind(&slow_with_tagged_index); |
552 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); | 552 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); |
553 // Never returns to here. | 553 // Never returns to here. |
554 | 554 |
555 __ bind(&maybe_name_key); | 555 __ bind(&maybe_name_key); |
556 __ movp(r9, FieldOperand(key, HeapObject::kMapOffset)); | 556 __ movp(r9, FieldOperand(key, HeapObject::kMapOffset)); |
557 __ movzxbp(r9, FieldOperand(r9, Map::kInstanceTypeOffset)); | 557 __ movzxbp(r9, FieldOperand(r9, Map::kInstanceTypeOffset)); |
558 __ JumpIfNotUniqueNameInstanceType(r9, &slow_with_tagged_index); | 558 __ JumpIfNotUniqueNameInstanceType(r9, &slow_with_tagged_index); |
| 559 |
| 560 if (FLAG_vector_stores) { |
| 561 Register vector = VectorStoreICDescriptor::VectorRegister(); |
| 562 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 563 // The handlers in the stub cache expect a vector and slot. Since we won't |
| 564 // change the IC from any downstream misses, a dummy vector can be used. |
| 565 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( |
| 566 masm->isolate()->factory()->keyed_store_dummy_vector()); |
| 567 int slot_index = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); |
| 568 __ Move(vector, dummy_vector); |
| 569 __ Move(slot, Smi::FromInt(slot_index)); |
| 570 } |
| 571 |
559 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 572 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
560 Code::ComputeHandlerFlags(Code::STORE_IC)); | 573 Code::ComputeHandlerFlags(Code::STORE_IC)); |
561 masm->isolate()->stub_cache()->GenerateProbe( | 574 masm->isolate()->stub_cache()->GenerateProbe( |
562 masm, Code::STORE_IC, flags, false, receiver, key, rbx, no_reg); | 575 masm, Code::STORE_IC, flags, false, receiver, key, rbx, no_reg); |
563 // Cache miss. | 576 // Cache miss. |
564 __ jmp(&miss); | 577 __ jmp(&miss); |
565 | 578 |
566 // Extra capacity case: Check if there is extra capacity to | 579 // Extra capacity case: Check if there is extra capacity to |
567 // perform the store and update the length. Used for adding one | 580 // perform the store and update the length. Used for adding one |
568 // element to the array by writing to array[array.length]. | 581 // element to the array by writing to array[array.length]. |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 Condition cc = | 859 Condition cc = |
847 (check == ENABLE_INLINED_SMI_CHECK) | 860 (check == ENABLE_INLINED_SMI_CHECK) |
848 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 861 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
849 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 862 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
850 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 863 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
851 } | 864 } |
852 } // namespace internal | 865 } // namespace internal |
853 } // namespace v8 | 866 } // namespace v8 |
854 | 867 |
855 #endif // V8_TARGET_ARCH_X64 | 868 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |