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 10852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10863 : public BitField<int, IsImmutablePrototype::kNext, 29> {}; | 10863 : public BitField<int, IsImmutablePrototype::kNext, 29> {}; |
10864 }; | 10864 }; |
10865 | 10865 |
10866 | 10866 |
10867 // The DebugInfo class holds additional information for a function being | 10867 // The DebugInfo class holds additional information for a function being |
10868 // debugged. | 10868 // debugged. |
10869 class DebugInfo: public Struct { | 10869 class DebugInfo: public Struct { |
10870 public: | 10870 public: |
10871 // The shared function info for the source being debugged. | 10871 // The shared function info for the source being debugged. |
10872 DECL_ACCESSORS(shared, SharedFunctionInfo) | 10872 DECL_ACCESSORS(shared, SharedFunctionInfo) |
10873 // Code object for the patched code. This code object is the code object | 10873 |
10874 // currently active for the function. | 10874 DECL_ACCESSORS(debug_bytecode_array, Object) |
10875 DECL_ACCESSORS(abstract_code, AbstractCode) | |
10876 // Fixed array holding status information for each active break point. | 10875 // Fixed array holding status information for each active break point. |
10877 DECL_ACCESSORS(break_points, FixedArray) | 10876 DECL_ACCESSORS(break_points, FixedArray) |
10878 | 10877 |
10879 // Check if there is a break point at a source position. | 10878 // Check if there is a break point at a source position. |
10880 bool HasBreakPoint(int source_position); | 10879 bool HasBreakPoint(int source_position); |
10881 // Clear a break point. | 10880 // Attempt to clear a break point. Return true if successful. |
10882 static void ClearBreakPoint(Handle<DebugInfo> debug_info, int source_position, | 10881 static bool ClearBreakPoint(Handle<DebugInfo> debug_info, |
10883 Handle<Object> break_point_object); | 10882 Handle<Object> break_point_object); |
10884 // Set a break point. | 10883 // Set a break point. |
10885 static void SetBreakPoint(Handle<DebugInfo> debug_info, int source_position, | 10884 static void SetBreakPoint(Handle<DebugInfo> debug_info, int source_position, |
10886 int statement_position, | |
10887 Handle<Object> break_point_object); | 10885 Handle<Object> break_point_object); |
10888 // Get the break point objects for a source position. | 10886 // Get the break point objects for a source position. |
10889 Handle<Object> GetBreakPointObjects(int source_position); | 10887 Handle<Object> GetBreakPointObjects(int source_position); |
10890 // Find the break point info holding this break point object. | 10888 // Find the break point info holding this break point object. |
10891 static Handle<Object> FindBreakPointInfo(Handle<DebugInfo> debug_info, | 10889 static Handle<Object> FindBreakPointInfo(Handle<DebugInfo> debug_info, |
10892 Handle<Object> break_point_object); | 10890 Handle<Object> break_point_object); |
10893 // Get the number of break points for this function. | 10891 // Get the number of break points for this function. |
10894 int GetBreakPointCount(); | 10892 int GetBreakPointCount(); |
10895 | 10893 |
10896 static Smi* uninitialized() { return Smi::FromInt(0); } | 10894 static Smi* uninitialized() { return Smi::FromInt(0); } |
10897 | 10895 |
10898 inline BytecodeArray* original_bytecode_array(); | 10896 inline bool HasDebugBytecodeArray(); |
10897 inline bool HasDebugCode(); | |
10898 | |
10899 inline BytecodeArray* OriginalBytecodeArray(); | |
10900 inline BytecodeArray* DebugBytecodeArray(); | |
10901 inline Code* DebugCode(); | |
10899 | 10902 |
10900 DECLARE_CAST(DebugInfo) | 10903 DECLARE_CAST(DebugInfo) |
10901 | 10904 |
10902 // Dispatched behavior. | 10905 // Dispatched behavior. |
10903 DECLARE_PRINTER(DebugInfo) | 10906 DECLARE_PRINTER(DebugInfo) |
10904 DECLARE_VERIFIER(DebugInfo) | 10907 DECLARE_VERIFIER(DebugInfo) |
10905 | 10908 |
10906 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; | 10909 static const int kSharedFunctionInfoIndex = Struct::kHeaderSize; |
10910 static const int kDebugBytecodeArrayIndex = | |
10911 kSharedFunctionInfoIndex + kPointerSize; | |
10912 static const int kBreakPointsStateIndex = | |
10913 kDebugBytecodeArrayIndex + kPointerSize; | |
10914 static const int kSize = kBreakPointsStateIndex + kPointerSize; | |
10915 | |
10907 static const int kAbstractCodeIndex = kSharedFunctionInfoIndex + kPointerSize; | 10916 static const int kAbstractCodeIndex = kSharedFunctionInfoIndex + kPointerSize; |
jgruber
2016/08/11 14:28:13
Is this still used anywhere?
Yang
2016/08/12 05:33:46
Good catch. Removed.
| |
10908 static const int kBreakPointsStateIndex = kAbstractCodeIndex + kPointerSize; | |
10909 static const int kSize = kBreakPointsStateIndex + kPointerSize; | |
10910 | 10917 |
10911 static const int kEstimatedNofBreakPointsInFunction = 16; | 10918 static const int kEstimatedNofBreakPointsInFunction = 16; |
10912 | 10919 |
10913 private: | 10920 private: |
10914 // Get the break point info object for a source position. | 10921 // Get the break point info object for a source position. |
10915 Object* GetBreakPointInfo(int source_position); | 10922 Object* GetBreakPointInfo(int source_position); |
10916 | 10923 |
10917 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo); | 10924 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo); |
10918 }; | 10925 }; |
10919 | 10926 |
(...skipping 13 matching lines...) Expand all Loading... | |
10933 Handle<Object> break_point_object); | 10940 Handle<Object> break_point_object); |
10934 // Set a break point. | 10941 // Set a break point. |
10935 static void SetBreakPoint(Handle<BreakPointInfo> info, | 10942 static void SetBreakPoint(Handle<BreakPointInfo> info, |
10936 Handle<Object> break_point_object); | 10943 Handle<Object> break_point_object); |
10937 // Check if break point info has this break point object. | 10944 // Check if break point info has this break point object. |
10938 static bool HasBreakPointObject(Handle<BreakPointInfo> info, | 10945 static bool HasBreakPointObject(Handle<BreakPointInfo> info, |
10939 Handle<Object> break_point_object); | 10946 Handle<Object> break_point_object); |
10940 // Get the number of break points for this code offset. | 10947 // Get the number of break points for this code offset. |
10941 int GetBreakPointCount(); | 10948 int GetBreakPointCount(); |
10942 | 10949 |
10950 int GetStatementPosition(Handle<DebugInfo> debug_info); | |
10951 | |
10943 DECLARE_CAST(BreakPointInfo) | 10952 DECLARE_CAST(BreakPointInfo) |
10944 | 10953 |
10945 // Dispatched behavior. | 10954 // Dispatched behavior. |
10946 DECLARE_PRINTER(BreakPointInfo) | 10955 DECLARE_PRINTER(BreakPointInfo) |
10947 DECLARE_VERIFIER(BreakPointInfo) | 10956 DECLARE_VERIFIER(BreakPointInfo) |
10948 | 10957 |
10949 static const int kSourcePositionIndex = Struct::kHeaderSize; | 10958 static const int kSourcePositionIndex = Struct::kHeaderSize; |
10950 static const int kBreakPointObjectsIndex = | 10959 static const int kBreakPointObjectsIndex = |
10951 kSourcePositionIndex + kPointerSize; | 10960 kSourcePositionIndex + kPointerSize; |
10952 static const int kSize = kBreakPointObjectsIndex + kPointerSize; | 10961 static const int kSize = kBreakPointObjectsIndex + kPointerSize; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11074 } | 11083 } |
11075 return value; | 11084 return value; |
11076 } | 11085 } |
11077 }; | 11086 }; |
11078 | 11087 |
11079 | 11088 |
11080 } // NOLINT, false-positive due to second-order macros. | 11089 } // NOLINT, false-positive due to second-order macros. |
11081 } // NOLINT, false-positive due to second-order macros. | 11090 } // NOLINT, false-positive due to second-order macros. |
11082 | 11091 |
11083 #endif // V8_OBJECTS_H_ | 11092 #endif // V8_OBJECTS_H_ |
OLD | NEW |