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_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 6184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6195 JSArrayBufferView::kByteLengthOffset); | 6195 JSArrayBufferView::kByteLengthOffset); |
6196 } | 6196 } |
6197 | 6197 |
6198 static HObjectAccess ForGlobalObjectNativeContext() { | 6198 static HObjectAccess ForGlobalObjectNativeContext() { |
6199 return HObjectAccess(kInobject, GlobalObject::kNativeContextOffset); | 6199 return HObjectAccess(kInobject, GlobalObject::kNativeContextOffset); |
6200 } | 6200 } |
6201 | 6201 |
6202 void PrintTo(StringStream* stream) const; | 6202 void PrintTo(StringStream* stream) const; |
6203 | 6203 |
6204 inline bool Equals(HObjectAccess that) const { | 6204 inline bool Equals(HObjectAccess that) const { |
6205 return value_ == that.value_; | 6205 return value_ == that.value_; // portion and offset must match |
6206 } | |
6207 | |
6208 // Returns true if |this| access refers to the same field as |that|, which | |
6209 // means that both have same |offset| and |portion| values. | |
6210 inline bool SameField(HObjectAccess that) const { | |
6211 uint32_t mask = PortionField::kMask | OffsetField::kMask; | |
6212 return (value_ & mask) == (that.value_ & mask); | |
6213 } | 6206 } |
6214 | 6207 |
6215 protected: | 6208 protected: |
6216 void SetGVNFlags(HValue *instr, PropertyAccessType access_type); | 6209 void SetGVNFlags(HValue *instr, PropertyAccessType access_type); |
6217 | 6210 |
6218 private: | 6211 private: |
6219 // internal use only; different parts of an object or array | 6212 // internal use only; different parts of an object or array |
6220 enum Portion { | 6213 enum Portion { |
6221 kMaps, // map of an object | 6214 kMaps, // map of an object |
6222 kArrayLengths, // the length of an array | 6215 kArrayLengths, // the length of an array |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7809 }; | 7802 }; |
7810 | 7803 |
7811 | 7804 |
7812 | 7805 |
7813 #undef DECLARE_INSTRUCTION | 7806 #undef DECLARE_INSTRUCTION |
7814 #undef DECLARE_CONCRETE_INSTRUCTION | 7807 #undef DECLARE_CONCRETE_INSTRUCTION |
7815 | 7808 |
7816 } } // namespace v8::internal | 7809 } } // namespace v8::internal |
7817 | 7810 |
7818 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7811 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |