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; |
10907 static const int kAbstractCodeIndex = kSharedFunctionInfoIndex + kPointerSize; | 10910 static const int kDebugBytecodeArrayIndex = |
10908 static const int kBreakPointsStateIndex = kAbstractCodeIndex + kPointerSize; | 10911 kSharedFunctionInfoIndex + kPointerSize; |
| 10912 static const int kBreakPointsStateIndex = |
| 10913 kDebugBytecodeArrayIndex + kPointerSize; |
10909 static const int kSize = kBreakPointsStateIndex + kPointerSize; | 10914 static const int kSize = kBreakPointsStateIndex + kPointerSize; |
10910 | 10915 |
10911 static const int kEstimatedNofBreakPointsInFunction = 16; | 10916 static const int kEstimatedNofBreakPointsInFunction = 4; |
10912 | 10917 |
10913 private: | 10918 private: |
10914 // Get the break point info object for a source position. | 10919 // Get the break point info object for a source position. |
10915 Object* GetBreakPointInfo(int source_position); | 10920 Object* GetBreakPointInfo(int source_position); |
10916 | 10921 |
10917 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo); | 10922 DISALLOW_IMPLICIT_CONSTRUCTORS(DebugInfo); |
10918 }; | 10923 }; |
10919 | 10924 |
10920 | 10925 |
10921 // The BreakPointInfo class holds information for break points set in a | 10926 // The BreakPointInfo class holds information for break points set in a |
(...skipping 11 matching lines...) Expand all Loading... |
10933 Handle<Object> break_point_object); | 10938 Handle<Object> break_point_object); |
10934 // Set a break point. | 10939 // Set a break point. |
10935 static void SetBreakPoint(Handle<BreakPointInfo> info, | 10940 static void SetBreakPoint(Handle<BreakPointInfo> info, |
10936 Handle<Object> break_point_object); | 10941 Handle<Object> break_point_object); |
10937 // Check if break point info has this break point object. | 10942 // Check if break point info has this break point object. |
10938 static bool HasBreakPointObject(Handle<BreakPointInfo> info, | 10943 static bool HasBreakPointObject(Handle<BreakPointInfo> info, |
10939 Handle<Object> break_point_object); | 10944 Handle<Object> break_point_object); |
10940 // Get the number of break points for this code offset. | 10945 // Get the number of break points for this code offset. |
10941 int GetBreakPointCount(); | 10946 int GetBreakPointCount(); |
10942 | 10947 |
| 10948 int GetStatementPosition(Handle<DebugInfo> debug_info); |
| 10949 |
10943 DECLARE_CAST(BreakPointInfo) | 10950 DECLARE_CAST(BreakPointInfo) |
10944 | 10951 |
10945 // Dispatched behavior. | 10952 // Dispatched behavior. |
10946 DECLARE_PRINTER(BreakPointInfo) | 10953 DECLARE_PRINTER(BreakPointInfo) |
10947 DECLARE_VERIFIER(BreakPointInfo) | 10954 DECLARE_VERIFIER(BreakPointInfo) |
10948 | 10955 |
10949 static const int kSourcePositionIndex = Struct::kHeaderSize; | 10956 static const int kSourcePositionIndex = Struct::kHeaderSize; |
10950 static const int kBreakPointObjectsIndex = | 10957 static const int kBreakPointObjectsIndex = |
10951 kSourcePositionIndex + kPointerSize; | 10958 kSourcePositionIndex + kPointerSize; |
10952 static const int kSize = kBreakPointObjectsIndex + kPointerSize; | 10959 static const int kSize = kBreakPointObjectsIndex + kPointerSize; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11074 } | 11081 } |
11075 return value; | 11082 return value; |
11076 } | 11083 } |
11077 }; | 11084 }; |
11078 | 11085 |
11079 | 11086 |
11080 } // NOLINT, false-positive due to second-order macros. | 11087 } // NOLINT, false-positive due to second-order macros. |
11081 } // NOLINT, false-positive due to second-order macros. | 11088 } // NOLINT, false-positive due to second-order macros. |
11082 | 11089 |
11083 #endif // V8_OBJECTS_H_ | 11090 #endif // V8_OBJECTS_H_ |
OLD | NEW |