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 5552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5563 } | 5563 } |
5564 | 5564 |
5565 Bind(&if_hole); | 5565 Bind(&if_hole); |
5566 { | 5566 { |
5567 Comment("convert hole"); | 5567 Comment("convert hole"); |
5568 GotoUnless(IsSetWord<LoadHandler::ConvertHoleBits>(handler_word), miss); | 5568 GotoUnless(IsSetWord<LoadHandler::ConvertHoleBits>(handler_word), miss); |
5569 Node* protector_cell = LoadRoot(Heap::kArrayProtectorRootIndex); | 5569 Node* protector_cell = LoadRoot(Heap::kArrayProtectorRootIndex); |
5570 DCHECK(isolate()->heap()->array_protector()->IsPropertyCell()); | 5570 DCHECK(isolate()->heap()->array_protector()->IsPropertyCell()); |
5571 GotoUnless( | 5571 GotoUnless( |
5572 WordEqual(LoadObjectField(protector_cell, PropertyCell::kValueOffset), | 5572 WordEqual(LoadObjectField(protector_cell, PropertyCell::kValueOffset), |
5573 SmiConstant(Smi::FromInt(Isolate::kArrayProtectorValid))), | 5573 SmiConstant(Smi::FromInt(Isolate::kProtectorValid))), |
5574 miss); | 5574 miss); |
5575 Return(UndefinedConstant()); | 5575 Return(UndefinedConstant()); |
5576 } | 5576 } |
5577 | 5577 |
5578 Bind(&property); | 5578 Bind(&property); |
5579 Comment("property_load"); | 5579 Comment("property_load"); |
5580 } | 5580 } |
5581 | 5581 |
5582 Label constant(this), field(this); | 5582 Label constant(this), field(this); |
5583 Branch(WordEqual(handler_kind, IntPtrConstant(LoadHandler::kForFields)), | 5583 Branch(WordEqual(handler_kind, IntPtrConstant(LoadHandler::kForFields)), |
(...skipping 3173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8757 compiler::Node* CodeStubAssembler::InstanceOf(compiler::Node* object, | 8757 compiler::Node* CodeStubAssembler::InstanceOf(compiler::Node* object, |
8758 compiler::Node* callable, | 8758 compiler::Node* callable, |
8759 compiler::Node* context) { | 8759 compiler::Node* context) { |
8760 Label return_runtime(this, Label::kDeferred), end(this); | 8760 Label return_runtime(this, Label::kDeferred), end(this); |
8761 Variable result(this, MachineRepresentation::kTagged); | 8761 Variable result(this, MachineRepresentation::kTagged); |
8762 | 8762 |
8763 // Check if no one installed @@hasInstance somewhere. | 8763 // Check if no one installed @@hasInstance somewhere. |
8764 GotoUnless( | 8764 GotoUnless( |
8765 WordEqual(LoadObjectField(LoadRoot(Heap::kHasInstanceProtectorRootIndex), | 8765 WordEqual(LoadObjectField(LoadRoot(Heap::kHasInstanceProtectorRootIndex), |
8766 PropertyCell::kValueOffset), | 8766 PropertyCell::kValueOffset), |
8767 SmiConstant(Smi::FromInt(Isolate::kArrayProtectorValid))), | 8767 SmiConstant(Smi::FromInt(Isolate::kProtectorValid))), |
8768 &return_runtime); | 8768 &return_runtime); |
8769 | 8769 |
8770 // Check if {callable} is a valid receiver. | 8770 // Check if {callable} is a valid receiver. |
8771 GotoIf(TaggedIsSmi(callable), &return_runtime); | 8771 GotoIf(TaggedIsSmi(callable), &return_runtime); |
8772 GotoUnless(IsCallableMap(LoadMap(callable)), &return_runtime); | 8772 GotoUnless(IsCallableMap(LoadMap(callable)), &return_runtime); |
8773 | 8773 |
8774 // Use the inline OrdinaryHasInstance directly. | 8774 // Use the inline OrdinaryHasInstance directly. |
8775 result.Bind(OrdinaryHasInstance(context, callable, object)); | 8775 result.Bind(OrdinaryHasInstance(context, callable, object)); |
8776 Goto(&end); | 8776 Goto(&end); |
8777 | 8777 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8942 // Fast holey JSArrays can treat the hole as undefined if the | 8942 // Fast holey JSArrays can treat the hole as undefined if the |
8943 // protector cell is valid, and the prototype chain is unchanged from | 8943 // protector cell is valid, and the prototype chain is unchanged from |
8944 // its initial state (because the protector cell is only tracked for | 8944 // its initial state (because the protector cell is only tracked for |
8945 // initial the Array and Object prototypes). Check these conditions | 8945 // initial the Array and Object prototypes). Check these conditions |
8946 // here, and take the slow path if any fail. | 8946 // here, and take the slow path if any fail. |
8947 Node* protector_cell = LoadRoot(Heap::kArrayProtectorRootIndex); | 8947 Node* protector_cell = LoadRoot(Heap::kArrayProtectorRootIndex); |
8948 DCHECK(isolate()->heap()->array_protector()->IsPropertyCell()); | 8948 DCHECK(isolate()->heap()->array_protector()->IsPropertyCell()); |
8949 GotoUnless( | 8949 GotoUnless( |
8950 WordEqual( | 8950 WordEqual( |
8951 LoadObjectField(protector_cell, PropertyCell::kValueOffset), | 8951 LoadObjectField(protector_cell, PropertyCell::kValueOffset), |
8952 SmiConstant(Smi::FromInt(Isolate::kArrayProtectorValid))), | 8952 SmiConstant(Smi::FromInt(Isolate::kProtectorValid))), |
8953 &if_isslow); | 8953 &if_isslow); |
8954 | 8954 |
8955 Node* native_context = LoadNativeContext(context); | 8955 Node* native_context = LoadNativeContext(context); |
8956 | 8956 |
8957 Node* prototype = LoadMapPrototype(array_map); | 8957 Node* prototype = LoadMapPrototype(array_map); |
8958 Node* array_prototype = LoadContextElement( | 8958 Node* array_prototype = LoadContextElement( |
8959 native_context, Context::INITIAL_ARRAY_PROTOTYPE_INDEX); | 8959 native_context, Context::INITIAL_ARRAY_PROTOTYPE_INDEX); |
8960 GotoUnless(WordEqual(prototype, array_prototype), &if_isslow); | 8960 GotoUnless(WordEqual(prototype, array_prototype), &if_isslow); |
8961 | 8961 |
8962 Node* map = LoadMap(prototype); | 8962 Node* map = LoadMap(prototype); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9139 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == (FAST_ELEMENTS | 1)); | 9139 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == (FAST_ELEMENTS | 1)); |
9140 STATIC_ASSERT(FAST_HOLEY_DOUBLE_ELEMENTS == (FAST_DOUBLE_ELEMENTS | 1)); | 9140 STATIC_ASSERT(FAST_HOLEY_DOUBLE_ELEMENTS == (FAST_DOUBLE_ELEMENTS | 1)); |
9141 | 9141 |
9142 // Check prototype chain if receiver does not have packed elements. | 9142 // Check prototype chain if receiver does not have packed elements. |
9143 Node* holey_elements = Word32And(elements_kind, Int32Constant(1)); | 9143 Node* holey_elements = Word32And(elements_kind, Int32Constant(1)); |
9144 return Word32Equal(holey_elements, Int32Constant(1)); | 9144 return Word32Equal(holey_elements, Int32Constant(1)); |
9145 } | 9145 } |
9146 | 9146 |
9147 } // namespace internal | 9147 } // namespace internal |
9148 } // namespace v8 | 9148 } // namespace v8 |
OLD | NEW |