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. | 710 // compares for checking the JS_RECEIVER/SPEC_OBJECT range and the |
| 711 // NONCALLABLE_JS_OBJECT range. |
711 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE | 712 JS_FUNCTION_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE, FIRST_JS_PROXY_TYPE |
712 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE | 713 JS_PROXY_TYPE, // LAST_JS_PROXY_TYPE |
713 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE | 714 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE |
714 JS_MESSAGE_OBJECT_TYPE, | 715 JS_MESSAGE_OBJECT_TYPE, |
715 JS_DATE_TYPE, | 716 JS_DATE_TYPE, |
716 JS_OBJECT_TYPE, | 717 JS_OBJECT_TYPE, |
717 JS_CONTEXT_EXTENSION_OBJECT_TYPE, | 718 JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
718 JS_GENERATOR_OBJECT_TYPE, | 719 JS_GENERATOR_OBJECT_TYPE, |
719 JS_MODULE_TYPE, | 720 JS_MODULE_TYPE, |
720 JS_GLOBAL_OBJECT_TYPE, | 721 JS_GLOBAL_OBJECT_TYPE, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 FIRST_JS_RECEIVER_TYPE = JS_FUNCTION_PROXY_TYPE, | 757 FIRST_JS_RECEIVER_TYPE = JS_FUNCTION_PROXY_TYPE, |
757 LAST_JS_RECEIVER_TYPE = LAST_TYPE, | 758 LAST_JS_RECEIVER_TYPE = LAST_TYPE, |
758 // Boundaries for testing the types represented as JSObject | 759 // Boundaries for testing the types represented as JSObject |
759 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, | 760 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, |
760 LAST_JS_OBJECT_TYPE = LAST_TYPE, | 761 LAST_JS_OBJECT_TYPE = LAST_TYPE, |
761 // Boundaries for testing the types represented as JSProxy | 762 // Boundaries for testing the types represented as JSProxy |
762 FIRST_JS_PROXY_TYPE = JS_FUNCTION_PROXY_TYPE, | 763 FIRST_JS_PROXY_TYPE = JS_FUNCTION_PROXY_TYPE, |
763 LAST_JS_PROXY_TYPE = JS_PROXY_TYPE, | 764 LAST_JS_PROXY_TYPE = JS_PROXY_TYPE, |
764 // Boundaries for testing whether the type is a JavaScript object. | 765 // Boundaries for testing whether the type is a JavaScript object. |
765 FIRST_SPEC_OBJECT_TYPE = FIRST_JS_RECEIVER_TYPE, | 766 FIRST_SPEC_OBJECT_TYPE = FIRST_JS_RECEIVER_TYPE, |
766 LAST_SPEC_OBJECT_TYPE = LAST_JS_RECEIVER_TYPE | 767 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 |
767 }; | 774 }; |
768 | 775 |
769 STATIC_ASSERT(JS_OBJECT_TYPE == Internals::kJSObjectType); | 776 STATIC_ASSERT(JS_OBJECT_TYPE == Internals::kJSObjectType); |
770 STATIC_ASSERT(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); | 777 STATIC_ASSERT(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); |
771 STATIC_ASSERT(ODDBALL_TYPE == Internals::kOddballType); | 778 STATIC_ASSERT(ODDBALL_TYPE == Internals::kOddballType); |
772 STATIC_ASSERT(FOREIGN_TYPE == Internals::kForeignType); | 779 STATIC_ASSERT(FOREIGN_TYPE == Internals::kForeignType); |
773 | 780 |
774 | 781 |
775 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ | 782 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \ |
776 V(FAST_ELEMENTS_SUB_TYPE) \ | 783 V(FAST_ELEMENTS_SUB_TYPE) \ |
(...skipping 9604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10381 } else { | 10388 } else { |
10382 value &= ~(1 << bit_position); | 10389 value &= ~(1 << bit_position); |
10383 } | 10390 } |
10384 return value; | 10391 return value; |
10385 } | 10392 } |
10386 }; | 10393 }; |
10387 | 10394 |
10388 } } // namespace v8::internal | 10395 } } // namespace v8::internal |
10389 | 10396 |
10390 #endif // V8_OBJECTS_H_ | 10397 #endif // V8_OBJECTS_H_ |
OLD | NEW |