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