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_PROPERTY_DETAILS_H_ | 5 #ifndef V8_PROPERTY_DETAILS_H_ |
6 #define V8_PROPERTY_DETAILS_H_ | 6 #define V8_PROPERTY_DETAILS_H_ |
7 | 7 |
8 #include "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/utils.h" | 10 #include "src/utils.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 static Representation Integer16() { return Representation(kInteger16); } | 88 static Representation Integer16() { return Representation(kInteger16); } |
89 static Representation UInteger16() { return Representation(kUInteger16); } | 89 static Representation UInteger16() { return Representation(kUInteger16); } |
90 static Representation Smi() { return Representation(kSmi); } | 90 static Representation Smi() { return Representation(kSmi); } |
91 static Representation Integer32() { return Representation(kInteger32); } | 91 static Representation Integer32() { return Representation(kInteger32); } |
92 static Representation Double() { return Representation(kDouble); } | 92 static Representation Double() { return Representation(kDouble); } |
93 static Representation HeapObject() { return Representation(kHeapObject); } | 93 static Representation HeapObject() { return Representation(kHeapObject); } |
94 static Representation External() { return Representation(kExternal); } | 94 static Representation External() { return Representation(kExternal); } |
95 | 95 |
96 static Representation FromKind(Kind kind) { return Representation(kind); } | 96 static Representation FromKind(Kind kind) { return Representation(kind); } |
97 | 97 |
98 static Representation FromType(Type* type); | |
99 | |
100 bool Equals(const Representation& other) const { | 98 bool Equals(const Representation& other) const { |
101 return kind_ == other.kind_; | 99 return kind_ == other.kind_; |
102 } | 100 } |
103 | 101 |
104 bool IsCompatibleForLoad(const Representation& other) const { | 102 bool IsCompatibleForLoad(const Representation& other) const { |
105 return (IsDouble() && other.IsDouble()) || | 103 return (IsDouble() && other.IsDouble()) || |
106 (!IsDouble() && !other.IsDouble()); | 104 (!IsDouble() && !other.IsDouble()); |
107 } | 105 } |
108 | 106 |
109 bool IsCompatibleForStore(const Representation& other) const { | 107 bool IsCompatibleForStore(const Representation& other) const { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 uint32_t value_; | 353 uint32_t value_; |
356 }; | 354 }; |
357 | 355 |
358 | 356 |
359 std::ostream& operator<<(std::ostream& os, | 357 std::ostream& operator<<(std::ostream& os, |
360 const PropertyAttributes& attributes); | 358 const PropertyAttributes& attributes); |
361 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details); | 359 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details); |
362 } } // namespace v8::internal | 360 } } // namespace v8::internal |
363 | 361 |
364 #endif // V8_PROPERTY_DETAILS_H_ | 362 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |