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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 4582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4593 | 4593 |
4594 | 4594 |
4595 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } | 4595 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } |
4596 | 4596 |
4597 | 4597 |
4598 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) { | 4598 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) { |
4599 GenerateImpl(masm, true); | 4599 GenerateImpl(masm, true); |
4600 } | 4600 } |
4601 | 4601 |
4602 | 4602 |
4603 static void HandleArrayCases(MacroAssembler* masm, Register receiver, | 4603 static void HandleArrayCases(MacroAssembler* masm, Register feedback, |
4604 Register key, Register vector, Register slot, | 4604 Register receiver_map, Register scratch1, |
4605 Register feedback, Register receiver_map, | 4605 Register scratch2, bool is_polymorphic, |
4606 Register scratch1, Register scratch2, | 4606 Label* miss) { |
4607 bool is_polymorphic, Label* miss) { | |
4608 // feedback initially contains the feedback array | 4607 // feedback initially contains the feedback array |
4609 Label next_loop, prepare_next; | 4608 Label next_loop, prepare_next; |
4610 Label start_polymorphic; | 4609 Label start_polymorphic; |
4611 | 4610 |
4612 Register cached_map = scratch1; | 4611 Register cached_map = scratch1; |
4613 | 4612 |
4614 __ ld(cached_map, | 4613 __ ld(cached_map, |
4615 FieldMemOperand(feedback, FixedArray::OffsetOfElementAt(0))); | 4614 FieldMemOperand(feedback, FixedArray::OffsetOfElementAt(0))); |
4616 __ ld(cached_map, FieldMemOperand(cached_map, WeakCell::kValueOffset)); | 4615 __ ld(cached_map, FieldMemOperand(cached_map, WeakCell::kValueOffset)); |
4617 __ Branch(&start_polymorphic, ne, receiver_map, Operand(cached_map)); | 4616 __ Branch(&start_polymorphic, ne, receiver_map, Operand(cached_map)); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4707 Label try_array, load_smi_map, compare_map; | 4706 Label try_array, load_smi_map, compare_map; |
4708 Label not_array, miss; | 4707 Label not_array, miss; |
4709 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, | 4708 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, |
4710 scratch1, &compare_map, &load_smi_map, &try_array); | 4709 scratch1, &compare_map, &load_smi_map, &try_array); |
4711 | 4710 |
4712 // Is it a fixed array? | 4711 // Is it a fixed array? |
4713 __ bind(&try_array); | 4712 __ bind(&try_array); |
4714 __ ld(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4713 __ ld(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
4715 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); | 4714 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); |
4716 __ Branch(¬_array, ne, scratch1, Operand(at)); | 4715 __ Branch(¬_array, ne, scratch1, Operand(at)); |
4717 HandleArrayCases(masm, receiver, name, vector, slot, feedback, receiver_map, | 4716 HandleArrayCases(masm, feedback, receiver_map, scratch1, a7, true, &miss); |
4718 scratch1, a7, true, &miss); | |
4719 | 4717 |
4720 __ bind(¬_array); | 4718 __ bind(¬_array); |
4721 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 4719 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
4722 __ Branch(&miss, ne, feedback, Operand(at)); | 4720 __ Branch(&miss, ne, feedback, Operand(at)); |
4723 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( | 4721 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( |
4724 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 4722 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
4725 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, | 4723 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, |
4726 receiver, name, feedback, | 4724 receiver, name, feedback, |
4727 receiver_map, scratch1, a7); | 4725 receiver_map, scratch1, a7); |
4728 | 4726 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4769 __ bind(&try_array); | 4767 __ bind(&try_array); |
4770 // Is it a fixed array? | 4768 // Is it a fixed array? |
4771 __ ld(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4769 __ ld(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
4772 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); | 4770 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); |
4773 __ Branch(¬_array, ne, scratch1, Operand(at)); | 4771 __ Branch(¬_array, ne, scratch1, Operand(at)); |
4774 // We have a polymorphic element handler. | 4772 // We have a polymorphic element handler. |
4775 __ JumpIfNotSmi(key, &miss); | 4773 __ JumpIfNotSmi(key, &miss); |
4776 | 4774 |
4777 Label polymorphic, try_poly_name; | 4775 Label polymorphic, try_poly_name; |
4778 __ bind(&polymorphic); | 4776 __ bind(&polymorphic); |
4779 HandleArrayCases(masm, receiver, key, vector, slot, feedback, receiver_map, | 4777 HandleArrayCases(masm, feedback, receiver_map, scratch1, a7, true, &miss); |
4780 scratch1, a7, true, &miss); | |
4781 | 4778 |
4782 __ bind(¬_array); | 4779 __ bind(¬_array); |
4783 // Is it generic? | 4780 // Is it generic? |
4784 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 4781 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
4785 __ Branch(&try_poly_name, ne, feedback, Operand(at)); | 4782 __ Branch(&try_poly_name, ne, feedback, Operand(at)); |
4786 Handle<Code> megamorphic_stub = | 4783 Handle<Code> megamorphic_stub = |
4787 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState()); | 4784 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState()); |
4788 __ Jump(megamorphic_stub, RelocInfo::CODE_TARGET); | 4785 __ Jump(megamorphic_stub, RelocInfo::CODE_TARGET); |
4789 | 4786 |
4790 __ bind(&try_poly_name); | 4787 __ bind(&try_poly_name); |
4791 // We might have a name in feedback, and a fixed array in the next slot. | 4788 // We might have a name in feedback, and a fixed array in the next slot. |
4792 __ Branch(&miss, ne, key, Operand(feedback)); | 4789 __ Branch(&miss, ne, key, Operand(feedback)); |
4793 // If the name comparison succeeded, we know we have a fixed array with | 4790 // If the name comparison succeeded, we know we have a fixed array with |
4794 // at least one map/handler pair. | 4791 // at least one map/handler pair. |
4795 __ SmiScale(feedback, slot, kPointerSizeLog2); | 4792 __ SmiScale(feedback, slot, kPointerSizeLog2); |
4796 __ Daddu(feedback, vector, Operand(feedback)); | 4793 __ Daddu(feedback, vector, Operand(feedback)); |
4797 __ ld(feedback, | 4794 __ ld(feedback, |
4798 FieldMemOperand(feedback, FixedArray::kHeaderSize + kPointerSize)); | 4795 FieldMemOperand(feedback, FixedArray::kHeaderSize + kPointerSize)); |
4799 HandleArrayCases(masm, receiver, key, vector, slot, feedback, receiver_map, | 4796 HandleArrayCases(masm, feedback, receiver_map, scratch1, a7, false, &miss); |
4800 scratch1, a7, false, &miss); | |
4801 | 4797 |
4802 __ bind(&miss); | 4798 __ bind(&miss); |
4803 KeyedLoadIC::GenerateMiss(masm); | 4799 KeyedLoadIC::GenerateMiss(masm); |
4804 | 4800 |
4805 __ bind(&load_smi_map); | 4801 __ bind(&load_smi_map); |
4806 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 4802 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
4807 __ Branch(&compare_map); | 4803 __ Branch(&compare_map); |
4808 } | 4804 } |
4809 | 4805 |
4810 | 4806 |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5692 MemOperand(fp, 6 * kPointerSize), NULL); | 5688 MemOperand(fp, 6 * kPointerSize), NULL); |
5693 } | 5689 } |
5694 | 5690 |
5695 | 5691 |
5696 #undef __ | 5692 #undef __ |
5697 | 5693 |
5698 } // namespace internal | 5694 } // namespace internal |
5699 } // namespace v8 | 5695 } // namespace v8 |
5700 | 5696 |
5701 #endif // V8_TARGET_ARCH_MIPS64 | 5697 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |