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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
393 V(SIGNATURE_INFO_TYPE) \ | 393 V(SIGNATURE_INFO_TYPE) \ |
394 V(TYPE_SWITCH_INFO_TYPE) \ | 394 V(TYPE_SWITCH_INFO_TYPE) \ |
395 V(ALLOCATION_MEMENTO_TYPE) \ | 395 V(ALLOCATION_MEMENTO_TYPE) \ |
396 V(ALLOCATION_SITE_TYPE) \ | 396 V(ALLOCATION_SITE_TYPE) \ |
397 V(SCRIPT_TYPE) \ | 397 V(SCRIPT_TYPE) \ |
398 V(TYPE_FEEDBACK_INFO_TYPE) \ | 398 V(TYPE_FEEDBACK_INFO_TYPE) \ |
399 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 399 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
400 V(BOX_TYPE) \ | 400 V(BOX_TYPE) \ |
401 V(PROMISE_CONTAINER_TYPE) \ | 401 V(PROMISE_CONTAINER_TYPE) \ |
402 V(PROTOTYPE_INFO_TYPE) \ | 402 V(PROTOTYPE_INFO_TYPE) \ |
403 V(TUPLE3_TYPE) \ | |
403 V(CONTEXT_EXTENSION_TYPE) \ | 404 V(CONTEXT_EXTENSION_TYPE) \ |
404 V(MODULE_TYPE) \ | 405 V(MODULE_TYPE) \ |
405 \ | 406 \ |
406 V(FIXED_ARRAY_TYPE) \ | 407 V(FIXED_ARRAY_TYPE) \ |
407 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 408 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
408 V(SHARED_FUNCTION_INFO_TYPE) \ | 409 V(SHARED_FUNCTION_INFO_TYPE) \ |
409 V(WEAK_CELL_TYPE) \ | 410 V(WEAK_CELL_TYPE) \ |
410 V(TRANSITION_ARRAY_TYPE) \ | 411 V(TRANSITION_ARRAY_TYPE) \ |
411 \ | 412 \ |
412 V(JS_MESSAGE_OBJECT_TYPE) \ | 413 V(JS_MESSAGE_OBJECT_TYPE) \ |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 515 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
515 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 516 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
516 V(SCRIPT, Script, script) \ | 517 V(SCRIPT, Script, script) \ |
517 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ | 518 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ |
518 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ | 519 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ |
519 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ | 520 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ |
520 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ | 521 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ |
521 V(DEBUG_INFO, DebugInfo, debug_info) \ | 522 V(DEBUG_INFO, DebugInfo, debug_info) \ |
522 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \ | 523 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \ |
523 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \ | 524 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \ |
525 V(TUPLE3, Tuple3, tuple3) \ | |
524 V(MODULE, Module, module) \ | 526 V(MODULE, Module, module) \ |
525 V(CONTEXT_EXTENSION, ContextExtension, context_extension) | 527 V(CONTEXT_EXTENSION, ContextExtension, context_extension) |
526 | 528 |
527 // We use the full 8 bits of the instance_type field to encode heap object | 529 // We use the full 8 bits of the instance_type field to encode heap object |
528 // instance types. The high-order bit (bit 7) is set if the object is not a | 530 // instance types. The high-order bit (bit 7) is set if the object is not a |
529 // string, and cleared if it is a string. | 531 // string, and cleared if it is a string. |
530 const uint32_t kIsNotStringMask = 0x80; | 532 const uint32_t kIsNotStringMask = 0x80; |
531 const uint32_t kStringTag = 0x0; | 533 const uint32_t kStringTag = 0x0; |
532 const uint32_t kNotStringTag = 0x80; | 534 const uint32_t kNotStringTag = 0x80; |
533 | 535 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
690 PROMISE_CONTAINER_TYPE, | 692 PROMISE_CONTAINER_TYPE, |
691 DEBUG_INFO_TYPE, | 693 DEBUG_INFO_TYPE, |
692 BREAK_POINT_INFO_TYPE, | 694 BREAK_POINT_INFO_TYPE, |
693 FIXED_ARRAY_TYPE, | 695 FIXED_ARRAY_TYPE, |
694 SHARED_FUNCTION_INFO_TYPE, | 696 SHARED_FUNCTION_INFO_TYPE, |
695 CELL_TYPE, | 697 CELL_TYPE, |
696 WEAK_CELL_TYPE, | 698 WEAK_CELL_TYPE, |
697 TRANSITION_ARRAY_TYPE, | 699 TRANSITION_ARRAY_TYPE, |
698 PROPERTY_CELL_TYPE, | 700 PROPERTY_CELL_TYPE, |
699 PROTOTYPE_INFO_TYPE, | 701 PROTOTYPE_INFO_TYPE, |
702 TUPLE3_TYPE, | |
700 CONTEXT_EXTENSION_TYPE, | 703 CONTEXT_EXTENSION_TYPE, |
701 MODULE_TYPE, | 704 MODULE_TYPE, |
702 | 705 |
703 // All the following types are subtypes of JSReceiver, which corresponds to | 706 // All the following types are subtypes of JSReceiver, which corresponds to |
704 // objects in the JS sense. The first and the last type in this range are | 707 // objects in the JS sense. The first and the last type in this range are |
705 // the two forms of function. This organization enables using the same | 708 // the two forms of function. This organization enables using the same |
706 // compares for checking the JS_RECEIVER and the NONCALLABLE_JS_OBJECT range. | 709 // compares for checking the JS_RECEIVER and the NONCALLABLE_JS_OBJECT range. |
707 JS_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE | 710 JS_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE |
708 JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE | 711 JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE |
709 JS_GLOBAL_PROXY_TYPE, | 712 JS_GLOBAL_PROXY_TYPE, |
(...skipping 6065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6775 | 6778 |
6776 // Bit field usage. | 6779 // Bit field usage. |
6777 static const int kShouldBeFastBit = 0; | 6780 static const int kShouldBeFastBit = 0; |
6778 | 6781 |
6779 private: | 6782 private: |
6780 DECL_ACCESSORS(object_create_map, Object) | 6783 DECL_ACCESSORS(object_create_map, Object) |
6781 | 6784 |
6782 DISALLOW_IMPLICIT_CONSTRUCTORS(PrototypeInfo); | 6785 DISALLOW_IMPLICIT_CONSTRUCTORS(PrototypeInfo); |
6783 }; | 6786 }; |
6784 | 6787 |
6788 class Tuple3 : public Struct { | |
Jakob Kummerow
2016/10/13 11:59:26
I would have called it Triple (and the values mayb
Igor Sheludko
2016/10/13 13:20:38
Let's keep it in a form TupleX because it scales (
| |
6789 public: | |
6790 DECL_ACCESSORS(value1, Object) | |
6791 DECL_ACCESSORS(value2, Object) | |
6792 DECL_ACCESSORS(value3, Object) | |
6793 | |
6794 DECLARE_CAST(Tuple3) | |
6795 | |
6796 // Dispatched behavior. | |
6797 DECLARE_PRINTER(Tuple3) | |
6798 DECLARE_VERIFIER(Tuple3) | |
6799 | |
6800 static const int kValue1Offset = HeapObject::kHeaderSize; | |
6801 static const int kValue2Offset = kValue1Offset + kPointerSize; | |
6802 static const int kValue3Offset = kValue2Offset + kPointerSize; | |
6803 static const int kSize = kValue3Offset + kPointerSize; | |
6804 | |
6805 private: | |
6806 DISALLOW_IMPLICIT_CONSTRUCTORS(Tuple3); | |
6807 }; | |
6785 | 6808 |
6786 // Pair used to store both a ScopeInfo and an extension object in the extension | 6809 // Pair used to store both a ScopeInfo and an extension object in the extension |
6787 // slot of a block, catch, or with context. Needed in the rare case where a | 6810 // slot of a block, catch, or with context. Needed in the rare case where a |
6788 // declaration block scope (a "varblock" as used to desugar parameter | 6811 // declaration block scope (a "varblock" as used to desugar parameter |
6789 // destructuring) also contains a sloppy direct eval, or for with and catch | 6812 // destructuring) also contains a sloppy direct eval, or for with and catch |
6790 // scopes. (In no other case both are needed at the same time.) | 6813 // scopes. (In no other case both are needed at the same time.) |
6791 class ContextExtension : public Struct { | 6814 class ContextExtension : public Struct { |
6792 public: | 6815 public: |
6793 // [scope_info]: Scope info. | 6816 // [scope_info]: Scope info. |
6794 DECL_ACCESSORS(scope_info, ScopeInfo) | 6817 DECL_ACCESSORS(scope_info, ScopeInfo) |
(...skipping 4652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11447 } | 11470 } |
11448 return value; | 11471 return value; |
11449 } | 11472 } |
11450 }; | 11473 }; |
11451 | 11474 |
11452 | 11475 |
11453 } // NOLINT, false-positive due to second-order macros. | 11476 } // NOLINT, false-positive due to second-order macros. |
11454 } // NOLINT, false-positive due to second-order macros. | 11477 } // NOLINT, false-positive due to second-order macros. |
11455 | 11478 |
11456 #endif // V8_OBJECTS_H_ | 11479 #endif // V8_OBJECTS_H_ |
OLD | NEW |