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 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2876 bool object_in_new_space_; | 2876 bool object_in_new_space_; |
2877 }; | 2877 }; |
2878 | 2878 |
2879 | 2879 |
2880 class HCheckInstanceType final : public HUnaryOperation { | 2880 class HCheckInstanceType final : public HUnaryOperation { |
2881 public: | 2881 public: |
2882 enum Check { | 2882 enum Check { |
2883 IS_SPEC_OBJECT, | 2883 IS_SPEC_OBJECT, |
2884 IS_JS_ARRAY, | 2884 IS_JS_ARRAY, |
2885 IS_JS_DATE, | 2885 IS_JS_DATE, |
2886 IS_JS_REGEXP, | |
Benedikt Meurer
2015/11/04 14:02:40
Undo these changes.
| |
2886 IS_STRING, | 2887 IS_STRING, |
2887 IS_INTERNALIZED_STRING, | 2888 IS_INTERNALIZED_STRING, |
2888 LAST_INTERVAL_CHECK = IS_JS_DATE | 2889 LAST_INTERVAL_CHECK = IS_JS_REGEXP |
2889 }; | 2890 }; |
2890 | 2891 |
2891 DECLARE_INSTRUCTION_FACTORY_P2(HCheckInstanceType, HValue*, Check); | 2892 DECLARE_INSTRUCTION_FACTORY_P2(HCheckInstanceType, HValue*, Check); |
2892 | 2893 |
2893 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 2894 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
2894 | 2895 |
2895 Representation RequiredInputRepresentation(int index) override { | 2896 Representation RequiredInputRepresentation(int index) override { |
2896 return Representation::Tagged(); | 2897 return Representation::Tagged(); |
2897 } | 2898 } |
2898 | 2899 |
2899 HType CalculateInferredType() override { | 2900 HType CalculateInferredType() override { |
2900 switch (check_) { | 2901 switch (check_) { |
2901 case IS_SPEC_OBJECT: return HType::JSObject(); | 2902 case IS_SPEC_OBJECT: return HType::JSObject(); |
2902 case IS_JS_ARRAY: return HType::JSArray(); | 2903 case IS_JS_ARRAY: return HType::JSArray(); |
2903 case IS_JS_DATE: | 2904 case IS_JS_DATE: return HType::JSObject(); |
2904 return HType::JSObject(); | 2905 case IS_JS_REGEXP: return HType::JSObject(); |
2905 case IS_STRING: return HType::String(); | 2906 case IS_STRING: return HType::String(); |
2906 case IS_INTERNALIZED_STRING: return HType::String(); | 2907 case IS_INTERNALIZED_STRING: return HType::String(); |
2907 } | 2908 } |
2908 UNREACHABLE(); | 2909 UNREACHABLE(); |
2909 return HType::Tagged(); | 2910 return HType::Tagged(); |
2910 } | 2911 } |
2911 | 2912 |
2912 HValue* Canonicalize() override; | 2913 HValue* Canonicalize() override; |
2913 | 2914 |
2914 bool is_interval_check() const { return check_ <= LAST_INTERVAL_CHECK; } | 2915 bool is_interval_check() const { return check_ <= LAST_INTERVAL_CHECK; } |
(...skipping 3273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6188 | 6189 |
6189 static HObjectAccess ForJSArrayBufferViewByteLength() { | 6190 static HObjectAccess ForJSArrayBufferViewByteLength() { |
6190 return HObjectAccess::ForObservableJSObjectOffset( | 6191 return HObjectAccess::ForObservableJSObjectOffset( |
6191 JSArrayBufferView::kByteLengthOffset); | 6192 JSArrayBufferView::kByteLengthOffset); |
6192 } | 6193 } |
6193 | 6194 |
6194 static HObjectAccess ForJSGlobalObjectNativeContext() { | 6195 static HObjectAccess ForJSGlobalObjectNativeContext() { |
6195 return HObjectAccess(kInobject, JSGlobalObject::kNativeContextOffset); | 6196 return HObjectAccess(kInobject, JSGlobalObject::kNativeContextOffset); |
6196 } | 6197 } |
6197 | 6198 |
6199 static HObjectAccess ForJSRegExpFlags() { | |
6200 return HObjectAccess(kInobject, JSRegExp::kFlagsOffset); | |
6201 } | |
6202 | |
6198 static HObjectAccess ForJSCollectionTable() { | 6203 static HObjectAccess ForJSCollectionTable() { |
6199 return HObjectAccess::ForObservableJSObjectOffset( | 6204 return HObjectAccess::ForObservableJSObjectOffset( |
6200 JSCollection::kTableOffset); | 6205 JSCollection::kTableOffset); |
6201 } | 6206 } |
6202 | 6207 |
6203 template <typename CollectionType> | 6208 template <typename CollectionType> |
6204 static HObjectAccess ForOrderedHashTableNumberOfBuckets() { | 6209 static HObjectAccess ForOrderedHashTableNumberOfBuckets() { |
6205 return HObjectAccess(kInobject, CollectionType::kNumberOfBucketsOffset, | 6210 return HObjectAccess(kInobject, CollectionType::kNumberOfBucketsOffset, |
6206 Representation::Smi()); | 6211 Representation::Smi()); |
6207 } | 6212 } |
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7908 | 7913 |
7909 | 7914 |
7910 | 7915 |
7911 #undef DECLARE_INSTRUCTION | 7916 #undef DECLARE_INSTRUCTION |
7912 #undef DECLARE_CONCRETE_INSTRUCTION | 7917 #undef DECLARE_CONCRETE_INSTRUCTION |
7913 | 7918 |
7914 } // namespace internal | 7919 } // namespace internal |
7915 } // namespace v8 | 7920 } // namespace v8 |
7916 | 7921 |
7917 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 7922 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |