| 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 Register vector = LoadWithVectorDescriptor::VectorRegister(); | 418 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
| 419 Register slot = LoadWithVectorDescriptor::SlotRegister(); | 419 Register slot = LoadWithVectorDescriptor::SlotRegister(); |
| 420 DCHECK(!AreAliased(vector, slot, r7, r8, r9, r10)); | 420 DCHECK(!AreAliased(vector, slot, r7, r8, r9, r10)); |
| 421 Handle<TypeFeedbackVector> dummy_vector = | 421 Handle<TypeFeedbackVector> dummy_vector = |
| 422 TypeFeedbackVector::DummyVector(masm->isolate()); | 422 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 423 int slot_index = dummy_vector->GetIndex( | 423 int slot_index = dummy_vector->GetIndex( |
| 424 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); | 424 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedLoadICSlot)); |
| 425 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 425 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
| 426 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); | 426 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); |
| 427 | 427 |
| 428 Code::Flags flags = | 428 masm->isolate()->load_stub_cache()->GenerateProbe(masm, receiver, key, r7, r8, |
| 429 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::LOAD_IC)); | 429 r9, r10); |
| 430 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags, | |
| 431 receiver, key, r7, r8, r9, r10); | |
| 432 // Cache miss. | 430 // Cache miss. |
| 433 GenerateMiss(masm); | 431 GenerateMiss(masm); |
| 434 | 432 |
| 435 // Do a quick inline probe of the receiver's dictionary, if it | 433 // Do a quick inline probe of the receiver's dictionary, if it |
| 436 // exists. | 434 // exists. |
| 437 __ bind(&probe_dictionary); | 435 __ bind(&probe_dictionary); |
| 438 // r6: elements | 436 // r6: elements |
| 439 __ LoadP(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 437 __ LoadP(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| 440 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); | 438 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); |
| 441 GenerateGlobalInstanceTypeCheck(masm, r3, &slow); | 439 GenerateGlobalInstanceTypeCheck(masm, r3, &slow); |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 Register vector = VectorStoreICDescriptor::VectorRegister(); | 676 Register vector = VectorStoreICDescriptor::VectorRegister(); |
| 679 Register slot = VectorStoreICDescriptor::SlotRegister(); | 677 Register slot = VectorStoreICDescriptor::SlotRegister(); |
| 680 DCHECK(!AreAliased(vector, slot, r8, r9, r10, r11)); | 678 DCHECK(!AreAliased(vector, slot, r8, r9, r10, r11)); |
| 681 Handle<TypeFeedbackVector> dummy_vector = | 679 Handle<TypeFeedbackVector> dummy_vector = |
| 682 TypeFeedbackVector::DummyVector(masm->isolate()); | 680 TypeFeedbackVector::DummyVector(masm->isolate()); |
| 683 int slot_index = dummy_vector->GetIndex( | 681 int slot_index = dummy_vector->GetIndex( |
| 684 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); | 682 FeedbackVectorSlot(TypeFeedbackVector::kDummyKeyedStoreICSlot)); |
| 685 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); | 683 __ LoadRoot(vector, Heap::kDummyVectorRootIndex); |
| 686 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); | 684 __ LoadSmiLiteral(slot, Smi::FromInt(slot_index)); |
| 687 | 685 |
| 688 Code::Flags flags = | 686 masm->isolate()->store_stub_cache()->GenerateProbe(masm, receiver, key, r8, |
| 689 Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(Code::STORE_IC)); | 687 r9, r10, r11); |
| 690 masm->isolate()->stub_cache()->GenerateProbe( | |
| 691 masm, Code::KEYED_STORE_IC, flags, receiver, key, r8, r9, r10, r11); | |
| 692 // Cache miss. | 688 // Cache miss. |
| 693 __ b(&miss); | 689 __ b(&miss); |
| 694 | 690 |
| 695 // Extra capacity case: Check if there is extra capacity to | 691 // Extra capacity case: Check if there is extra capacity to |
| 696 // perform the store and update the length. Used for adding one | 692 // perform the store and update the length. Used for adding one |
| 697 // element to the array by writing to array[array.length]. | 693 // element to the array by writing to array[array.length]. |
| 698 __ bind(&extra); | 694 __ bind(&extra); |
| 699 // Condition code from comparing key and array length is still available. | 695 // Condition code from comparing key and array length is still available. |
| 700 __ bne(&slow); // Only support writing to writing to array[array.length]. | 696 __ bne(&slow); // Only support writing to writing to array[array.length]. |
| 701 // Check for room in the elements backing store. | 697 // Check for room in the elements backing store. |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 patcher.EmitCondition(ne); | 863 patcher.EmitCondition(ne); |
| 868 } else { | 864 } else { |
| 869 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 865 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
| 870 patcher.EmitCondition(eq); | 866 patcher.EmitCondition(eq); |
| 871 } | 867 } |
| 872 } | 868 } |
| 873 } // namespace internal | 869 } // namespace internal |
| 874 } // namespace v8 | 870 } // namespace v8 |
| 875 | 871 |
| 876 #endif // V8_TARGET_ARCH_PPC | 872 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |