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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 SHARED_FUNCTION_INFO_TYPE, | 700 SHARED_FUNCTION_INFO_TYPE, |
701 CELL_TYPE, | 701 CELL_TYPE, |
702 WEAK_CELL_TYPE, | 702 WEAK_CELL_TYPE, |
703 PROPERTY_CELL_TYPE, | 703 PROPERTY_CELL_TYPE, |
704 PROTOTYPE_INFO_TYPE, | 704 PROTOTYPE_INFO_TYPE, |
705 SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE, | 705 SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE, |
706 | 706 |
707 // All the following types are subtypes of JSReceiver, which corresponds to | 707 // All the following types are subtypes of JSReceiver, which corresponds to |
708 // objects in the JS sense. The first and the last type in this range are | 708 // objects in the JS sense. The first and the last type in this range are |
709 // the two forms of function. This organization enables using the same | 709 // the two forms of function. This organization enables using the same |
710 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the | 710 // compares for checking the JS_RECEIVER/SPEC_OBJECT range. |
711 // NONCALLABLE_JS_OBJECT range. | |
712 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE | 711 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE |
713 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE | 712 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE |
714 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE | 713 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE |
715 JS_MESSAGE_OBJECT_TYPE, | 714 JS_MESSAGE_OBJECT_TYPE, |
716 JS_DATE_TYPE, | 715 JS_DATE_TYPE, |
717 JS_OBJECT_TYPE, | 716 JS_OBJECT_TYPE, |
718 JS_CONTEXT_EXTENSION_OBJECT_TYPE, | 717 JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
719 JS_GENERATOR_OBJECT_TYPE, | 718 JS_GENERATOR_OBJECT_TYPE, |
720 JS_MODULE_TYPE, | 719 JS_MODULE_TYPE, |
721 JS_GLOBAL_OBJECT_TYPE, | 720 JS_GLOBAL_OBJECT_TYPE, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 FIRST_JS_RECEIVER_TYPE = JS_FUNCTION_PROXY_TYPE, | 756 FIRST_JS_RECEIVER_TYPE = JS_FUNCTION_PROXY_TYPE, |
758 LAST_JS_RECEIVER_TYPE = LAST_TYPE, | 757 LAST_JS_RECEIVER_TYPE = LAST_TYPE, |
759 // Boundaries for testing the types represented as JSObject | 758 // Boundaries for testing the types represented as JSObject |
760 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, | 759 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, |
761 LAST_JS_OBJECT_TYPE = LAST_TYPE, | 760 LAST_JS_OBJECT_TYPE = LAST_TYPE, |
762 // Boundaries for testing the types represented as JSProxy | 761 // Boundaries for testing the types represented as JSProxy |
763 FIRST_JS_PROXY_TYPE = JS_FUNCTION_PROXY_TYPE, | 762 FIRST_JS_PROXY_TYPE = JS_FUNCTION_PROXY_TYPE, |
764 LAST_JS_PROXY_TYPE = JS_PROXY_TYPE, | 763 LAST_JS_PROXY_TYPE = JS_PROXY_TYPE, |
765 // Boundaries for testing whether the type is a JavaScript object. | 764 // Boundaries for testing whether the type is a JavaScript object. |
766 FIRST_SPEC_OBJECT_TYPE = FIRST_JS_RECEIVER_TYPE, | 765 FIRST_SPEC_OBJECT_TYPE = FIRST_JS_RECEIVER_TYPE, |
767 LAST_SPEC_OBJECT_TYPE = LAST_JS_RECEIVER_TYPE, | 766 LAST_SPEC_OBJECT_TYPE = LAST_JS_RECEIVER_TYPE |
768 // Boundaries for testing the types for which typeof is "object". | |
769 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE = JS_PROXY_TYPE, | |
770 LAST_NONCALLABLE_SPEC_OBJECT_TYPE = JS_REGEXP_TYPE, | |
771 // Note that the types for which typeof is "function" are not continuous. | |
772 // Define this so that we can put assertions on discrete checks. | |
773 NUM_OF_CALLABLE_SPEC_OBJECT_TYPES = 2 | |
774 }; | 767 }; |
775 | 768 |
776 STATIC_ASSERT(JS_OBJECT_TYPE == Internals::kJSObjectType); | 769 STATIC_ASSERT(JS_OBJECT_TYPE == Internals::kJSObjectType); |
777 STATIC_ASSERT(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); | 770 STATIC_ASSERT(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); |
778 STATIC_ASSERT(ODDBALL_TYPE == Internals::kOddballType); | 771 STATIC_ASSERT(ODDBALL_TYPE == Internals::kOddballType); |
779 STATIC_ASSERT(FOREIGN_TYPE == Internals::kForeignType); | 772 STATIC_ASSERT(FOREIGN_TYPE == Internals::kForeignType); |
780 | 773 |
781 | 774 |
782 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ | 775 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ |
783 V(FAST_ELEMENTS_SUB_TYPE) \ | 776 V(FAST_ELEMENTS_SUB_TYPE) \ |
(...skipping 9604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10388 } else { | 10381 } else { |
10389 value &= ~(1 << bit_position); | 10382 value &= ~(1 << bit_position); |
10390 } | 10383 } |
10391 return value; | 10384 return value; |
10392 } | 10385 } |
10393 }; | 10386 }; |
10394 | 10387 |
10395 } } // namespace v8::internal | 10388 } } // namespace v8::internal |
10396 | 10389 |
10397 #endif // V8_OBJECTS_H_ | 10390 #endif // V8_OBJECTS_H_ |
OLD | NEW |