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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4562 | 4562 |
4563 | 4563 |
4564 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } | 4564 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } |
4565 | 4565 |
4566 | 4566 |
4567 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) { | 4567 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) { |
4568 GenerateImpl(masm, true); | 4568 GenerateImpl(masm, true); |
4569 } | 4569 } |
4570 | 4570 |
4571 | 4571 |
4572 static void HandleArrayCases(MacroAssembler* masm, Register receiver, | 4572 static void HandleArrayCases(MacroAssembler* masm, Register feedback, |
4573 Register key, Register vector, Register slot, | 4573 Register receiver_map, Register scratch1, |
4574 Register feedback, Register receiver_map, | 4574 Register scratch2, bool is_polymorphic, |
4575 Register scratch1, Register scratch2, | 4575 Label* miss) { |
4576 bool is_polymorphic, Label* miss) { | |
4577 // feedback initially contains the feedback array | 4576 // feedback initially contains the feedback array |
4578 Label next_loop, prepare_next; | 4577 Label next_loop, prepare_next; |
4579 Label start_polymorphic; | 4578 Label start_polymorphic; |
4580 | 4579 |
4581 Register cached_map = scratch1; | 4580 Register cached_map = scratch1; |
4582 | 4581 |
4583 __ LoadP(cached_map, | 4582 __ LoadP(cached_map, |
4584 FieldMemOperand(feedback, FixedArray::OffsetOfElementAt(0))); | 4583 FieldMemOperand(feedback, FixedArray::OffsetOfElementAt(0))); |
4585 __ LoadP(cached_map, FieldMemOperand(cached_map, WeakCell::kValueOffset)); | 4584 __ LoadP(cached_map, FieldMemOperand(cached_map, WeakCell::kValueOffset)); |
4586 __ cmp(receiver_map, cached_map); | 4585 __ cmp(receiver_map, cached_map); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4683 Label try_array, load_smi_map, compare_map; | 4682 Label try_array, load_smi_map, compare_map; |
4684 Label not_array, miss; | 4683 Label not_array, miss; |
4685 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, | 4684 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, |
4686 scratch1, &compare_map, &load_smi_map, &try_array); | 4685 scratch1, &compare_map, &load_smi_map, &try_array); |
4687 | 4686 |
4688 // Is it a fixed array? | 4687 // Is it a fixed array? |
4689 __ bind(&try_array); | 4688 __ bind(&try_array); |
4690 __ LoadP(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4689 __ LoadP(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
4691 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); | 4690 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); |
4692 __ bne(¬_array); | 4691 __ bne(¬_array); |
4693 HandleArrayCases(masm, receiver, name, vector, slot, feedback, receiver_map, | 4692 HandleArrayCases(masm, feedback, receiver_map, scratch1, r10, true, &miss); |
4694 scratch1, r10, true, &miss); | |
4695 | 4693 |
4696 __ bind(¬_array); | 4694 __ bind(¬_array); |
4697 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); | 4695 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); |
4698 __ bne(&miss); | 4696 __ bne(&miss); |
4699 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( | 4697 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( |
4700 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 4698 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
4701 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, | 4699 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, |
4702 receiver, name, feedback, | 4700 receiver, name, feedback, |
4703 receiver_map, scratch1, r10); | 4701 receiver_map, scratch1, r10); |
4704 | 4702 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4744 | 4742 |
4745 __ bind(&try_array); | 4743 __ bind(&try_array); |
4746 // Is it a fixed array? | 4744 // Is it a fixed array? |
4747 __ LoadP(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4745 __ LoadP(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
4748 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); | 4746 __ CompareRoot(scratch1, Heap::kFixedArrayMapRootIndex); |
4749 __ bne(¬_array); | 4747 __ bne(¬_array); |
4750 | 4748 |
4751 // We have a polymorphic element handler. | 4749 // We have a polymorphic element handler. |
4752 Label polymorphic, try_poly_name; | 4750 Label polymorphic, try_poly_name; |
4753 __ bind(&polymorphic); | 4751 __ bind(&polymorphic); |
4754 HandleArrayCases(masm, receiver, key, vector, slot, feedback, receiver_map, | 4752 HandleArrayCases(masm, feedback, receiver_map, scratch1, r10, true, &miss); |
4755 scratch1, r10, true, &miss); | |
4756 | 4753 |
4757 __ bind(¬_array); | 4754 __ bind(¬_array); |
4758 // Is it generic? | 4755 // Is it generic? |
4759 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); | 4756 __ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex); |
4760 __ bne(&try_poly_name); | 4757 __ bne(&try_poly_name); |
4761 Handle<Code> megamorphic_stub = | 4758 Handle<Code> megamorphic_stub = |
4762 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState()); | 4759 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState()); |
4763 __ Jump(megamorphic_stub, RelocInfo::CODE_TARGET); | 4760 __ Jump(megamorphic_stub, RelocInfo::CODE_TARGET); |
4764 | 4761 |
4765 __ bind(&try_poly_name); | 4762 __ bind(&try_poly_name); |
4766 // We might have a name in feedback, and a fixed array in the next slot. | 4763 // We might have a name in feedback, and a fixed array in the next slot. |
4767 __ cmp(key, feedback); | 4764 __ cmp(key, feedback); |
4768 __ bne(&miss); | 4765 __ bne(&miss); |
4769 // If the name comparison succeeded, we know we have a fixed array with | 4766 // If the name comparison succeeded, we know we have a fixed array with |
4770 // at least one map/handler pair. | 4767 // at least one map/handler pair. |
4771 __ SmiToPtrArrayOffset(r0, slot); | 4768 __ SmiToPtrArrayOffset(r0, slot); |
4772 __ add(feedback, vector, r0); | 4769 __ add(feedback, vector, r0); |
4773 __ LoadP(feedback, | 4770 __ LoadP(feedback, |
4774 FieldMemOperand(feedback, FixedArray::kHeaderSize + kPointerSize)); | 4771 FieldMemOperand(feedback, FixedArray::kHeaderSize + kPointerSize)); |
4775 HandleArrayCases(masm, receiver, key, vector, slot, feedback, receiver_map, | 4772 HandleArrayCases(masm, feedback, receiver_map, scratch1, r10, false, &miss); |
4776 scratch1, r10, false, &miss); | |
4777 | 4773 |
4778 __ bind(&miss); | 4774 __ bind(&miss); |
4779 KeyedLoadIC::GenerateMiss(masm); | 4775 KeyedLoadIC::GenerateMiss(masm); |
4780 | 4776 |
4781 __ bind(&load_smi_map); | 4777 __ bind(&load_smi_map); |
4782 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 4778 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
4783 __ b(&compare_map); | 4779 __ b(&compare_map); |
4784 } | 4780 } |
4785 | 4781 |
4786 | 4782 |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5752 kStackUnwindSpace, NULL, | 5748 kStackUnwindSpace, NULL, |
5753 MemOperand(fp, 6 * kPointerSize), NULL); | 5749 MemOperand(fp, 6 * kPointerSize), NULL); |
5754 } | 5750 } |
5755 | 5751 |
5756 | 5752 |
5757 #undef __ | 5753 #undef __ |
5758 } // namespace internal | 5754 } // namespace internal |
5759 } // namespace v8 | 5755 } // namespace v8 |
5760 | 5756 |
5761 #endif // V8_TARGET_ARCH_PPC | 5757 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |