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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 V(ACCESS_CHECK_INFO_TYPE) \ | 382 V(ACCESS_CHECK_INFO_TYPE) \ |
383 V(INTERCEPTOR_INFO_TYPE) \ | 383 V(INTERCEPTOR_INFO_TYPE) \ |
384 V(CALL_HANDLER_INFO_TYPE) \ | 384 V(CALL_HANDLER_INFO_TYPE) \ |
385 V(FUNCTION_TEMPLATE_INFO_TYPE) \ | 385 V(FUNCTION_TEMPLATE_INFO_TYPE) \ |
386 V(OBJECT_TEMPLATE_INFO_TYPE) \ | 386 V(OBJECT_TEMPLATE_INFO_TYPE) \ |
387 V(SIGNATURE_INFO_TYPE) \ | 387 V(SIGNATURE_INFO_TYPE) \ |
388 V(TYPE_SWITCH_INFO_TYPE) \ | 388 V(TYPE_SWITCH_INFO_TYPE) \ |
389 V(ALLOCATION_MEMENTO_TYPE) \ | 389 V(ALLOCATION_MEMENTO_TYPE) \ |
390 V(ALLOCATION_SITE_TYPE) \ | 390 V(ALLOCATION_SITE_TYPE) \ |
391 V(SCRIPT_TYPE) \ | 391 V(SCRIPT_TYPE) \ |
| 392 V(STACK_TRACE_FRAME_TYPE) \ |
392 V(TYPE_FEEDBACK_INFO_TYPE) \ | 393 V(TYPE_FEEDBACK_INFO_TYPE) \ |
393 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 394 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
394 V(BOX_TYPE) \ | 395 V(BOX_TYPE) \ |
395 V(PROTOTYPE_INFO_TYPE) \ | 396 V(PROTOTYPE_INFO_TYPE) \ |
396 V(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE) \ | 397 V(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION_TYPE) \ |
397 \ | 398 \ |
398 V(FIXED_ARRAY_TYPE) \ | 399 V(FIXED_ARRAY_TYPE) \ |
399 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 400 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
400 V(SHARED_FUNCTION_INFO_TYPE) \ | 401 V(SHARED_FUNCTION_INFO_TYPE) \ |
401 V(WEAK_CELL_TYPE) \ | 402 V(WEAK_CELL_TYPE) \ |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 #define STRUCT_LIST(V) \ | 498 #define STRUCT_LIST(V) \ |
498 V(BOX, Box, box) \ | 499 V(BOX, Box, box) \ |
499 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ | 500 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \ |
500 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ | 501 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \ |
501 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ | 502 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \ |
502 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ | 503 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \ |
503 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ | 504 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \ |
504 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ | 505 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \ |
505 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ | 506 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \ |
506 V(SCRIPT, Script, script) \ | 507 V(SCRIPT, Script, script) \ |
| 508 V(STACK_TRACE_FRAME, StackTraceFrame, stack_trace_frame) \ |
507 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ | 509 V(ALLOCATION_SITE, AllocationSite, allocation_site) \ |
508 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ | 510 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \ |
509 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ | 511 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \ |
510 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ | 512 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \ |
511 V(DEBUG_INFO, DebugInfo, debug_info) \ | 513 V(DEBUG_INFO, DebugInfo, debug_info) \ |
512 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \ | 514 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info) \ |
513 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \ | 515 V(PROTOTYPE_INFO, PrototypeInfo, prototype_info) \ |
514 V(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION, \ | 516 V(SLOPPY_BLOCK_WITH_EVAL_CONTEXT_EXTENSION, \ |
515 SloppyBlockWithEvalContextExtension, \ | 517 SloppyBlockWithEvalContextExtension, \ |
516 sloppy_block_with_eval_context_extension) | 518 sloppy_block_with_eval_context_extension) |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 ACCESS_CHECK_INFO_TYPE, | 670 ACCESS_CHECK_INFO_TYPE, |
669 INTERCEPTOR_INFO_TYPE, | 671 INTERCEPTOR_INFO_TYPE, |
670 CALL_HANDLER_INFO_TYPE, | 672 CALL_HANDLER_INFO_TYPE, |
671 FUNCTION_TEMPLATE_INFO_TYPE, | 673 FUNCTION_TEMPLATE_INFO_TYPE, |
672 OBJECT_TEMPLATE_INFO_TYPE, | 674 OBJECT_TEMPLATE_INFO_TYPE, |
673 SIGNATURE_INFO_TYPE, | 675 SIGNATURE_INFO_TYPE, |
674 TYPE_SWITCH_INFO_TYPE, | 676 TYPE_SWITCH_INFO_TYPE, |
675 ALLOCATION_SITE_TYPE, | 677 ALLOCATION_SITE_TYPE, |
676 ALLOCATION_MEMENTO_TYPE, | 678 ALLOCATION_MEMENTO_TYPE, |
677 SCRIPT_TYPE, | 679 SCRIPT_TYPE, |
| 680 STACK_TRACE_FRAME_TYPE, |
678 TYPE_FEEDBACK_INFO_TYPE, | 681 TYPE_FEEDBACK_INFO_TYPE, |
679 ALIASED_ARGUMENTS_ENTRY_TYPE, | 682 ALIASED_ARGUMENTS_ENTRY_TYPE, |
680 BOX_TYPE, | 683 BOX_TYPE, |
681 DEBUG_INFO_TYPE, | 684 DEBUG_INFO_TYPE, |
682 BREAK_POINT_INFO_TYPE, | 685 BREAK_POINT_INFO_TYPE, |
683 FIXED_ARRAY_TYPE, | 686 FIXED_ARRAY_TYPE, |
684 SHARED_FUNCTION_INFO_TYPE, | 687 SHARED_FUNCTION_INFO_TYPE, |
685 CELL_TYPE, | 688 CELL_TYPE, |
686 WEAK_CELL_TYPE, | 689 WEAK_CELL_TYPE, |
687 TRANSITION_ARRAY_TYPE, | 690 TRANSITION_ARRAY_TYPE, |
(...skipping 5809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6497 DECLARE_PRINTER(Box) | 6500 DECLARE_PRINTER(Box) |
6498 DECLARE_VERIFIER(Box) | 6501 DECLARE_VERIFIER(Box) |
6499 | 6502 |
6500 static const int kValueOffset = HeapObject::kHeaderSize; | 6503 static const int kValueOffset = HeapObject::kHeaderSize; |
6501 static const int kSize = kValueOffset + kPointerSize; | 6504 static const int kSize = kValueOffset + kPointerSize; |
6502 | 6505 |
6503 private: | 6506 private: |
6504 DISALLOW_IMPLICIT_CONSTRUCTORS(Box); | 6507 DISALLOW_IMPLICIT_CONSTRUCTORS(Box); |
6505 }; | 6508 }; |
6506 | 6509 |
6507 | |
6508 // Container for metadata stored on each prototype map. | 6510 // Container for metadata stored on each prototype map. |
6509 class PrototypeInfo : public Struct { | 6511 class PrototypeInfo : public Struct { |
6510 public: | 6512 public: |
6511 static const int UNREGISTERED = -1; | 6513 static const int UNREGISTERED = -1; |
6512 | 6514 |
6513 // [prototype_users]: WeakFixedArray containing maps using this prototype, | 6515 // [prototype_users]: WeakFixedArray containing maps using this prototype, |
6514 // or Smi(0) if uninitialized. | 6516 // or Smi(0) if uninitialized. |
6515 DECL_ACCESSORS(prototype_users, Object) | 6517 DECL_ACCESSORS(prototype_users, Object) |
6516 | 6518 |
6517 // [object_create_map]: A field caching the map for Object.create(prototype). | 6519 // [object_create_map]: A field caching the map for Object.create(prototype). |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6782 static const int kCompilationStateBit = 1; | 6784 static const int kCompilationStateBit = 1; |
6783 static const int kHideSourceBit = 2; | 6785 static const int kHideSourceBit = 2; |
6784 static const int kOriginOptionsShift = 3; | 6786 static const int kOriginOptionsShift = 3; |
6785 static const int kOriginOptionsSize = 3; | 6787 static const int kOriginOptionsSize = 3; |
6786 static const int kOriginOptionsMask = ((1 << kOriginOptionsSize) - 1) | 6788 static const int kOriginOptionsMask = ((1 << kOriginOptionsSize) - 1) |
6787 << kOriginOptionsShift; | 6789 << kOriginOptionsShift; |
6788 | 6790 |
6789 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); | 6791 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); |
6790 }; | 6792 }; |
6791 | 6793 |
| 6794 class StackTraceFrame : public Struct { |
| 6795 public: |
| 6796 // --- Fields for JS and Wasm frames. --- |
| 6797 |
| 6798 static const int kIsWasmFrame = 1 << 0; |
| 6799 static const int kForceConstructor = 1 << 1; |
| 6800 static const int kIsStrict = 1 << 2; |
| 6801 |
| 6802 // [flags] |
| 6803 DECL_INT_ACCESSORS(flags) |
| 6804 |
| 6805 // [abstract_code] |
| 6806 DECL_ACCESSORS(abstract_code, AbstractCode) |
| 6807 |
| 6808 // [offset] |
| 6809 DECL_INT_ACCESSORS(offset) |
| 6810 |
| 6811 // --- Fields for JS frames. --- |
| 6812 |
| 6813 // [receiver] |
| 6814 DECL_ACCESSORS(receiver, Object) |
| 6815 |
| 6816 // [function] |
| 6817 DECL_ACCESSORS(function, JSFunction) |
| 6818 |
| 6819 // --- Fields for Wasm frames. --- |
| 6820 |
| 6821 // [wasm_object] |
| 6822 DECL_ACCESSORS(wasm_object, Object) |
| 6823 |
| 6824 // [wasm_function_index] |
| 6825 DECL_INT_ACCESSORS(wasm_function_index) |
| 6826 |
| 6827 inline bool IsWasmFrame() const; |
| 6828 inline bool IsJavaScriptFrame() const; |
| 6829 inline bool IsStrict() const; |
| 6830 inline bool ForceConstructor() const; |
| 6831 |
| 6832 Handle<Object> GetFileName(); |
| 6833 Handle<Object> GetFunctionName(); |
| 6834 Handle<Object> GetScriptNameOrSourceUrl(); |
| 6835 Handle<Object> GetMethodName(); |
| 6836 Handle<Object> GetTypeName(); |
| 6837 Handle<Object> GetEvalOrigin(); |
| 6838 |
| 6839 int GetPosition(); |
| 6840 // Return 1-based line number, including line offset. |
| 6841 int GetLineNumber(); |
| 6842 // Return 1-based column number, including column offset if first line. |
| 6843 int GetColumnNumber(); |
| 6844 |
| 6845 bool IsNative(); |
| 6846 bool IsToplevel(); |
| 6847 bool IsEval(); |
| 6848 bool IsConstructor(); |
| 6849 |
| 6850 Handle<String> ToString(); |
| 6851 |
| 6852 DECLARE_CAST(StackTraceFrame) |
| 6853 |
| 6854 // Dispatched behavior. |
| 6855 DECLARE_PRINTER(StackTraceFrame) |
| 6856 DECLARE_VERIFIER(StackTraceFrame) |
| 6857 |
| 6858 // Fields for all frame types. |
| 6859 static const int kFlagsOffset = HeapObject::kHeaderSize; |
| 6860 static const int kAbstractCodeOffset = kFlagsOffset + kPointerSize; |
| 6861 static const int kOffsetOffset = kAbstractCodeOffset + kPointerSize; |
| 6862 |
| 6863 // Fields for JS frames. |
| 6864 static const int kReceiverOffset = kOffsetOffset + kPointerSize; |
| 6865 static const int kFunctionOffset = kReceiverOffset + kPointerSize; |
| 6866 |
| 6867 // Fields for Wasm frames. |
| 6868 static const int kWasmObjectOffset = kOffsetOffset + kPointerSize; |
| 6869 static const int kWasmFunctionIndexOffset = kWasmObjectOffset + kPointerSize; |
| 6870 |
| 6871 static const int kSize = kFunctionOffset + kPointerSize; |
| 6872 |
| 6873 private: |
| 6874 DISALLOW_IMPLICIT_CONSTRUCTORS(StackTraceFrame); |
| 6875 }; |
6792 | 6876 |
6793 // List of builtin functions we want to identify to improve code | 6877 // List of builtin functions we want to identify to improve code |
6794 // generation. | 6878 // generation. |
6795 // | 6879 // |
6796 // Each entry has a name of a global object property holding an object | 6880 // Each entry has a name of a global object property holding an object |
6797 // optionally followed by ".prototype", a name of a builtin function | 6881 // optionally followed by ".prototype", a name of a builtin function |
6798 // on the object (the one the id is set for), and a label. | 6882 // on the object (the one the id is set for), and a label. |
6799 // | 6883 // |
6800 // Installation of ids for the selected builtin functions is handled | 6884 // Installation of ids for the selected builtin functions is handled |
6801 // by the bootstrapper. | 6885 // by the bootstrapper. |
(...skipping 4298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11100 } | 11184 } |
11101 return value; | 11185 return value; |
11102 } | 11186 } |
11103 }; | 11187 }; |
11104 | 11188 |
11105 | 11189 |
11106 } // NOLINT, false-positive due to second-order macros. | 11190 } // NOLINT, false-positive due to second-order macros. |
11107 } // NOLINT, false-positive due to second-order macros. | 11191 } // NOLINT, false-positive due to second-order macros. |
11108 | 11192 |
11109 #endif // V8_OBJECTS_H_ | 11193 #endif // V8_OBJECTS_H_ |
OLD | NEW |