Chromium Code Reviews| Index: src/assembler.h |
| diff --git a/src/assembler.h b/src/assembler.h |
| index b68ad38970892491b039c28f589b2201263b3a2a..0deea15908f6d1b3e8dad6c5e1b9c0a7176936ed 100644 |
| --- a/src/assembler.h |
| +++ b/src/assembler.h |
| @@ -35,6 +35,7 @@ |
| #ifndef V8_ASSEMBLER_H_ |
| #define V8_ASSEMBLER_H_ |
| +#include "gdbjit.h" |
|
Erik Corry
2011/01/05 09:00:15
The files should really be called gdb-jit.*
Vyacheslav Egorov (Chromium)
2011/01/18 16:10:42
Done.
|
| #include "runtime.h" |
| #include "top.h" |
| #include "token.h" |
| @@ -632,7 +633,29 @@ struct PositionState { |
| class PositionsRecorder BASE_EMBEDDED { |
| public: |
| explicit PositionsRecorder(Assembler* assembler) |
| - : assembler_(assembler) {} |
| + : assembler_(assembler) { |
| +#ifdef ENABLE_GDBJIT_INTERFACE |
|
Erik Corry
2011/01/05 09:00:15
and the macro should really be called ENABLE_GDB_J
Vyacheslav Egorov (Chromium)
2011/01/18 16:10:42
Done.
|
| + gdbjit_lineinfo_ = NULL; |
| +#endif |
| + } |
| + |
| +#ifdef ENABLE_GDBJIT_INTERFACE |
| + ~PositionsRecorder() { |
| + delete gdbjit_lineinfo_; |
| + } |
| + |
| + void StartGDBJITLineInfoRecording() { |
| + if (FLAG_gdbjit) { |
| + gdbjit_lineinfo_ = new GDBJITLineInfo(); |
| + } |
| + } |
| + |
| + GDBJITLineInfo* DetachGDBJITLineInfo() { |
| + GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; |
| + gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. |
| + return lineinfo; |
| + } |
| +#endif |
| // Set current position to pos. |
| void RecordPosition(int pos); |
| @@ -652,6 +675,9 @@ class PositionsRecorder BASE_EMBEDDED { |
| private: |
| Assembler* assembler_; |
| PositionState state_; |
| +#ifdef ENABLE_GDBJIT_INTERFACE |
| + GDBJITLineInfo* gdbjit_lineinfo_; |
| +#endif |
| friend class PreservePositionScope; |