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 10848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10859 class DebugInfo: public Struct { | 10859 class DebugInfo: public Struct { |
10860 public: | 10860 public: |
10861 // The shared function info for the source being debugged. | 10861 // The shared function info for the source being debugged. |
10862 DECL_ACCESSORS(shared, SharedFunctionInfo) | 10862 DECL_ACCESSORS(shared, SharedFunctionInfo) |
10863 // Code object for the patched code. This code object is the code object | 10863 // Code object for the patched code. This code object is the code object |
10864 // currently active for the function. | 10864 // currently active for the function. |
10865 DECL_ACCESSORS(abstract_code, AbstractCode) | 10865 DECL_ACCESSORS(abstract_code, AbstractCode) |
10866 // Fixed array holding status information for each active break point. | 10866 // Fixed array holding status information for each active break point. |
10867 DECL_ACCESSORS(break_points, FixedArray) | 10867 DECL_ACCESSORS(break_points, FixedArray) |
10868 | 10868 |
10869 // Check if there is a break point at a code offset. | 10869 // Check if there is a break point at a source position. |
10870 bool HasBreakPoint(int code_offset); | 10870 bool HasBreakPoint(int source_position); |
10871 // Get the break point info object for a code offset. | |
10872 Object* GetBreakPointInfo(int code_offset); | |
10873 // Clear a break point. | 10871 // Clear a break point. |
10874 static void ClearBreakPoint(Handle<DebugInfo> debug_info, int code_offset, | 10872 static void ClearBreakPoint(Handle<DebugInfo> debug_info, int source_position, |
10875 Handle<Object> break_point_object); | 10873 Handle<Object> break_point_object); |
10876 // Set a break point. | 10874 // Set a break point. |
10877 static void SetBreakPoint(Handle<DebugInfo> debug_info, int code_offset, | 10875 static void SetBreakPoint(Handle<DebugInfo> debug_info, int source_position, |
10878 int source_position, int statement_position, | 10876 int statement_position, |
10879 Handle<Object> break_point_object); | 10877 Handle<Object> break_point_object); |
10880 // Get the break point objects for a code offset. | 10878 // Get the break point objects for a source position. |
10881 Handle<Object> GetBreakPointObjects(int code_offset); | 10879 Handle<Object> GetBreakPointObjects(int source_position); |
10882 // Find the break point info holding this break point object. | 10880 // Find the break point info holding this break point object. |
10883 static Handle<Object> FindBreakPointInfo(Handle<DebugInfo> debug_info, | 10881 static Handle<Object> FindBreakPointInfo(Handle<DebugInfo> debug_info, |
10884 Handle<Object> break_point_object); | 10882 Handle<Object> break_point_object); |
10885 // Get the number of break points for this function. | 10883 // Get the number of break points for this function. |
10886 int GetBreakPointCount(); | 10884 int GetBreakPointCount(); |
10887 | 10885 |
10888 static Smi* uninitialized() { return Smi::FromInt(0); } | 10886 static Smi* uninitialized() { return Smi::FromInt(0); } |
10889 | 10887 |
10890 inline BytecodeArray* original_bytecode_array(); | 10888 inline BytecodeArray* original_bytecode_array(); |
10891 | 10889 |
10892 DECLARE_CAST(DebugInfo) | 10890 DECLARE_CAST(DebugInfo) |
10893 | 10891 |
10894 // Dispatched behavior. | 10892 // Dispatched behavior. |
10895 DECLARE_PRINTER(DebugInfo) | 10893 DECLARE_PRINTER(DebugInfo) |
10896 DECLARE_VERIFIER(DebugInfo) | 10894 DECLARE_VERIFIER(DebugInfo) |
10897 | 10895 |
10898 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; | 10896 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; |
10899 static const int kAbstractCodeIndex = kSharedFunctionInfoIndex + kPointerSize; | 10897 static const int kAbstractCodeIndex = kSharedFunctionInfoIndex + kPointerSize; |
10900 static const int kBreakPointsStateIndex = kAbstractCodeIndex + kPointerSize; | 10898 static const int kBreakPointsStateIndex = kAbstractCodeIndex + kPointerSize; |
10901 static const int kSize = kBreakPointsStateIndex + kPointerSize; | 10899 static const int kSize = kBreakPointsStateIndex + kPointerSize; |
10902 | 10900 |
10903 static const int kEstimatedNofBreakPointsInFunction = 16; | 10901 static const int kEstimatedNofBreakPointsInFunction = 16; |
10904 | 10902 |
10905 private: | 10903 private: |
10906 static const int kNoBreakPointInfo = -1; | 10904 // Get the break point info object for a source position. |
10907 | 10905 Object* GetBreakPointInfo(int source_position); |
10908 // Lookup the index in the break_points array for a code offset. | |
10909 int GetBreakPointInfoIndex(int code_offset); | |
10910 | 10906 |
10911 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo); | 10907 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo); |
10912 }; | 10908 }; |
10913 | 10909 |
10914 | 10910 |
10915 // The BreakPointInfo class holds information for break points set in a | 10911 // The BreakPointInfo class holds information for break points set in a |
10916 // function. The DebugInfo object holds a BreakPointInfo object for each code | 10912 // function. The DebugInfo object holds a BreakPointInfo object for each code |
10917 // position with one or more break points. | 10913 // position with one or more break points. |
10918 class BreakPointInfo: public Struct { | 10914 class BreakPointInfo: public Struct { |
10919 public: | 10915 public: |
10920 // The code offset for the break point. | |
10921 DECL_INT_ACCESSORS(code_offset) | |
10922 // The position in the source for the break position. | 10916 // The position in the source for the break position. |
10923 DECL_INT_ACCESSORS(source_position) | 10917 DECL_INT_ACCESSORS(source_position) |
10924 // The position in the source for the last statement before this break | |
10925 // position. | |
10926 DECL_INT_ACCESSORS(statement_position) | |
10927 // List of related JavaScript break points. | 10918 // List of related JavaScript break points. |
10928 DECL_ACCESSORS(break_point_objects, Object) | 10919 DECL_ACCESSORS(break_point_objects, Object) |
10929 | 10920 |
10930 // Removes a break point. | 10921 // Removes a break point. |
10931 static void ClearBreakPoint(Handle<BreakPointInfo> info, | 10922 static void ClearBreakPoint(Handle<BreakPointInfo> info, |
10932 Handle<Object> break_point_object); | 10923 Handle<Object> break_point_object); |
10933 // Set a break point. | 10924 // Set a break point. |
10934 static void SetBreakPoint(Handle<BreakPointInfo> info, | 10925 static void SetBreakPoint(Handle<BreakPointInfo> info, |
10935 Handle<Object> break_point_object); | 10926 Handle<Object> break_point_object); |
10936 // Check if break point info has this break point object. | 10927 // Check if break point info has this break point object. |
10937 static bool HasBreakPointObject(Handle<BreakPointInfo> info, | 10928 static bool HasBreakPointObject(Handle<BreakPointInfo> info, |
10938 Handle<Object> break_point_object); | 10929 Handle<Object> break_point_object); |
10939 // Get the number of break points for this code offset. | 10930 // Get the number of break points for this code offset. |
10940 int GetBreakPointCount(); | 10931 int GetBreakPointCount(); |
10941 | 10932 |
10942 DECLARE_CAST(BreakPointInfo) | 10933 DECLARE_CAST(BreakPointInfo) |
10943 | 10934 |
10944 // Dispatched behavior. | 10935 // Dispatched behavior. |
10945 DECLARE_PRINTER(BreakPointInfo) | 10936 DECLARE_PRINTER(BreakPointInfo) |
10946 DECLARE_VERIFIER(BreakPointInfo) | 10937 DECLARE_VERIFIER(BreakPointInfo) |
10947 | 10938 |
10948 static const int kCodeOffsetIndex = Struct::kHeaderSize; | 10939 static const int kSourcePositionIndex = Struct::kHeaderSize; |
10949 static const int kSourcePositionIndex = kCodeOffsetIndex + kPointerSize; | 10940 static const int kBreakPointObjectsIndex = |
10950 static const int kStatementPositionIndex = | |
10951 kSourcePositionIndex + kPointerSize; | 10941 kSourcePositionIndex + kPointerSize; |
10952 static const int kBreakPointObjectsIndex = | |
10953 kStatementPositionIndex + kPointerSize; | |
10954 static const int kSize = kBreakPointObjectsIndex + kPointerSize; | 10942 static const int kSize = kBreakPointObjectsIndex + kPointerSize; |
10955 | 10943 |
10956 private: | 10944 private: |
10957 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo); | 10945 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo); |
10958 }; | 10946 }; |
10959 | 10947 |
10960 | 10948 |
10961 #undef DECL_BOOLEAN_ACCESSORS | 10949 #undef DECL_BOOLEAN_ACCESSORS |
10962 #undef DECL_ACCESSORS | 10950 #undef DECL_ACCESSORS |
10963 #undef DECLARE_CAST | 10951 #undef DECLARE_CAST |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11076 } | 11064 } |
11077 return value; | 11065 return value; |
11078 } | 11066 } |
11079 }; | 11067 }; |
11080 | 11068 |
11081 | 11069 |
11082 } // NOLINT, false-positive due to second-order macros. | 11070 } // NOLINT, false-positive due to second-order macros. |
11083 } // NOLINT, false-positive due to second-order macros. | 11071 } // NOLINT, false-positive due to second-order macros. |
11084 | 11072 |
11085 #endif // V8_OBJECTS_H_ | 11073 #endif // V8_OBJECTS_H_ |
OLD | NEW |