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 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include <cstring> | 8 #include <cstring> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 2768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2779 Unique<HeapObject> object_; | 2779 Unique<HeapObject> object_; |
2780 bool object_in_new_space_; | 2780 bool object_in_new_space_; |
2781 }; | 2781 }; |
2782 | 2782 |
2783 | 2783 |
2784 class HCheckInstanceType final : public HUnaryOperation { | 2784 class HCheckInstanceType final : public HUnaryOperation { |
2785 public: | 2785 public: |
2786 enum Check { | 2786 enum Check { |
2787 IS_JS_RECEIVER, | 2787 IS_JS_RECEIVER, |
2788 IS_JS_ARRAY, | 2788 IS_JS_ARRAY, |
| 2789 IS_JS_FUNCTION, |
2789 IS_JS_DATE, | 2790 IS_JS_DATE, |
2790 IS_STRING, | 2791 IS_STRING, |
2791 IS_INTERNALIZED_STRING, | 2792 IS_INTERNALIZED_STRING, |
2792 LAST_INTERVAL_CHECK = IS_JS_DATE | 2793 LAST_INTERVAL_CHECK = IS_JS_DATE |
2793 }; | 2794 }; |
2794 | 2795 |
2795 DECLARE_INSTRUCTION_FACTORY_P2(HCheckInstanceType, HValue*, Check); | 2796 DECLARE_INSTRUCTION_FACTORY_P2(HCheckInstanceType, HValue*, Check); |
2796 | 2797 |
2797 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 2798 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
2798 | 2799 |
2799 Representation RequiredInputRepresentation(int index) override { | 2800 Representation RequiredInputRepresentation(int index) override { |
2800 return Representation::Tagged(); | 2801 return Representation::Tagged(); |
2801 } | 2802 } |
2802 | 2803 |
2803 HType CalculateInferredType() override { | 2804 HType CalculateInferredType() override { |
2804 switch (check_) { | 2805 switch (check_) { |
2805 case IS_JS_RECEIVER: return HType::JSReceiver(); | 2806 case IS_JS_RECEIVER: return HType::JSReceiver(); |
2806 case IS_JS_ARRAY: return HType::JSArray(); | 2807 case IS_JS_ARRAY: return HType::JSArray(); |
| 2808 case IS_JS_FUNCTION: |
| 2809 return HType::JSObject(); |
2807 case IS_JS_DATE: return HType::JSObject(); | 2810 case IS_JS_DATE: return HType::JSObject(); |
2808 case IS_STRING: return HType::String(); | 2811 case IS_STRING: return HType::String(); |
2809 case IS_INTERNALIZED_STRING: return HType::String(); | 2812 case IS_INTERNALIZED_STRING: return HType::String(); |
2810 } | 2813 } |
2811 UNREACHABLE(); | 2814 UNREACHABLE(); |
2812 return HType::Tagged(); | 2815 return HType::Tagged(); |
2813 } | 2816 } |
2814 | 2817 |
2815 HValue* Canonicalize() override; | 2818 HValue* Canonicalize() override; |
2816 | 2819 |
(...skipping 2741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5558 static HObjectAccess ForCounter() { | 5561 static HObjectAccess ForCounter() { |
5559 return HObjectAccess(kExternalMemory, 0, Representation::Integer32(), | 5562 return HObjectAccess(kExternalMemory, 0, Representation::Integer32(), |
5560 Handle<Name>::null(), false, false); | 5563 Handle<Name>::null(), false, false); |
5561 } | 5564 } |
5562 | 5565 |
5563 static HObjectAccess ForExternalUInteger8() { | 5566 static HObjectAccess ForExternalUInteger8() { |
5564 return HObjectAccess(kExternalMemory, 0, Representation::UInteger8(), | 5567 return HObjectAccess(kExternalMemory, 0, Representation::UInteger8(), |
5565 Handle<Name>::null(), false, false); | 5568 Handle<Name>::null(), false, false); |
5566 } | 5569 } |
5567 | 5570 |
| 5571 static HObjectAccess ForBoundTargetFunction() { |
| 5572 return HObjectAccess(kInobject, |
| 5573 JSBoundFunction::kBoundTargetFunctionOffset); |
| 5574 } |
| 5575 |
| 5576 static HObjectAccess ForBoundThis() { |
| 5577 return HObjectAccess(kInobject, JSBoundFunction::kBoundThisOffset); |
| 5578 } |
| 5579 |
| 5580 static HObjectAccess ForBoundArguments() { |
| 5581 return HObjectAccess(kInobject, JSBoundFunction::kBoundArgumentsOffset); |
| 5582 } |
| 5583 |
5568 // Create an access to an offset in a fixed array header. | 5584 // Create an access to an offset in a fixed array header. |
5569 static HObjectAccess ForFixedArrayHeader(int offset); | 5585 static HObjectAccess ForFixedArrayHeader(int offset); |
5570 | 5586 |
5571 // Create an access to an in-object property in a JSObject. | 5587 // Create an access to an in-object property in a JSObject. |
5572 // This kind of access must be used when the object |map| is known and | 5588 // This kind of access must be used when the object |map| is known and |
5573 // in-object properties are being accessed. Accesses of the in-object | 5589 // in-object properties are being accessed. Accesses of the in-object |
5574 // properties can have different semantics depending on whether corresponding | 5590 // properties can have different semantics depending on whether corresponding |
5575 // property was added to the map or not. | 5591 // property was added to the map or not. |
5576 static HObjectAccess ForMapAndOffset(Handle<Map> map, int offset, | 5592 static HObjectAccess ForMapAndOffset(Handle<Map> map, int offset, |
5577 Representation representation = Representation::Tagged()); | 5593 Representation representation = Representation::Tagged()); |
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7160 bool IsDeletable() const override { return true; } | 7176 bool IsDeletable() const override { return true; } |
7161 }; | 7177 }; |
7162 | 7178 |
7163 #undef DECLARE_INSTRUCTION | 7179 #undef DECLARE_INSTRUCTION |
7164 #undef DECLARE_CONCRETE_INSTRUCTION | 7180 #undef DECLARE_CONCRETE_INSTRUCTION |
7165 | 7181 |
7166 } // namespace internal | 7182 } // namespace internal |
7167 } // namespace v8 | 7183 } // namespace v8 |
7168 | 7184 |
7169 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 7185 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |