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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 4549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4560 | 4560 |
4561 | 4561 |
4562 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } | 4562 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); } |
4563 | 4563 |
4564 | 4564 |
4565 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) { | 4565 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) { |
4566 GenerateImpl(masm, true); | 4566 GenerateImpl(masm, true); |
4567 } | 4567 } |
4568 | 4568 |
4569 | 4569 |
4570 static void HandleArrayCases(MacroAssembler* masm, Register receiver, | 4570 static void HandleArrayCases(MacroAssembler* masm, Register feedback, |
4571 Register key, Register vector, Register slot, | 4571 Register receiver_map, Register scratch1, |
4572 Register feedback, Register receiver_map, | 4572 Register scratch2, bool is_polymorphic, |
4573 Register scratch1, Register scratch2, | 4573 Label* miss) { |
4574 bool is_polymorphic, Label* miss) { | |
4575 // feedback initially contains the feedback array | 4574 // feedback initially contains the feedback array |
4576 Label next_loop, prepare_next; | 4575 Label next_loop, prepare_next; |
4577 Label start_polymorphic; | 4576 Label start_polymorphic; |
4578 | 4577 |
4579 Register cached_map = scratch1; | 4578 Register cached_map = scratch1; |
4580 | 4579 |
4581 __ lw(cached_map, | 4580 __ lw(cached_map, |
4582 FieldMemOperand(feedback, FixedArray::OffsetOfElementAt(0))); | 4581 FieldMemOperand(feedback, FixedArray::OffsetOfElementAt(0))); |
4583 __ lw(cached_map, FieldMemOperand(cached_map, WeakCell::kValueOffset)); | 4582 __ lw(cached_map, FieldMemOperand(cached_map, WeakCell::kValueOffset)); |
4584 __ Branch(&start_polymorphic, ne, receiver_map, Operand(cached_map)); | 4583 __ Branch(&start_polymorphic, ne, receiver_map, Operand(cached_map)); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4676 Label try_array, load_smi_map, compare_map; | 4675 Label try_array, load_smi_map, compare_map; |
4677 Label not_array, miss; | 4676 Label not_array, miss; |
4678 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, | 4677 HandleMonomorphicCase(masm, receiver, receiver_map, feedback, vector, slot, |
4679 scratch1, &compare_map, &load_smi_map, &try_array); | 4678 scratch1, &compare_map, &load_smi_map, &try_array); |
4680 | 4679 |
4681 // Is it a fixed array? | 4680 // Is it a fixed array? |
4682 __ bind(&try_array); | 4681 __ bind(&try_array); |
4683 __ lw(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4682 __ lw(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
4684 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); | 4683 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); |
4685 __ Branch(¬_array, ne, at, Operand(scratch1)); | 4684 __ Branch(¬_array, ne, at, Operand(scratch1)); |
4686 HandleArrayCases(masm, receiver, name, vector, slot, feedback, receiver_map, | 4685 HandleArrayCases(masm, feedback, receiver_map, scratch1, t5, true, &miss); |
4687 scratch1, t5, true, &miss); | |
4688 | 4686 |
4689 __ bind(¬_array); | 4687 __ bind(¬_array); |
4690 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 4688 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
4691 __ Branch(&miss, ne, at, Operand(feedback)); | 4689 __ Branch(&miss, ne, at, Operand(feedback)); |
4692 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( | 4690 Code::Flags code_flags = Code::RemoveTypeAndHolderFromFlags( |
4693 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 4691 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
4694 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, | 4692 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, code_flags, |
4695 receiver, name, feedback, | 4693 receiver, name, feedback, |
4696 receiver_map, scratch1, t5); | 4694 receiver_map, scratch1, t5); |
4697 | 4695 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4738 __ bind(&try_array); | 4736 __ bind(&try_array); |
4739 // Is it a fixed array? | 4737 // Is it a fixed array? |
4740 __ lw(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); | 4738 __ lw(scratch1, FieldMemOperand(feedback, HeapObject::kMapOffset)); |
4741 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); | 4739 __ LoadRoot(at, Heap::kFixedArrayMapRootIndex); |
4742 __ Branch(¬_array, ne, at, Operand(scratch1)); | 4740 __ Branch(¬_array, ne, at, Operand(scratch1)); |
4743 // We have a polymorphic element handler. | 4741 // We have a polymorphic element handler. |
4744 __ JumpIfNotSmi(key, &miss); | 4742 __ JumpIfNotSmi(key, &miss); |
4745 | 4743 |
4746 Label polymorphic, try_poly_name; | 4744 Label polymorphic, try_poly_name; |
4747 __ bind(&polymorphic); | 4745 __ bind(&polymorphic); |
4748 HandleArrayCases(masm, receiver, key, vector, slot, feedback, receiver_map, | 4746 HandleArrayCases(masm, feedback, receiver_map, scratch1, t5, true, &miss); |
4749 scratch1, t5, true, &miss); | |
4750 | 4747 |
4751 __ bind(¬_array); | 4748 __ bind(¬_array); |
4752 // Is it generic? | 4749 // Is it generic? |
4753 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); | 4750 __ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex); |
4754 __ Branch(&try_poly_name, ne, at, Operand(feedback)); | 4751 __ Branch(&try_poly_name, ne, at, Operand(feedback)); |
4755 Handle<Code> megamorphic_stub = | 4752 Handle<Code> megamorphic_stub = |
4756 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState()); | 4753 KeyedLoadIC::ChooseMegamorphicStub(masm->isolate(), GetExtraICState()); |
4757 __ Jump(megamorphic_stub, RelocInfo::CODE_TARGET); | 4754 __ Jump(megamorphic_stub, RelocInfo::CODE_TARGET); |
4758 | 4755 |
4759 __ bind(&try_poly_name); | 4756 __ bind(&try_poly_name); |
4760 // We might have a name in feedback, and a fixed array in the next slot. | 4757 // We might have a name in feedback, and a fixed array in the next slot. |
4761 __ Branch(&miss, ne, key, Operand(feedback)); | 4758 __ Branch(&miss, ne, key, Operand(feedback)); |
4762 // If the name comparison succeeded, we know we have a fixed array with | 4759 // If the name comparison succeeded, we know we have a fixed array with |
4763 // at least one map/handler pair. | 4760 // at least one map/handler pair. |
4764 __ sll(at, slot, kPointerSizeLog2 - kSmiTagSize); | 4761 __ sll(at, slot, kPointerSizeLog2 - kSmiTagSize); |
4765 __ Addu(feedback, vector, Operand(at)); | 4762 __ Addu(feedback, vector, Operand(at)); |
4766 __ lw(feedback, | 4763 __ lw(feedback, |
4767 FieldMemOperand(feedback, FixedArray::kHeaderSize + kPointerSize)); | 4764 FieldMemOperand(feedback, FixedArray::kHeaderSize + kPointerSize)); |
4768 HandleArrayCases(masm, receiver, key, vector, slot, feedback, receiver_map, | 4765 HandleArrayCases(masm, feedback, receiver_map, scratch1, t5, false, &miss); |
4769 scratch1, t5, false, &miss); | |
4770 | 4766 |
4771 __ bind(&miss); | 4767 __ bind(&miss); |
4772 KeyedLoadIC::GenerateMiss(masm); | 4768 KeyedLoadIC::GenerateMiss(masm); |
4773 | 4769 |
4774 __ bind(&load_smi_map); | 4770 __ bind(&load_smi_map); |
4775 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); | 4771 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); |
4776 __ jmp(&compare_map); | 4772 __ jmp(&compare_map); |
4777 } | 4773 } |
4778 | 4774 |
4779 | 4775 |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5660 MemOperand(fp, 6 * kPointerSize), NULL); | 5656 MemOperand(fp, 6 * kPointerSize), NULL); |
5661 } | 5657 } |
5662 | 5658 |
5663 | 5659 |
5664 #undef __ | 5660 #undef __ |
5665 | 5661 |
5666 } // namespace internal | 5662 } // namespace internal |
5667 } // namespace v8 | 5663 } // namespace v8 |
5668 | 5664 |
5669 #endif // V8_TARGET_ARCH_MIPS | 5665 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |