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 | 146 // - PromiseResolveThenableJobInfo |
147 // - PromiseReactionJobInfo | 147 // - PromiseReactionJobInfo |
148 // - AccessorPair | 148 // - AccessorPair |
149 // - AccessCheckInfo | 149 // - AccessCheckInfo |
150 // - InterceptorInfo | 150 // - InterceptorInfo |
151 // - CallHandlerInfo | 151 // - CallHandlerInfo |
152 // - TemplateInfo | 152 // - TemplateInfo |
153 // - FunctionTemplateInfo | 153 // - FunctionTemplateInfo |
154 // - ObjectTemplateInfo | 154 // - ObjectTemplateInfo |
155 // - Script | 155 // - Script |
156 // - DebugInfo | 156 // - DebugInfo |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 V(FUNCTION_TEMPLATE_INFO_TYPE) \ | 393 V(FUNCTION_TEMPLATE_INFO_TYPE) \ |
394 V(OBJECT_TEMPLATE_INFO_TYPE) \ | 394 V(OBJECT_TEMPLATE_INFO_TYPE) \ |
395 V(SIGNATURE_INFO_TYPE) \ | 395 V(SIGNATURE_INFO_TYPE) \ |
396 V(TYPE_SWITCH_INFO_TYPE) \ | 396 V(TYPE_SWITCH_INFO_TYPE) \ |
397 V(ALLOCATION_MEMENTO_TYPE) \ | 397 V(ALLOCATION_MEMENTO_TYPE) \ |
398 V(ALLOCATION_SITE_TYPE) \ | 398 V(ALLOCATION_SITE_TYPE) \ |
399 V(SCRIPT_TYPE) \ | 399 V(SCRIPT_TYPE) \ |
400 V(TYPE_FEEDBACK_INFO_TYPE) \ | 400 V(TYPE_FEEDBACK_INFO_TYPE) \ |
401 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 401 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
402 V(BOX_TYPE) \ | 402 V(BOX_TYPE) \ |
403 V(PROMISE_CONTAINER_TYPE) \ | 403 V(PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE) \ |
404 V(PROMISE_REACTION_JOB_INFO_TYPE) \ | 404 V(PROMISE_REACTION_JOB_INFO_TYPE) \ |
405 V(PROTOTYPE_INFO_TYPE) \ | 405 V(PROTOTYPE_INFO_TYPE) \ |
406 V(CONTEXT_EXTENSION_TYPE) \ | 406 V(CONTEXT_EXTENSION_TYPE) \ |
407 V(MODULE_TYPE) \ | 407 V(MODULE_TYPE) \ |
408 \ | 408 \ |
409 V(FIXED_ARRAY_TYPE) \ | 409 V(FIXED_ARRAY_TYPE) \ |
410 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 410 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
411 V(SHARED_FUNCTION_INFO_TYPE) \ | 411 V(SHARED_FUNCTION_INFO_TYPE) \ |
412 V(WEAK_CELL_TYPE) \ | 412 V(WEAK_CELL_TYPE) \ |
413 V(TRANSITION_ARRAY_TYPE) \ | 413 V(TRANSITION_ARRAY_TYPE) \ |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 // object type in this causes the compiler to generate most of the boilerplate | 501 // object type in this causes the compiler to generate most of the boilerplate |
502 // code for the class including allocation and garbage collection routines, | 502 // code for the class including allocation and garbage collection routines, |
503 // 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 |
504 // object verification routines. Easy, no? | 504 // object verification routines. Easy, no? |
505 // | 505 // |
506 // 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 |
507 // 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 |
508 // manually. | 508 // manually. |
509 #define STRUCT_LIST(V) \ | 509 #define STRUCT_LIST(V) \ |
510 V(BOX, Box, box) \ | 510 V(BOX, Box, box) \ |
511 V(PROMISE_CONTAINER, PromiseContainer, promise_container) \ | 511 V(PROMISE_RESOLVE_THENABLE_JOB_INFO, PromiseResolveThenableJobInfo, \ |
| 512 promise_resolve_thenable_job_info) \ |
512 V(PROMISE_REACTION_JOB_INFO, PromiseReactionJobInfo, \ | 513 V(PROMISE_REACTION_JOB_INFO, PromiseReactionJobInfo, \ |
513 promise_reaction_job_info) \ | 514 promise_reaction_job_info) \ |
514 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ | 515 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ |
515 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ | 516 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ |
516 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ | 517 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ |
517 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ | 518 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ |
518 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ | 519 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ |
519 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 520 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
520 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 521 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
521 V(SCRIPT, Script, script) \ | 522 V(SCRIPT, Script, script) \ |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 FUNCTION_TEMPLATE_INFO_TYPE, | 686 FUNCTION_TEMPLATE_INFO_TYPE, |
686 OBJECT_TEMPLATE_INFO_TYPE, | 687 OBJECT_TEMPLATE_INFO_TYPE, |
687 SIGNATURE_INFO_TYPE, | 688 SIGNATURE_INFO_TYPE, |
688 TYPE_SWITCH_INFO_TYPE, | 689 TYPE_SWITCH_INFO_TYPE, |
689 ALLOCATION_SITE_TYPE, | 690 ALLOCATION_SITE_TYPE, |
690 ALLOCATION_MEMENTO_TYPE, | 691 ALLOCATION_MEMENTO_TYPE, |
691 SCRIPT_TYPE, | 692 SCRIPT_TYPE, |
692 TYPE_FEEDBACK_INFO_TYPE, | 693 TYPE_FEEDBACK_INFO_TYPE, |
693 ALIASED_ARGUMENTS_ENTRY_TYPE, | 694 ALIASED_ARGUMENTS_ENTRY_TYPE, |
694 BOX_TYPE, | 695 BOX_TYPE, |
695 PROMISE_CONTAINER_TYPE, | 696 PROMISE_RESOLVE_THENABLE_JOB_INFO_TYPE, |
696 PROMISE_REACTION_JOB_INFO_TYPE, | 697 PROMISE_REACTION_JOB_INFO_TYPE, |
697 DEBUG_INFO_TYPE, | 698 DEBUG_INFO_TYPE, |
698 BREAK_POINT_INFO_TYPE, | 699 BREAK_POINT_INFO_TYPE, |
699 FIXED_ARRAY_TYPE, | 700 FIXED_ARRAY_TYPE, |
700 SHARED_FUNCTION_INFO_TYPE, | 701 SHARED_FUNCTION_INFO_TYPE, |
701 CELL_TYPE, | 702 CELL_TYPE, |
702 WEAK_CELL_TYPE, | 703 WEAK_CELL_TYPE, |
703 TRANSITION_ARRAY_TYPE, | 704 TRANSITION_ARRAY_TYPE, |
704 PROPERTY_CELL_TYPE, | 705 PROPERTY_CELL_TYPE, |
705 PROTOTYPE_INFO_TYPE, | 706 PROTOTYPE_INFO_TYPE, |
(...skipping 5969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6675 // An abstract superclass, a marker class really, for simple structure classes. | 6676 // An abstract superclass, a marker class really, for simple structure classes. |
6676 // It doesn't carry much functionality but allows struct classes to be | 6677 // It doesn't carry much functionality but allows struct classes to be |
6677 // identified in the type system. | 6678 // identified in the type system. |
6678 class Struct: public HeapObject { | 6679 class Struct: public HeapObject { |
6679 public: | 6680 public: |
6680 inline void InitializeBody(int object_size); | 6681 inline void InitializeBody(int object_size); |
6681 DECLARE_CAST(Struct) | 6682 DECLARE_CAST(Struct) |
6682 }; | 6683 }; |
6683 | 6684 |
6684 // A container struct to hold state required for PromiseResolveThenableJob. | 6685 // A container struct to hold state required for PromiseResolveThenableJob. |
6685 // TODO(gsathya): Rename this to be less generic. | 6686 class PromiseResolveThenableJobInfo : public Struct { |
6686 class PromiseContainer : public Struct { | |
6687 public: | 6687 public: |
6688 DECL_ACCESSORS(thenable, JSReceiver) | 6688 DECL_ACCESSORS(thenable, JSReceiver) |
6689 DECL_ACCESSORS(then, JSReceiver) | 6689 DECL_ACCESSORS(then, JSReceiver) |
6690 DECL_ACCESSORS(resolve, JSFunction) | 6690 DECL_ACCESSORS(resolve, JSFunction) |
6691 DECL_ACCESSORS(reject, JSFunction) | 6691 DECL_ACCESSORS(reject, JSFunction) |
6692 DECL_ACCESSORS(before_debug_event, Object) | 6692 DECL_ACCESSORS(before_debug_event, Object) |
6693 DECL_ACCESSORS(after_debug_event, Object) | 6693 DECL_ACCESSORS(after_debug_event, Object) |
6694 | 6694 |
6695 static const int kThenableOffset = Struct::kHeaderSize; | 6695 static const int kThenableOffset = Struct::kHeaderSize; |
6696 static const int kThenOffset = kThenableOffset + kPointerSize; | 6696 static const int kThenOffset = kThenableOffset + kPointerSize; |
6697 static const int kResolveOffset = kThenOffset + kPointerSize; | 6697 static const int kResolveOffset = kThenOffset + kPointerSize; |
6698 static const int kRejectOffset = kResolveOffset + kPointerSize; | 6698 static const int kRejectOffset = kResolveOffset + kPointerSize; |
6699 static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize; | 6699 static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize; |
6700 static const int kAfterDebugEventOffset = | 6700 static const int kAfterDebugEventOffset = |
6701 kBeforeDebugEventOffset + kPointerSize; | 6701 kBeforeDebugEventOffset + kPointerSize; |
6702 static const int kSize = kAfterDebugEventOffset + kPointerSize; | 6702 static const int kSize = kAfterDebugEventOffset + kPointerSize; |
6703 | 6703 |
6704 DECLARE_CAST(PromiseContainer) | 6704 DECLARE_CAST(PromiseResolveThenableJobInfo) |
6705 DECLARE_PRINTER(PromiseContainer) | 6705 DECLARE_PRINTER(PromiseResolveThenableJobInfo) |
6706 DECLARE_VERIFIER(PromiseContainer) | 6706 DECLARE_VERIFIER(PromiseResolveThenableJobInfo) |
6707 | 6707 |
6708 private: | 6708 private: |
6709 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseContainer); | 6709 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseResolveThenableJobInfo); |
6710 }; | 6710 }; |
6711 | 6711 |
6712 // Struct to hold state required for PromiseReactionJob. | 6712 // Struct to hold state required for PromiseReactionJob. |
6713 class PromiseReactionJobInfo : public Struct { | 6713 class PromiseReactionJobInfo : public Struct { |
6714 public: | 6714 public: |
6715 DECL_ACCESSORS(value, Object) | 6715 DECL_ACCESSORS(value, Object) |
6716 DECL_ACCESSORS(tasks, Object) | 6716 DECL_ACCESSORS(tasks, Object) |
6717 DECL_ACCESSORS(deferred, Object) | 6717 DECL_ACCESSORS(deferred, Object) |
6718 DECL_ACCESSORS(before_debug_event, Object) | 6718 DECL_ACCESSORS(before_debug_event, Object) |
6719 DECL_ACCESSORS(after_debug_event, Object) | 6719 DECL_ACCESSORS(after_debug_event, Object) |
(...skipping 4755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11475 } | 11475 } |
11476 return value; | 11476 return value; |
11477 } | 11477 } |
11478 }; | 11478 }; |
11479 | 11479 |
11480 | 11480 |
11481 } // NOLINT, false-positive due to second-order macros. | 11481 } // NOLINT, false-positive due to second-order macros. |
11482 } // NOLINT, false-positive due to second-order macros. | 11482 } // NOLINT, false-positive due to second-order macros. |
11483 | 11483 |
11484 #endif // V8_OBJECTS_H_ | 11484 #endif // V8_OBJECTS_H_ |
OLD | NEW |