OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // ABSENT can never be stored in or returned from a descriptor's attributes | 48 // ABSENT can never be stored in or returned from a descriptor's attributes |
49 // bitfield. It is only used as a return value meaning the attributes of | 49 // bitfield. It is only used as a return value meaning the attributes of |
50 // a non-existent property. | 50 // a non-existent property. |
51 }; | 51 }; |
52 | 52 |
53 | 53 |
54 namespace v8 { | 54 namespace v8 { |
55 namespace internal { | 55 namespace internal { |
56 | 56 |
57 class Smi; | 57 class Smi; |
58 class Type; | |
59 class TypeInfo; | |
60 | 58 |
61 // Type of properties. | 59 // Type of properties. |
62 // Order of properties is significant. | 60 // Order of properties is significant. |
63 // Must fit in the BitField PropertyDetails::TypeField. | 61 // Must fit in the BitField PropertyDetails::TypeField. |
64 // A copy of this is in mirror-debugger.js. | 62 // A copy of this is in mirror-debugger.js. |
65 enum PropertyType { | 63 enum PropertyType { |
66 // Only in slow mode. | 64 // Only in slow mode. |
67 NORMAL = 0, | 65 NORMAL = 0, |
68 // Only in fast mode. | 66 // Only in fast mode. |
69 FIELD = 1, | 67 FIELD = 1, |
(...skipping 26 matching lines...) Expand all Loading... |
96 static Representation None() { return Representation(kNone); } | 94 static Representation None() { return Representation(kNone); } |
97 static Representation Tagged() { return Representation(kTagged); } | 95 static Representation Tagged() { return Representation(kTagged); } |
98 static Representation Smi() { return Representation(kSmi); } | 96 static Representation Smi() { return Representation(kSmi); } |
99 static Representation Integer32() { return Representation(kInteger32); } | 97 static Representation Integer32() { return Representation(kInteger32); } |
100 static Representation Double() { return Representation(kDouble); } | 98 static Representation Double() { return Representation(kDouble); } |
101 static Representation HeapObject() { return Representation(kHeapObject); } | 99 static Representation HeapObject() { return Representation(kHeapObject); } |
102 static Representation External() { return Representation(kExternal); } | 100 static Representation External() { return Representation(kExternal); } |
103 | 101 |
104 static Representation FromKind(Kind kind) { return Representation(kind); } | 102 static Representation FromKind(Kind kind) { return Representation(kind); } |
105 | 103 |
106 // TODO(rossberg): this should die eventually. | |
107 static Representation FromType(TypeInfo info); | |
108 static Representation FromType(Handle<Type> type); | |
109 | |
110 bool Equals(const Representation& other) const { | 104 bool Equals(const Representation& other) const { |
111 return kind_ == other.kind_; | 105 return kind_ == other.kind_; |
112 } | 106 } |
113 | 107 |
114 bool IsCompatibleForLoad(const Representation& other) const { | 108 bool IsCompatibleForLoad(const Representation& other) const { |
115 return (IsDouble() && other.IsDouble()) || | 109 return (IsDouble() && other.IsDouble()) || |
116 (!IsDouble() && !other.IsDouble()); | 110 (!IsDouble() && !other.IsDouble()); |
117 } | 111 } |
118 | 112 |
119 bool IsCompatibleForStore(const Representation& other) const { | 113 bool IsCompatibleForStore(const Representation& other) const { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 PropertyDetails(int value, PropertyAttributes attributes) { | 263 PropertyDetails(int value, PropertyAttributes attributes) { |
270 value_ = AttributesField::update(value, attributes); | 264 value_ = AttributesField::update(value, attributes); |
271 } | 265 } |
272 | 266 |
273 uint32_t value_; | 267 uint32_t value_; |
274 }; | 268 }; |
275 | 269 |
276 } } // namespace v8::internal | 270 } } // namespace v8::internal |
277 | 271 |
278 #endif // V8_PROPERTY_DETAILS_H_ | 272 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |