OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 V(OBJECT_TEMPLATE_INFO_TYPE) \ | 388 V(OBJECT_TEMPLATE_INFO_TYPE) \ |
389 V(SIGNATURE_INFO_TYPE) \ | 389 V(SIGNATURE_INFO_TYPE) \ |
390 V(TYPE_SWITCH_INFO_TYPE) \ | 390 V(TYPE_SWITCH_INFO_TYPE) \ |
391 V(ALLOCATION_MEMENTO_TYPE) \ | 391 V(ALLOCATION_MEMENTO_TYPE) \ |
392 V(ALLOCATION_SITE_TYPE) \ | 392 V(ALLOCATION_SITE_TYPE) \ |
393 V(SCRIPT_TYPE) \ | 393 V(SCRIPT_TYPE) \ |
394 V(TYPE_FEEDBACK_INFO_TYPE) \ | 394 V(TYPE_FEEDBACK_INFO_TYPE) \ |
395 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 395 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
396 V(BOX_TYPE) \ | 396 V(BOX_TYPE) \ |
397 V(PROTOTYPE_INFO_TYPE) \ | 397 V(PROTOTYPE_INFO_TYPE) \ |
398 V(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE) \ | 398 V(CONTEXT_EXTENSION_TYPE) \ |
399 \ | 399 \ |
400 V(FIXED_ARRAY_TYPE) \ | 400 V(FIXED_ARRAY_TYPE) \ |
401 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 401 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
402 V(SHARED_FUNCTION_INFO_TYPE) \ | 402 V(SHARED_FUNCTION_INFO_TYPE) \ |
403 V(WEAK_CELL_TYPE) \ | 403 V(WEAK_CELL_TYPE) \ |
404 V(TRANSITION_ARRAY_TYPE) \ | 404 V(TRANSITION_ARRAY_TYPE) \ |
405 \ | 405 \ |
406 V(JS_MESSAGE_OBJECT_TYPE) \ | 406 V(JS_MESSAGE_OBJECT_TYPE) \ |
407 \ | 407 \ |
408 V(JS_VALUE_TYPE) \ | 408 V(JS_VALUE_TYPE) \ |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 506 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
507 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 507 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
508 V(SCRIPT, Script, script) \ | 508 V(SCRIPT, Script, script) \ |
509 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ | 509 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ |
510 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ | 510 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ |
511 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ | 511 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ |
512 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ | 512 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ |
513 V(DEBUG_INFO, DebugInfo, debug_info) \ | 513 V(DEBUG_INFO, DebugInfo, debug_info) \ |
514 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \ | 514 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \ |
515 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \ | 515 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \ |
516 V(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION, \ | 516 V(CONTEXT_EXTENSION, ContextExtension, context_extension) |
517 SloppyBlockWithEvalContextExtension, \ | |
518 sloppy_block_with_eval_context_extension) | |
519 | 517 |
520 // We use the full 8 bits of the instance_type field to encode heap object | 518 // We use the full 8 bits of the instance_type field to encode heap object |
521 // instance types. The high-order bit (bit 7) is set if the object is not a | 519 // instance types. The high-order bit (bit 7) is set if the object is not a |
522 // string, and cleared if it is a string. | 520 // string, and cleared if it is a string. |
523 const uint32_t kIsNotStringMask = 0x80; | 521 const uint32_t kIsNotStringMask = 0x80; |
524 const uint32_t kStringTag = 0x0; | 522 const uint32_t kStringTag = 0x0; |
525 const uint32_t kNotStringTag = 0x80; | 523 const uint32_t kNotStringTag = 0x80; |
526 | 524 |
527 // Bit 6 indicates that the object is an internalized string (if set) or not. | 525 // Bit 6 indicates that the object is an internalized string (if set) or not. |
528 // Bit 7 has to be clear as well. | 526 // Bit 7 has to be clear as well. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 BOX_TYPE, | 680 BOX_TYPE, |
683 DEBUG_INFO_TYPE, | 681 DEBUG_INFO_TYPE, |
684 BREAK_POINT_INFO_TYPE, | 682 BREAK_POINT_INFO_TYPE, |
685 FIXED_ARRAY_TYPE, | 683 FIXED_ARRAY_TYPE, |
686 SHARED_FUNCTION_INFO_TYPE, | 684 SHARED_FUNCTION_INFO_TYPE, |
687 CELL_TYPE, | 685 CELL_TYPE, |
688 WEAK_CELL_TYPE, | 686 WEAK_CELL_TYPE, |
689 TRANSITION_ARRAY_TYPE, | 687 TRANSITION_ARRAY_TYPE, |
690 PROPERTY_CELL_TYPE, | 688 PROPERTY_CELL_TYPE, |
691 PROTOTYPE_INFO_TYPE, | 689 PROTOTYPE_INFO_TYPE, |
692 SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE, | 690 CONTEXT_EXTENSION_TYPE, |
693 | 691 |
694 // All the following types are subtypes of JSReceiver, which corresponds to | 692 // All the following types are subtypes of JSReceiver, which corresponds to |
695 // objects in the JS sense. The first and the last type in this range are | 693 // objects in the JS sense. The first and the last type in this range are |
696 // the two forms of function. This organization enables using the same | 694 // the two forms of function. This organization enables using the same |
697 // compares for checking the JS_RECEIVER and the NONCALLABLE_JS_OBJECT range. | 695 // compares for checking the JS_RECEIVER and the NONCALLABLE_JS_OBJECT range. |
698 JS_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE | 696 JS_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE |
699 JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE | 697 JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE |
700 JS_GLOBAL_PROXY_TYPE, | 698 JS_GLOBAL_PROXY_TYPE, |
701 // Like JS_API_OBJECT_TYPE, but requires access checks and/or has | 699 // Like JS_API_OBJECT_TYPE, but requires access checks and/or has |
702 // interceptors. | 700 // interceptors. |
(...skipping 5943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6646 static const int kShouldBeFastBit = 0; | 6644 static const int kShouldBeFastBit = 0; |
6647 | 6645 |
6648 private: | 6646 private: |
6649 DECL_ACCESSORS(object_create_map, Object) | 6647 DECL_ACCESSORS(object_create_map, Object) |
6650 | 6648 |
6651 DISALLOW_IMPLICIT_CONSTRUCTORS(PrototypeInfo); | 6649 DISALLOW_IMPLICIT_CONSTRUCTORS(PrototypeInfo); |
6652 }; | 6650 }; |
6653 | 6651 |
6654 | 6652 |
6655 // Pair used to store both a ScopeInfo and an extension object in the extension | 6653 // Pair used to store both a ScopeInfo and an extension object in the extension |
6656 // slot of a block context. Needed in the rare case where a declaration block | 6654 // slot of a block, catch, or with context. Needed in the rare case where a |
6657 // scope (a "varblock" as used to desugar parameter destructuring) also contains | 6655 // declaration block scope (a "varblock" as used to desugar parameter |
6658 // a sloppy direct eval. (In no other case both are needed at the same time.) | 6656 // destructuring) also contains a sloppy direct eval, or for with and catch |
6659 class SloppyBlockWithEvalContextExtension : public Struct { | 6657 // scopes. (In no other case both are needed at the same time.) |
| 6658 class ContextExtension : public Struct { |
6660 public: | 6659 public: |
6661 // [scope_info]: Scope info. | 6660 // [scope_info]: Scope info. |
6662 DECL_ACCESSORS(scope_info, ScopeInfo) | 6661 DECL_ACCESSORS(scope_info, ScopeInfo) |
6663 // [extension]: Extension object. | 6662 // [extension]: Extension object. |
6664 DECL_ACCESSORS(extension, JSObject) | 6663 DECL_ACCESSORS(extension, Object) |
6665 | 6664 |
6666 DECLARE_CAST(SloppyBlockWithEvalContextExtension) | 6665 DECLARE_CAST(ContextExtension) |
6667 | 6666 |
6668 // Dispatched behavior. | 6667 // Dispatched behavior. |
6669 DECLARE_PRINTER(SloppyBlockWithEvalContextExtension) | 6668 DECLARE_PRINTER(ContextExtension) |
6670 DECLARE_VERIFIER(SloppyBlockWithEvalContextExtension) | 6669 DECLARE_VERIFIER(ContextExtension) |
6671 | 6670 |
6672 static const int kScopeInfoOffset = HeapObject::kHeaderSize; | 6671 static const int kScopeInfoOffset = HeapObject::kHeaderSize; |
6673 static const int kExtensionOffset = kScopeInfoOffset + kPointerSize; | 6672 static const int kExtensionOffset = kScopeInfoOffset + kPointerSize; |
6674 static const int kSize = kExtensionOffset + kPointerSize; | 6673 static const int kSize = kExtensionOffset + kPointerSize; |
6675 | 6674 |
6676 private: | 6675 private: |
6677 DISALLOW_IMPLICIT_CONSTRUCTORS(SloppyBlockWithEvalContextExtension); | 6676 DISALLOW_IMPLICIT_CONSTRUCTORS(ContextExtension); |
6678 }; | 6677 }; |
6679 | 6678 |
6680 | 6679 |
6681 // Script describes a script which has been added to the VM. | 6680 // Script describes a script which has been added to the VM. |
6682 class Script: public Struct { | 6681 class Script: public Struct { |
6683 public: | 6682 public: |
6684 // Script types. | 6683 // Script types. |
6685 enum Type { | 6684 enum Type { |
6686 TYPE_NATIVE = 0, | 6685 TYPE_NATIVE = 0, |
6687 TYPE_EXTENSION = 1, | 6686 TYPE_EXTENSION = 1, |
(...skipping 4513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11201 } | 11200 } |
11202 return value; | 11201 return value; |
11203 } | 11202 } |
11204 }; | 11203 }; |
11205 | 11204 |
11206 | 11205 |
11207 } // NOLINT, false-positive due to second-order macros. | 11206 } // NOLINT, false-positive due to second-order macros. |
11208 } // NOLINT, false-positive due to second-order macros. | 11207 } // NOLINT, false-positive due to second-order macros. |
11209 | 11208 |
11210 #endif // V8_OBJECTS_H_ | 11209 #endif // V8_OBJECTS_H_ |
OLD | NEW |