OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 EXTERNAL_DOUBLE_ELEMENTS, | 155 EXTERNAL_DOUBLE_ELEMENTS, |
156 EXTERNAL_PIXEL_ELEMENTS, | 156 EXTERNAL_PIXEL_ELEMENTS, |
157 | 157 |
158 // Derived constants from ElementsKind | 158 // Derived constants from ElementsKind |
159 FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_BYTE_ELEMENTS, | 159 FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_BYTE_ELEMENTS, |
160 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS, | 160 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS, |
161 FIRST_ELEMENTS_KIND = FAST_SMI_ONLY_ELEMENTS, | 161 FIRST_ELEMENTS_KIND = FAST_SMI_ONLY_ELEMENTS, |
162 LAST_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS | 162 LAST_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS |
163 }; | 163 }; |
164 | 164 |
165 static const int kElementsKindCount = | 165 const int kElementsKindCount = LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1; |
166 LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1; | |
167 | 166 |
168 void PrintElementsKind(FILE* out, ElementsKind kind); | 167 void PrintElementsKind(FILE* out, ElementsKind kind); |
169 | 168 |
170 inline bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, | 169 inline bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, |
171 ElementsKind to_kind); | 170 ElementsKind to_kind); |
172 | 171 |
173 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER. | 172 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER. |
174 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER }; | 173 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER }; |
175 | 174 |
176 | 175 |
(...skipping 14 matching lines...) Expand all Loading... |
191 | 190 |
192 | 191 |
193 // Indicates whether a get method should implicitly create the object looked up. | 192 // Indicates whether a get method should implicitly create the object looked up. |
194 enum CreationFlag { | 193 enum CreationFlag { |
195 ALLOW_CREATION, | 194 ALLOW_CREATION, |
196 OMIT_CREATION | 195 OMIT_CREATION |
197 }; | 196 }; |
198 | 197 |
199 | 198 |
200 // Instance size sentinel for objects of variable size. | 199 // Instance size sentinel for objects of variable size. |
201 static const int kVariableSizeSentinel = 0; | 200 const int kVariableSizeSentinel = 0; |
202 | 201 |
203 | 202 |
204 // All Maps have a field instance_type containing a InstanceType. | 203 // All Maps have a field instance_type containing a InstanceType. |
205 // It describes the type of the instances. | 204 // It describes the type of the instances. |
206 // | 205 // |
207 // As an example, a JavaScript object is a heap object and its map | 206 // As an example, a JavaScript object is a heap object and its map |
208 // instance_type is JS_OBJECT_TYPE. | 207 // instance_type is JS_OBJECT_TYPE. |
209 // | 208 // |
210 // The names of the string instance types are intended to systematically | 209 // The names of the string instance types are intended to systematically |
211 // mirror their encoding in the instance_type field of the map. The default | 210 // mirror their encoding in the instance_type field of the map. The default |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 FIRST_SPEC_OBJECT_TYPE = FIRST_JS_RECEIVER_TYPE, | 593 FIRST_SPEC_OBJECT_TYPE = FIRST_JS_RECEIVER_TYPE, |
595 LAST_SPEC_OBJECT_TYPE = LAST_JS_RECEIVER_TYPE, | 594 LAST_SPEC_OBJECT_TYPE = LAST_JS_RECEIVER_TYPE, |
596 // Boundaries for testing the types for which typeof is "object". | 595 // Boundaries for testing the types for which typeof is "object". |
597 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE = JS_PROXY_TYPE, | 596 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE = JS_PROXY_TYPE, |
598 LAST_NONCALLABLE_SPEC_OBJECT_TYPE = JS_REGEXP_TYPE, | 597 LAST_NONCALLABLE_SPEC_OBJECT_TYPE = JS_REGEXP_TYPE, |
599 // Note that the types for which typeof is "function" are not continuous. | 598 // Note that the types for which typeof is "function" are not continuous. |
600 // Define this so that we can put assertions on discrete checks. | 599 // Define this so that we can put assertions on discrete checks. |
601 NUM_OF_CALLABLE_SPEC_OBJECT_TYPES = 2 | 600 NUM_OF_CALLABLE_SPEC_OBJECT_TYPES = 2 |
602 }; | 601 }; |
603 | 602 |
604 static const int kExternalArrayTypeCount = LAST_EXTERNAL_ARRAY_TYPE - | 603 const int kExternalArrayTypeCount = |
605 FIRST_EXTERNAL_ARRAY_TYPE + 1; | 604 LAST_EXTERNAL_ARRAY_TYPE - FIRST_EXTERNAL_ARRAY_TYPE + 1; |
606 | 605 |
607 STATIC_CHECK(JS_OBJECT_TYPE == Internals::kJSObjectType); | 606 STATIC_CHECK(JS_OBJECT_TYPE == Internals::kJSObjectType); |
608 STATIC_CHECK(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); | 607 STATIC_CHECK(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); |
609 STATIC_CHECK(FOREIGN_TYPE == Internals::kForeignType); | 608 STATIC_CHECK(FOREIGN_TYPE == Internals::kForeignType); |
610 | 609 |
611 | 610 |
612 enum CompareResult { | 611 enum CompareResult { |
613 LESS = -1, | 612 LESS = -1, |
614 EQUAL = 0, | 613 EQUAL = 0, |
615 GREATER = 1, | 614 GREATER = 1, |
(...skipping 7268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7884 } else { | 7883 } else { |
7885 value &= ~(1 << bit_position); | 7884 value &= ~(1 << bit_position); |
7886 } | 7885 } |
7887 return value; | 7886 return value; |
7888 } | 7887 } |
7889 }; | 7888 }; |
7890 | 7889 |
7891 } } // namespace v8::internal | 7890 } } // namespace v8::internal |
7892 | 7891 |
7893 #endif // V8_OBJECTS_H_ | 7892 #endif // V8_OBJECTS_H_ |
OLD | NEW |