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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 // - PropertyCell | 136 // - PropertyCell |
137 // - Code | 137 // - Code |
138 // - AbstractCode, a wrapper around Code or BytecodeArray | 138 // - AbstractCode, a wrapper around Code or BytecodeArray |
139 // - Map | 139 // - Map |
140 // - Oddball | 140 // - Oddball |
141 // - Foreign | 141 // - Foreign |
142 // - SharedFunctionInfo | 142 // - SharedFunctionInfo |
143 // - Struct | 143 // - Struct |
144 // - Box | 144 // - Box |
145 // - AccessorInfo | 145 // - AccessorInfo |
146 // - PromiseContainer | |
147 // - PromiseHandleInfo | |
146 // - AccessorPair | 148 // - AccessorPair |
147 // - AccessCheckInfo | 149 // - AccessCheckInfo |
148 // - InterceptorInfo | 150 // - InterceptorInfo |
149 // - CallHandlerInfo | 151 // - CallHandlerInfo |
150 // - TemplateInfo | 152 // - TemplateInfo |
151 // - FunctionTemplateInfo | 153 // - FunctionTemplateInfo |
152 // - ObjectTemplateInfo | 154 // - ObjectTemplateInfo |
153 // - Script | 155 // - Script |
154 // - DebugInfo | 156 // - DebugInfo |
155 // - BreakPointInfo | 157 // - BreakPointInfo |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 V(OBJECT_TEMPLATE_INFO_TYPE) \ | 394 V(OBJECT_TEMPLATE_INFO_TYPE) \ |
393 V(SIGNATURE_INFO_TYPE) \ | 395 V(SIGNATURE_INFO_TYPE) \ |
394 V(TYPE_SWITCH_INFO_TYPE) \ | 396 V(TYPE_SWITCH_INFO_TYPE) \ |
395 V(ALLOCATION_MEMENTO_TYPE) \ | 397 V(ALLOCATION_MEMENTO_TYPE) \ |
396 V(ALLOCATION_SITE_TYPE) \ | 398 V(ALLOCATION_SITE_TYPE) \ |
397 V(SCRIPT_TYPE) \ | 399 V(SCRIPT_TYPE) \ |
398 V(TYPE_FEEDBACK_INFO_TYPE) \ | 400 V(TYPE_FEEDBACK_INFO_TYPE) \ |
399 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 401 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
400 V(BOX_TYPE) \ | 402 V(BOX_TYPE) \ |
401 V(PROMISE_CONTAINER_TYPE) \ | 403 V(PROMISE_CONTAINER_TYPE) \ |
404 V(PROMISE_HANDLE_INFO_TYPE) \ | |
402 V(PROTOTYPE_INFO_TYPE) \ | 405 V(PROTOTYPE_INFO_TYPE) \ |
403 V(CONTEXT_EXTENSION_TYPE) \ | 406 V(CONTEXT_EXTENSION_TYPE) \ |
404 V(MODULE_TYPE) \ | 407 V(MODULE_TYPE) \ |
405 \ | 408 \ |
406 V(FIXED_ARRAY_TYPE) \ | 409 V(FIXED_ARRAY_TYPE) \ |
407 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 410 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
408 V(SHARED_FUNCTION_INFO_TYPE) \ | 411 V(SHARED_FUNCTION_INFO_TYPE) \ |
409 V(WEAK_CELL_TYPE) \ | 412 V(WEAK_CELL_TYPE) \ |
410 V(TRANSITION_ARRAY_TYPE) \ | 413 V(TRANSITION_ARRAY_TYPE) \ |
411 \ | 414 \ |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
499 // code for the class including allocation and garbage collection routines, | 502 // code for the class including allocation and garbage collection routines, |
500 // casts and predicates. All you need to define is the class, methods and | 503 // casts and predicates. All you need to define is the class, methods and |
501 // object verification routines. Easy, no? | 504 // object verification routines. Easy, no? |
502 // | 505 // |
503 // Note that for subtle reasons related to the ordering or numerical values of | 506 // Note that for subtle reasons related to the ordering or numerical values of |
504 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST | 507 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST |
505 // manually. | 508 // manually. |
506 #define STRUCT_LIST(V) \ | 509 #define STRUCT_LIST(V) \ |
507 V(BOX, Box, box) \ | 510 V(BOX, Box, box) \ |
508 V(PROMISE_CONTAINER, PromiseContainer, promise_container) \ | 511 V(PROMISE_CONTAINER, PromiseContainer, promise_container) \ |
512 V(PROMISE_HANDLE_INFO, PromiseHandleInfo, promise_handle_info) \ | |
509 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ | 513 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ |
510 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ | 514 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ |
511 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ | 515 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ |
512 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ | 516 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ |
513 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ | 517 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ |
514 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 518 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
515 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 519 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
516 V(SCRIPT, Script, script) \ | 520 V(SCRIPT, Script, script) \ |
517 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ | 521 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ |
518 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ | 522 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
681 OBJECT_TEMPLATE_INFO_TYPE, | 685 OBJECT_TEMPLATE_INFO_TYPE, |
682 SIGNATURE_INFO_TYPE, | 686 SIGNATURE_INFO_TYPE, |
683 TYPE_SWITCH_INFO_TYPE, | 687 TYPE_SWITCH_INFO_TYPE, |
684 ALLOCATION_SITE_TYPE, | 688 ALLOCATION_SITE_TYPE, |
685 ALLOCATION_MEMENTO_TYPE, | 689 ALLOCATION_MEMENTO_TYPE, |
686 SCRIPT_TYPE, | 690 SCRIPT_TYPE, |
687 TYPE_FEEDBACK_INFO_TYPE, | 691 TYPE_FEEDBACK_INFO_TYPE, |
688 ALIASED_ARGUMENTS_ENTRY_TYPE, | 692 ALIASED_ARGUMENTS_ENTRY_TYPE, |
689 BOX_TYPE, | 693 BOX_TYPE, |
690 PROMISE_CONTAINER_TYPE, | 694 PROMISE_CONTAINER_TYPE, |
695 PROMISE_HANDLE_INFO_TYPE, | |
691 DEBUG_INFO_TYPE, | 696 DEBUG_INFO_TYPE, |
692 BREAK_POINT_INFO_TYPE, | 697 BREAK_POINT_INFO_TYPE, |
693 FIXED_ARRAY_TYPE, | 698 FIXED_ARRAY_TYPE, |
694 SHARED_FUNCTION_INFO_TYPE, | 699 SHARED_FUNCTION_INFO_TYPE, |
695 CELL_TYPE, | 700 CELL_TYPE, |
696 WEAK_CELL_TYPE, | 701 WEAK_CELL_TYPE, |
697 TRANSITION_ARRAY_TYPE, | 702 TRANSITION_ARRAY_TYPE, |
698 PROPERTY_CELL_TYPE, | 703 PROPERTY_CELL_TYPE, |
699 PROTOTYPE_INFO_TYPE, | 704 PROTOTYPE_INFO_TYPE, |
700 CONTEXT_EXTENSION_TYPE, | 705 CONTEXT_EXTENSION_TYPE, |
(...skipping 5998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6699 static const int kSize = kAfterDebugEventOffset + kPointerSize; | 6704 static const int kSize = kAfterDebugEventOffset + kPointerSize; |
6700 | 6705 |
6701 DECLARE_CAST(PromiseContainer) | 6706 DECLARE_CAST(PromiseContainer) |
6702 DECLARE_PRINTER(PromiseContainer) | 6707 DECLARE_PRINTER(PromiseContainer) |
6703 DECLARE_VERIFIER(PromiseContainer) | 6708 DECLARE_VERIFIER(PromiseContainer) |
6704 | 6709 |
6705 private: | 6710 private: |
6706 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseContainer); | 6711 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseContainer); |
6707 }; | 6712 }; |
6708 | 6713 |
6714 // Struct to hold state required for PromiseReactionJob. | |
6715 class PromiseHandleInfo : public Struct { | |
gsathya
2016/10/11 16:40:51
PromiseReactionInfo is a better name?
| |
6716 public: | |
6717 DECL_ACCESSORS(value, Object) | |
6718 DECL_ACCESSORS(tasks, Object) | |
6719 DECL_ACCESSORS(deferreds, Object) | |
6720 DECL_ACCESSORS(before_debug_event, Object) | |
6721 DECL_ACCESSORS(after_debug_event, Object) | |
6722 DECL_ACCESSORS(reaction_context, JSFunction) | |
6723 | |
6724 static const int kValueOffset = Struct::kHeaderSize; | |
6725 static const int kTasksOffset = kValueOffset + kPointerSize; | |
6726 static const int kDeferredsOffset = kTasksOffset + kPointerSize; | |
6727 static const int kBeforeDebugEventOffset = kDeferredsOffset + kPointerSize; | |
6728 static const int kAfterDebugEventOffset = | |
6729 kBeforeDebugEventOffset + kPointerSize; | |
6730 static const int kReactionContext = kAfterDebugEventOffset + kPointerSize; | |
6731 static const int kSize = kReactionContext + kPointerSize; | |
6732 | |
6733 DECLARE_CAST(PromiseHandleInfo) | |
6734 DECLARE_PRINTER(PromiseHandleInfo) | |
6735 DECLARE_VERIFIER(PromiseHandleInfo) | |
6736 | |
6737 private: | |
6738 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseHandleInfo); | |
6739 }; | |
6740 | |
6709 // A simple one-element struct, useful where smis need to be boxed. | 6741 // A simple one-element struct, useful where smis need to be boxed. |
6710 class Box : public Struct { | 6742 class Box : public Struct { |
6711 public: | 6743 public: |
6712 // [value]: the boxed contents. | 6744 // [value]: the boxed contents. |
6713 DECL_ACCESSORS(value, Object) | 6745 DECL_ACCESSORS(value, Object) |
6714 | 6746 |
6715 DECLARE_CAST(Box) | 6747 DECLARE_CAST(Box) |
6716 | 6748 |
6717 // Dispatched behavior. | 6749 // Dispatched behavior. |
6718 DECLARE_PRINTER(Box) | 6750 DECLARE_PRINTER(Box) |
(...skipping 4731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11450 } | 11482 } |
11451 return value; | 11483 return value; |
11452 } | 11484 } |
11453 }; | 11485 }; |
11454 | 11486 |
11455 | 11487 |
11456 } // NOLINT, false-positive due to second-order macros. | 11488 } // NOLINT, false-positive due to second-order macros. |
11457 } // NOLINT, false-positive due to second-order macros. | 11489 } // NOLINT, false-positive due to second-order macros. |
11458 | 11490 |
11459 #endif // V8_OBJECTS_H_ | 11491 #endif // V8_OBJECTS_H_ |
OLD | NEW |