| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 V(FUNCTION_TEMPLATE_INFO_TYPE) \ | 389 V(FUNCTION_TEMPLATE_INFO_TYPE) \ |
| 390 V(OBJECT_TEMPLATE_INFO_TYPE) \ | 390 V(OBJECT_TEMPLATE_INFO_TYPE) \ |
| 391 V(SIGNATURE_INFO_TYPE) \ | 391 V(SIGNATURE_INFO_TYPE) \ |
| 392 V(TYPE_SWITCH_INFO_TYPE) \ | 392 V(TYPE_SWITCH_INFO_TYPE) \ |
| 393 V(ALLOCATION_MEMENTO_TYPE) \ | 393 V(ALLOCATION_MEMENTO_TYPE) \ |
| 394 V(ALLOCATION_SITE_TYPE) \ | 394 V(ALLOCATION_SITE_TYPE) \ |
| 395 V(SCRIPT_TYPE) \ | 395 V(SCRIPT_TYPE) \ |
| 396 V(TYPE_FEEDBACK_INFO_TYPE) \ | 396 V(TYPE_FEEDBACK_INFO_TYPE) \ |
| 397 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 397 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
| 398 V(BOX_TYPE) \ | 398 V(BOX_TYPE) \ |
| 399 V(PROMISE_CONTAINER_TYPE) \ |
| 399 V(PROTOTYPE_INFO_TYPE) \ | 400 V(PROTOTYPE_INFO_TYPE) \ |
| 400 V(CONTEXT_EXTENSION_TYPE) \ | 401 V(CONTEXT_EXTENSION_TYPE) \ |
| 401 V(MODULE_TYPE) \ | 402 V(MODULE_TYPE) \ |
| 402 \ | 403 \ |
| 403 V(FIXED_ARRAY_TYPE) \ | 404 V(FIXED_ARRAY_TYPE) \ |
| 404 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 405 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
| 405 V(SHARED_FUNCTION_INFO_TYPE) \ | 406 V(SHARED_FUNCTION_INFO_TYPE) \ |
| 406 V(WEAK_CELL_TYPE) \ | 407 V(WEAK_CELL_TYPE) \ |
| 407 V(TRANSITION_ARRAY_TYPE) \ | 408 V(TRANSITION_ARRAY_TYPE) \ |
| 408 \ | 409 \ |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 // object type in this causes the compiler to generate most of the boilerplate | 494 // object type in this causes the compiler to generate most of the boilerplate |
| 494 // code for the class including allocation and garbage collection routines, | 495 // code for the class including allocation and garbage collection routines, |
| 495 // casts and predicates. All you need to define is the class, methods and | 496 // casts and predicates. All you need to define is the class, methods and |
| 496 // object verification routines. Easy, no? | 497 // object verification routines. Easy, no? |
| 497 // | 498 // |
| 498 // Note that for subtle reasons related to the ordering or numerical values of | 499 // Note that for subtle reasons related to the ordering or numerical values of |
| 499 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST | 500 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST |
| 500 // manually. | 501 // manually. |
| 501 #define STRUCT_LIST(V) \ | 502 #define STRUCT_LIST(V) \ |
| 502 V(BOX, Box, box) \ | 503 V(BOX, Box, box) \ |
| 504 V(PROMISE_CONTAINER, PromiseContainer, promise_container) \ |
| 503 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ | 505 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ |
| 504 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ | 506 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ |
| 505 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ | 507 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ |
| 506 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ | 508 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ |
| 507 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ | 509 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ |
| 508 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 510 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
| 509 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 511 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
| 510 V(SCRIPT, Script, script) \ | 512 V(SCRIPT, Script, script) \ |
| 511 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ | 513 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ |
| 512 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ | 514 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 FUNCTION_TEMPLATE_INFO_TYPE, | 676 FUNCTION_TEMPLATE_INFO_TYPE, |
| 675 OBJECT_TEMPLATE_INFO_TYPE, | 677 OBJECT_TEMPLATE_INFO_TYPE, |
| 676 SIGNATURE_INFO_TYPE, | 678 SIGNATURE_INFO_TYPE, |
| 677 TYPE_SWITCH_INFO_TYPE, | 679 TYPE_SWITCH_INFO_TYPE, |
| 678 ALLOCATION_SITE_TYPE, | 680 ALLOCATION_SITE_TYPE, |
| 679 ALLOCATION_MEMENTO_TYPE, | 681 ALLOCATION_MEMENTO_TYPE, |
| 680 SCRIPT_TYPE, | 682 SCRIPT_TYPE, |
| 681 TYPE_FEEDBACK_INFO_TYPE, | 683 TYPE_FEEDBACK_INFO_TYPE, |
| 682 ALIASED_ARGUMENTS_ENTRY_TYPE, | 684 ALIASED_ARGUMENTS_ENTRY_TYPE, |
| 683 BOX_TYPE, | 685 BOX_TYPE, |
| 686 PROMISE_CONTAINER_TYPE, |
| 684 DEBUG_INFO_TYPE, | 687 DEBUG_INFO_TYPE, |
| 685 BREAK_POINT_INFO_TYPE, | 688 BREAK_POINT_INFO_TYPE, |
| 686 FIXED_ARRAY_TYPE, | 689 FIXED_ARRAY_TYPE, |
| 687 SHARED_FUNCTION_INFO_TYPE, | 690 SHARED_FUNCTION_INFO_TYPE, |
| 688 CELL_TYPE, | 691 CELL_TYPE, |
| 689 WEAK_CELL_TYPE, | 692 WEAK_CELL_TYPE, |
| 690 TRANSITION_ARRAY_TYPE, | 693 TRANSITION_ARRAY_TYPE, |
| 691 PROPERTY_CELL_TYPE, | 694 PROPERTY_CELL_TYPE, |
| 692 PROTOTYPE_INFO_TYPE, | 695 PROTOTYPE_INFO_TYPE, |
| 693 CONTEXT_EXTENSION_TYPE, | 696 CONTEXT_EXTENSION_TYPE, |
| (...skipping 5933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6627 | 6630 |
| 6628 // An abstract superclass, a marker class really, for simple structure classes. | 6631 // An abstract superclass, a marker class really, for simple structure classes. |
| 6629 // It doesn't carry much functionality but allows struct classes to be | 6632 // It doesn't carry much functionality but allows struct classes to be |
| 6630 // identified in the type system. | 6633 // identified in the type system. |
| 6631 class Struct: public HeapObject { | 6634 class Struct: public HeapObject { |
| 6632 public: | 6635 public: |
| 6633 inline void InitializeBody(int object_size); | 6636 inline void InitializeBody(int object_size); |
| 6634 DECLARE_CAST(Struct) | 6637 DECLARE_CAST(Struct) |
| 6635 }; | 6638 }; |
| 6636 | 6639 |
| 6640 // A container struct to hold state required for |
| 6641 // PromiseResolveThenableJob. {before, after}_debug_event could |
| 6642 // potentially be undefined if the debugger is turned off. |
| 6643 class PromiseContainer : public Struct { |
| 6644 public: |
| 6645 DECL_ACCESSORS(thenable, JSReceiver) |
| 6646 DECL_ACCESSORS(then, JSFunction) |
| 6647 DECL_ACCESSORS(resolve, JSFunction) |
| 6648 DECL_ACCESSORS(reject, JSFunction) |
| 6649 DECL_ACCESSORS(before_debug_event, Object) |
| 6650 DECL_ACCESSORS(after_debug_event, Object) |
| 6651 |
| 6652 static const int kThenableOffset = Struct::kHeaderSize; |
| 6653 static const int kThenOffset = kThenableOffset + kPointerSize; |
| 6654 static const int kResolveOffset = kThenOffset + kPointerSize; |
| 6655 static const int kRejectOffset = kResolveOffset + kPointerSize; |
| 6656 static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize; |
| 6657 static const int kAfterDebugEventOffset = |
| 6658 kBeforeDebugEventOffset + kPointerSize; |
| 6659 static const int kSize = kAfterDebugEventOffset + kPointerSize; |
| 6660 |
| 6661 DECLARE_CAST(PromiseContainer) |
| 6662 DECLARE_PRINTER(PromiseContainer) |
| 6663 DECLARE_VERIFIER(PromiseContainer) |
| 6664 |
| 6665 private: |
| 6666 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseContainer); |
| 6667 }; |
| 6637 | 6668 |
| 6638 // A simple one-element struct, useful where smis need to be boxed. | 6669 // A simple one-element struct, useful where smis need to be boxed. |
| 6639 class Box : public Struct { | 6670 class Box : public Struct { |
| 6640 public: | 6671 public: |
| 6641 // [value]: the boxed contents. | 6672 // [value]: the boxed contents. |
| 6642 DECL_ACCESSORS(value, Object) | 6673 DECL_ACCESSORS(value, Object) |
| 6643 | 6674 |
| 6644 DECLARE_CAST(Box) | 6675 DECLARE_CAST(Box) |
| 6645 | 6676 |
| 6646 // Dispatched behavior. | 6677 // Dispatched behavior. |
| (...skipping 4658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11305 } | 11336 } |
| 11306 return value; | 11337 return value; |
| 11307 } | 11338 } |
| 11308 }; | 11339 }; |
| 11309 | 11340 |
| 11310 | 11341 |
| 11311 } // NOLINT, false-positive due to second-order macros. | 11342 } // NOLINT, false-positive due to second-order macros. |
| 11312 } // NOLINT, false-positive due to second-order macros. | 11343 } // NOLINT, false-positive due to second-order macros. |
| 11313 | 11344 |
| 11314 #endif // V8_OBJECTS_H_ | 11345 #endif // V8_OBJECTS_H_ |
| OLD | NEW |