| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/code-stub-assembler.h" | 4 #include "src/code-stub-assembler.h" |
| 5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/frames-inl.h" | 6 #include "src/frames-inl.h" |
| 7 #include "src/frames.h" | 7 #include "src/frames.h" |
| 8 #include "src/ic/handler-configuration.h" | 8 #include "src/ic/handler-configuration.h" |
| 9 #include "src/ic/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
| 10 | 10 |
| (...skipping 5702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5713 // both the receiver map check and the validity cell check. | 5713 // both the receiver map check and the validity cell check. |
| 5714 CSA_ASSERT(this, WordNotEqual(holder, IntPtrConstant(0))); | 5714 CSA_ASSERT(this, WordNotEqual(holder, IntPtrConstant(0))); |
| 5715 | 5715 |
| 5716 var_holder->Bind(holder); | 5716 var_holder->Bind(holder); |
| 5717 var_smi_handler->Bind(smi_handler); | 5717 var_smi_handler->Bind(smi_handler); |
| 5718 Goto(if_smi_handler); | 5718 Goto(if_smi_handler); |
| 5719 } | 5719 } |
| 5720 | 5720 |
| 5721 Bind(&array_handler); | 5721 Bind(&array_handler); |
| 5722 { | 5722 { |
| 5723 Node* handler_length = SmiUntag(maybe_holder_cell); | 5723 typedef LoadICProtoArrayDescriptor Descriptor; |
| 5724 Node* holder = EmitLoadICProtoArrayCheck(p, handler, handler_length, | 5724 LoadICProtoArrayStub stub(isolate()); |
| 5725 handler_flags, miss); | 5725 Node* target = HeapConstant(stub.GetCode()); |
| 5726 var_holder->Bind(holder); | 5726 TailCallStub(Descriptor(isolate()), target, p->context, |
| 5727 var_smi_handler->Bind(smi_handler); | 5727 Arg(Descriptor::kReceiver, p->receiver), |
| 5728 Goto(if_smi_handler); | 5728 Arg(Descriptor::kName, p->name), |
| 5729 Arg(Descriptor::kSlot, p->slot), |
| 5730 Arg(Descriptor::kVector, p->vector), |
| 5731 Arg(Descriptor::kHandler, handler)); |
| 5729 } | 5732 } |
| 5730 } | 5733 } |
| 5731 | 5734 |
| 5735 void CodeStubAssembler::LoadICProtoArray(const LoadICParameters* p, |
| 5736 Node* handler) { |
| 5737 Label miss(this); |
| 5738 CSA_ASSERT(this, Word32BinaryNot(TaggedIsSmi(handler))); |
| 5739 CSA_ASSERT(this, IsFixedArrayMap(LoadMap(handler))); |
| 5740 |
| 5741 Node* smi_handler = LoadObjectField(handler, LoadHandler::kSmiHandlerOffset); |
| 5742 Node* handler_flags = SmiUntag(smi_handler); |
| 5743 |
| 5744 Node* handler_length = LoadAndUntagFixedArrayBaseLength(handler); |
| 5745 |
| 5746 Node* holder = EmitLoadICProtoArrayCheck(p, handler, handler_length, |
| 5747 handler_flags, &miss); |
| 5748 |
| 5749 HandleLoadICSmiHandlerCase(p, holder, smi_handler, &miss, kOnlyProperties); |
| 5750 |
| 5751 Bind(&miss); |
| 5752 { |
| 5753 TailCallRuntime(Runtime::kLoadIC_Miss, p->context, p->receiver, p->name, |
| 5754 p->slot, p->vector); |
| 5755 } |
| 5756 } |
| 5757 |
| 5732 Node* CodeStubAssembler::EmitLoadICProtoArrayCheck(const LoadICParameters* p, | 5758 Node* CodeStubAssembler::EmitLoadICProtoArrayCheck(const LoadICParameters* p, |
| 5733 Node* handler, | 5759 Node* handler, |
| 5734 Node* handler_length, | 5760 Node* handler_length, |
| 5735 Node* handler_flags, | 5761 Node* handler_flags, |
| 5736 Label* miss) { | 5762 Label* miss) { |
| 5737 Variable start_index(this, MachineType::PointerRepresentation()); | 5763 Variable start_index(this, MachineType::PointerRepresentation()); |
| 5738 start_index.Bind(IntPtrConstant(LoadHandler::kFirstPrototypeIndex)); | 5764 start_index.Bind(IntPtrConstant(LoadHandler::kFirstPrototypeIndex)); |
| 5739 | 5765 |
| 5740 Label can_access(this); | 5766 Label can_access(this); |
| 5741 GotoUnless(IsSetWord<LoadHandler::DoAccessCheckOnReceiverBits>(handler_flags), | 5767 GotoUnless(IsSetWord<LoadHandler::DoAccessCheckOnReceiverBits>(handler_flags), |
| (...skipping 3314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9056 } | 9082 } |
| 9057 | 9083 |
| 9058 void CodeStubArguments::PopAndReturn(compiler::Node* value) { | 9084 void CodeStubArguments::PopAndReturn(compiler::Node* value) { |
| 9059 assembler_->PopAndReturn( | 9085 assembler_->PopAndReturn( |
| 9060 assembler_->IntPtrAddFoldConstants(argc_, assembler_->IntPtrConstant(1)), | 9086 assembler_->IntPtrAddFoldConstants(argc_, assembler_->IntPtrConstant(1)), |
| 9061 value); | 9087 value); |
| 9062 } | 9088 } |
| 9063 | 9089 |
| 9064 } // namespace internal | 9090 } // namespace internal |
| 9065 } // namespace v8 | 9091 } // namespace v8 |
| OLD | NEW |