| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 __ beq(&probe_dictionary); | 423 __ beq(&probe_dictionary); |
| 424 | 424 |
| 425 | 425 |
| 426 // The handlers in the stub cache expect a vector and slot. Since we won't | 426 // The handlers in the stub cache expect a vector and slot. Since we won't |
| 427 // change the IC from any downstream misses, a dummy vector can be used. | 427 // change the IC from any downstream misses, a dummy vector can be used. |
| 428 Register vector = LoadWithVectorDescriptor::VectorRegister(); | 428 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
| 429 Register slot = LoadWithVectorDescriptor::SlotRegister(); | 429 Register slot = LoadWithVectorDescriptor::SlotRegister(); |
| 430 DCHECK(!AreAliased(vector, slot, r7, r8, r9, r10)); | 430 DCHECK(!AreAliased(vector, slot, r7, r8, r9, r10)); |
| 431 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( | 431 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( |
| 432 masm->isolate()->factory()->keyed_load_dummy_vector()); | 432 masm->isolate()->factory()->keyed_load_dummy_vector()); |
| 433 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); | 433 int slot_index = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); |
| 434 __ LoadRoot(vector, Heap::kKeyedLoadDummyVectorRootIndex); | 434 __ LoadRoot(vector, Heap::kKeyedLoadDummyVectorRootIndex); |
| 435 __ LoadSmiLiteral(slot, Smi::FromInt(int_slot)); | 435 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); |
| 436 | 436 |
| 437 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 437 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 438 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 438 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
| 439 masm->isolate()->stub_cache()->GenerateProbe( | 439 masm->isolate()->stub_cache()->GenerateProbe( |
| 440 masm, Code::KEYED_LOAD_IC, flags, false, receiver, key, r7, r8, r9, r10); | 440 masm, Code::KEYED_LOAD_IC, flags, false, receiver, key, r7, r8, r9, r10); |
| 441 // Cache miss. | 441 // Cache miss. |
| 442 GenerateMiss(masm); | 442 GenerateMiss(masm); |
| 443 | 443 |
| 444 // Do a quick inline probe of the receiver's dictionary, if it | 444 // Do a quick inline probe of the receiver's dictionary, if it |
| 445 // exists. | 445 // exists. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 // r3: value. | 676 // r3: value. |
| 677 // r4: key. | 677 // r4: key. |
| 678 // r5: receiver. | 678 // r5: receiver. |
| 679 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); | 679 PropertyICCompiler::GenerateRuntimeSetProperty(masm, language_mode); |
| 680 // Never returns to here. | 680 // Never returns to here. |
| 681 | 681 |
| 682 __ bind(&maybe_name_key); | 682 __ bind(&maybe_name_key); |
| 683 __ LoadP(r7, FieldMemOperand(key, HeapObject::kMapOffset)); | 683 __ LoadP(r7, FieldMemOperand(key, HeapObject::kMapOffset)); |
| 684 __ lbz(r7, FieldMemOperand(r7, Map::kInstanceTypeOffset)); | 684 __ lbz(r7, FieldMemOperand(r7, Map::kInstanceTypeOffset)); |
| 685 __ JumpIfNotUniqueNameInstanceType(r7, &slow); | 685 __ JumpIfNotUniqueNameInstanceType(r7, &slow); |
| 686 |
| 687 if (FLAG_vector_stores) { |
| 688 // The handlers in the stub cache expect a vector and slot. Since we won't |
| 689 // change the IC from any downstream misses, a dummy vector can be used. |
| 690 Register vector = VectorStoreICDescriptor::VectorRegister(); |
| 691 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 692 DCHECK(!AreAliased(vector, slot, r6, r7, r8, r9)); |
| 693 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast( |
| 694 masm->isolate()->factory()->keyed_store_dummy_vector()); |
| 695 int slot_index = dummy_vector->GetIndex(FeedbackVectorICSlot(0)); |
| 696 __ LoadRoot(vector, Heap::kKeyedStoreDummyVectorRootIndex); |
| 697 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); |
| 698 } |
| 699 |
| 686 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 700 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 687 Code::ComputeHandlerFlags(Code::STORE_IC)); | 701 Code::ComputeHandlerFlags(Code::STORE_IC)); |
| 688 masm->isolate()->stub_cache()->GenerateProbe( | 702 masm->isolate()->stub_cache()->GenerateProbe( |
| 689 masm, Code::STORE_IC, flags, false, receiver, key, r6, r7, r8, r9); | 703 masm, Code::STORE_IC, flags, false, receiver, key, r6, r7, r8, r9); |
| 690 // Cache miss. | 704 // Cache miss. |
| 691 __ b(&miss); | 705 __ b(&miss); |
| 692 | 706 |
| 693 // Extra capacity case: Check if there is extra capacity to | 707 // Extra capacity case: Check if there is extra capacity to |
| 694 // perform the store and update the length. Used for adding one | 708 // perform the store and update the length. Used for adding one |
| 695 // element to the array by writing to array[array.length]. | 709 // element to the array by writing to array[array.length]. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 patcher.EmitCondition(ne); | 898 patcher.EmitCondition(ne); |
| 885 } else { | 899 } else { |
| 886 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 900 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
| 887 patcher.EmitCondition(eq); | 901 patcher.EmitCondition(eq); |
| 888 } | 902 } |
| 889 } | 903 } |
| 890 } // namespace internal | 904 } // namespace internal |
| 891 } // namespace v8 | 905 } // namespace v8 |
| 892 | 906 |
| 893 #endif // V8_TARGET_ARCH_PPC | 907 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |