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 // - PromiseReactionJobInfo |
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_REACTION_JOB_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_REACTION_JOB_INFO, PromiseReactionJobInfo, \ |
| 513 promise_reaction_job_info) \ |
509 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ | 514 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ |
510 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ | 515 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ |
511 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ | 516 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ |
512 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ | 517 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ |
513 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ | 518 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ |
514 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 519 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
515 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 520 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
516 V(SCRIPT, Script, script) \ | 521 V(SCRIPT, Script, script) \ |
517 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ | 522 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ |
518 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ | 523 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 OBJECT_TEMPLATE_INFO_TYPE, | 686 OBJECT_TEMPLATE_INFO_TYPE, |
682 SIGNATURE_INFO_TYPE, | 687 SIGNATURE_INFO_TYPE, |
683 TYPE_SWITCH_INFO_TYPE, | 688 TYPE_SWITCH_INFO_TYPE, |
684 ALLOCATION_SITE_TYPE, | 689 ALLOCATION_SITE_TYPE, |
685 ALLOCATION_MEMENTO_TYPE, | 690 ALLOCATION_MEMENTO_TYPE, |
686 SCRIPT_TYPE, | 691 SCRIPT_TYPE, |
687 TYPE_FEEDBACK_INFO_TYPE, | 692 TYPE_FEEDBACK_INFO_TYPE, |
688 ALIASED_ARGUMENTS_ENTRY_TYPE, | 693 ALIASED_ARGUMENTS_ENTRY_TYPE, |
689 BOX_TYPE, | 694 BOX_TYPE, |
690 PROMISE_CONTAINER_TYPE, | 695 PROMISE_CONTAINER_TYPE, |
| 696 PROMISE_REACTION_JOB_INFO_TYPE, |
691 DEBUG_INFO_TYPE, | 697 DEBUG_INFO_TYPE, |
692 BREAK_POINT_INFO_TYPE, | 698 BREAK_POINT_INFO_TYPE, |
693 FIXED_ARRAY_TYPE, | 699 FIXED_ARRAY_TYPE, |
694 SHARED_FUNCTION_INFO_TYPE, | 700 SHARED_FUNCTION_INFO_TYPE, |
695 CELL_TYPE, | 701 CELL_TYPE, |
696 WEAK_CELL_TYPE, | 702 WEAK_CELL_TYPE, |
697 TRANSITION_ARRAY_TYPE, | 703 TRANSITION_ARRAY_TYPE, |
698 PROPERTY_CELL_TYPE, | 704 PROPERTY_CELL_TYPE, |
699 PROTOTYPE_INFO_TYPE, | 705 PROTOTYPE_INFO_TYPE, |
700 CONTEXT_EXTENSION_TYPE, | 706 CONTEXT_EXTENSION_TYPE, |
(...skipping 5969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6670 | 6676 |
6671 // An abstract superclass, a marker class really, for simple structure classes. | 6677 // An abstract superclass, a marker class really, for simple structure classes. |
6672 // It doesn't carry much functionality but allows struct classes to be | 6678 // It doesn't carry much functionality but allows struct classes to be |
6673 // identified in the type system. | 6679 // identified in the type system. |
6674 class Struct: public HeapObject { | 6680 class Struct: public HeapObject { |
6675 public: | 6681 public: |
6676 inline void InitializeBody(int object_size); | 6682 inline void InitializeBody(int object_size); |
6677 DECLARE_CAST(Struct) | 6683 DECLARE_CAST(Struct) |
6678 }; | 6684 }; |
6679 | 6685 |
6680 // A container struct to hold state required for | 6686 // A container struct to hold state required for PromiseResolveThenableJob. |
6681 // PromiseResolveThenableJob. {before, after}_debug_event could | 6687 // TODO(gsathya): Rename this to be less generic. |
6682 // potentially be undefined if the debugger is turned off. | |
6683 class PromiseContainer : public Struct { | 6688 class PromiseContainer : public Struct { |
6684 public: | 6689 public: |
6685 DECL_ACCESSORS(thenable, JSReceiver) | 6690 DECL_ACCESSORS(thenable, JSReceiver) |
6686 DECL_ACCESSORS(then, JSReceiver) | 6691 DECL_ACCESSORS(then, JSReceiver) |
6687 DECL_ACCESSORS(resolve, JSFunction) | 6692 DECL_ACCESSORS(resolve, JSFunction) |
6688 DECL_ACCESSORS(reject, JSFunction) | 6693 DECL_ACCESSORS(reject, JSFunction) |
6689 DECL_ACCESSORS(before_debug_event, Object) | 6694 DECL_ACCESSORS(before_debug_event, Object) |
6690 DECL_ACCESSORS(after_debug_event, Object) | 6695 DECL_ACCESSORS(after_debug_event, Object) |
6691 | 6696 |
6692 static const int kThenableOffset = Struct::kHeaderSize; | 6697 static const int kThenableOffset = Struct::kHeaderSize; |
6693 static const int kThenOffset = kThenableOffset + kPointerSize; | 6698 static const int kThenOffset = kThenableOffset + kPointerSize; |
6694 static const int kResolveOffset = kThenOffset + kPointerSize; | 6699 static const int kResolveOffset = kThenOffset + kPointerSize; |
6695 static const int kRejectOffset = kResolveOffset + kPointerSize; | 6700 static const int kRejectOffset = kResolveOffset + kPointerSize; |
6696 static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize; | 6701 static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize; |
6697 static const int kAfterDebugEventOffset = | 6702 static const int kAfterDebugEventOffset = |
6698 kBeforeDebugEventOffset + kPointerSize; | 6703 kBeforeDebugEventOffset + kPointerSize; |
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 PromiseReactionJobInfo : public Struct { |
| 6716 public: |
| 6717 DECL_ACCESSORS(value, Object) |
| 6718 DECL_ACCESSORS(tasks, Object) |
| 6719 DECL_ACCESSORS(deferred, Object) |
| 6720 DECL_ACCESSORS(before_debug_event, Object) |
| 6721 DECL_ACCESSORS(after_debug_event, Object) |
| 6722 DECL_ACCESSORS(context, Context) |
| 6723 |
| 6724 static const int kValueOffset = Struct::kHeaderSize; |
| 6725 static const int kTasksOffset = kValueOffset + kPointerSize; |
| 6726 static const int kDeferredOffset = kTasksOffset + kPointerSize; |
| 6727 static const int kBeforeDebugEventOffset = kDeferredOffset + kPointerSize; |
| 6728 static const int kAfterDebugEventOffset = |
| 6729 kBeforeDebugEventOffset + kPointerSize; |
| 6730 static const int kContextOffset = kAfterDebugEventOffset + kPointerSize; |
| 6731 static const int kSize = kContextOffset + kPointerSize; |
| 6732 |
| 6733 DECLARE_CAST(PromiseReactionJobInfo) |
| 6734 DECLARE_PRINTER(PromiseReactionJobInfo) |
| 6735 DECLARE_VERIFIER(PromiseReactionJobInfo) |
| 6736 |
| 6737 private: |
| 6738 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseReactionJobInfo); |
| 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 |