| 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 5939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6633 | 6636 |
| 6634 // An abstract superclass, a marker class really, for simple structure classes. | 6637 // An abstract superclass, a marker class really, for simple structure classes. |
| 6635 // It doesn't carry much functionality but allows struct classes to be | 6638 // It doesn't carry much functionality but allows struct classes to be |
| 6636 // identified in the type system. | 6639 // identified in the type system. |
| 6637 class Struct: public HeapObject { | 6640 class Struct: public HeapObject { |
| 6638 public: | 6641 public: |
| 6639 inline void InitializeBody(int object_size); | 6642 inline void InitializeBody(int object_size); |
| 6640 DECLARE_CAST(Struct) | 6643 DECLARE_CAST(Struct) |
| 6641 }; | 6644 }; |
| 6642 | 6645 |
| 6646 // A container struct to hold state required for |
| 6647 // PromiseResolveThenableJob. {before, after}_debug_event could |
| 6648 // potentially be undefined if the debugger is turned off. |
| 6649 class PromiseContainer : public Struct { |
| 6650 public: |
| 6651 DECL_ACCESSORS(thenable, JSReceiver) |
| 6652 DECL_ACCESSORS(then, JSFunction) |
| 6653 DECL_ACCESSORS(resolve, JSFunction) |
| 6654 DECL_ACCESSORS(reject, JSFunction) |
| 6655 DECL_ACCESSORS(before_debug_event, Object) |
| 6656 DECL_ACCESSORS(after_debug_event, Object) |
| 6657 |
| 6658 static const int kThenableOffset = Struct::kHeaderSize; |
| 6659 static const int kThenOffset = kThenableOffset + kPointerSize; |
| 6660 static const int kResolveOffset = kThenOffset + kPointerSize; |
| 6661 static const int kRejectOffset = kResolveOffset + kPointerSize; |
| 6662 static const int kBeforeDebugEventOffset = kRejectOffset + kPointerSize; |
| 6663 static const int kAfterDebugEventOffset = |
| 6664 kBeforeDebugEventOffset + kPointerSize; |
| 6665 static const int kSize = kAfterDebugEventOffset + kPointerSize; |
| 6666 |
| 6667 DECLARE_CAST(PromiseContainer) |
| 6668 DECLARE_PRINTER(PromiseContainer) |
| 6669 DECLARE_VERIFIER(PromiseContainer) |
| 6670 |
| 6671 private: |
| 6672 DISALLOW_IMPLICIT_CONSTRUCTORS(PromiseContainer); |
| 6673 }; |
| 6643 | 6674 |
| 6644 // A simple one-element struct, useful where smis need to be boxed. | 6675 // A simple one-element struct, useful where smis need to be boxed. |
| 6645 class Box : public Struct { | 6676 class Box : public Struct { |
| 6646 public: | 6677 public: |
| 6647 // [value]: the boxed contents. | 6678 // [value]: the boxed contents. |
| 6648 DECL_ACCESSORS(value, Object) | 6679 DECL_ACCESSORS(value, Object) |
| 6649 | 6680 |
| 6650 DECLARE_CAST(Box) | 6681 DECLARE_CAST(Box) |
| 6651 | 6682 |
| 6652 // Dispatched behavior. | 6683 // Dispatched behavior. |
| (...skipping 4669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11322 } | 11353 } |
| 11323 return value; | 11354 return value; |
| 11324 } | 11355 } |
| 11325 }; | 11356 }; |
| 11326 | 11357 |
| 11327 | 11358 |
| 11328 } // NOLINT, false-positive due to second-order macros. | 11359 } // NOLINT, false-positive due to second-order macros. |
| 11329 } // NOLINT, false-positive due to second-order macros. | 11360 } // NOLINT, false-positive due to second-order macros. |
| 11330 | 11361 |
| 11331 #endif // V8_OBJECTS_H_ | 11362 #endif // V8_OBJECTS_H_ |
| OLD | NEW |