Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 824 }; | 824 }; |
| 825 | 825 |
| 826 | 826 |
| 827 class PositionsRecorder BASE_EMBEDDED { | 827 class PositionsRecorder BASE_EMBEDDED { |
| 828 public: | 828 public: |
| 829 explicit PositionsRecorder(Assembler* assembler) | 829 explicit PositionsRecorder(Assembler* assembler) |
| 830 : assembler_(assembler) { | 830 : assembler_(assembler) { |
| 831 #ifdef ENABLE_GDB_JIT_INTERFACE | 831 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 832 gdbjit_lineinfo_ = NULL; | 832 gdbjit_lineinfo_ = NULL; |
| 833 #endif | 833 #endif |
| 834 jit_code_event_line_info_ = NULL; | |
| 835 } | |
| 836 | |
| 837 ~PositionsRecorder() { | |
| 838 #ifdef ENABLE_GDB_JIT_INTERFACE | |
| 839 delete gdbjit_lineinfo_; | |
| 840 #endif | |
| 841 delete jit_code_event_line_info_; | |
| 834 } | 842 } |
| 835 | 843 |
| 836 #ifdef ENABLE_GDB_JIT_INTERFACE | 844 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 837 ~PositionsRecorder() { | |
| 838 delete gdbjit_lineinfo_; | |
| 839 } | |
| 840 | |
| 841 void StartGDBJITLineInfoRecording() { | 845 void StartGDBJITLineInfoRecording() { |
| 842 if (FLAG_gdbjit) { | 846 if (FLAG_gdbjit) { |
| 843 gdbjit_lineinfo_ = new GDBJITLineInfo(); | 847 gdbjit_lineinfo_ = new GDBJITLineInfo(); |
| 844 } | 848 } |
| 845 } | 849 } |
| 846 | 850 |
| 847 GDBJITLineInfo* DetachGDBJITLineInfo() { | 851 GDBJITLineInfo* DetachGDBJITLineInfo() { |
| 848 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; | 852 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; |
| 849 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. | 853 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. |
| 850 return lineinfo; | 854 return lineinfo; |
| 851 } | 855 } |
| 852 #endif | 856 #endif |
| 857 JITCodeLineInfo* InitializeJITLineInfo() { | |
|
danno
2013/01/10 16:47:33
Instead of these routines knowing about JITCodeLin
chunyang.dai
2013/01/18 10:22:44
Done.
| |
| 858 jit_code_event_line_info_ = new JITCodeLineInfo(); | |
| 859 return jit_code_event_line_info_; | |
| 860 } | |
| 853 | 861 |
| 862 JITCodeLineInfo* DetachJITLineInfo() { | |
|
danno
2013/01/10 16:47:33
Memory management for JITCodeLineInfo (delete) sho
chunyang.dai
2013/01/18 10:22:44
Done.
| |
| 863 JITCodeLineInfo* lineinfo = jit_code_event_line_info_; | |
| 864 jit_code_event_line_info_ = NULL; | |
| 865 return lineinfo; | |
| 866 } | |
| 854 // Set current position to pos. | 867 // Set current position to pos. |
| 855 void RecordPosition(int pos); | 868 void RecordPosition(int pos); |
| 856 | 869 |
| 857 // Set current statement position to pos. | 870 // Set current statement position to pos. |
| 858 void RecordStatementPosition(int pos); | 871 void RecordStatementPosition(int pos); |
| 859 | 872 |
| 860 // Write recorded positions to relocation information. | 873 // Write recorded positions to relocation information. |
| 861 bool WriteRecordedPositions(); | 874 bool WriteRecordedPositions(); |
| 862 | 875 |
| 863 int current_position() const { return state_.current_position; } | 876 int current_position() const { return state_.current_position; } |
| 864 | 877 |
| 865 int current_statement_position() const { | 878 int current_statement_position() const { |
| 866 return state_.current_statement_position; | 879 return state_.current_statement_position; |
| 867 } | 880 } |
| 868 | 881 |
| 882 Assembler* assembler() { | |
| 883 return assembler_; | |
| 884 } | |
| 885 | |
| 869 private: | 886 private: |
| 870 Assembler* assembler_; | 887 Assembler* assembler_; |
| 871 PositionState state_; | 888 PositionState state_; |
| 872 #ifdef ENABLE_GDB_JIT_INTERFACE | 889 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 873 GDBJITLineInfo* gdbjit_lineinfo_; | 890 GDBJITLineInfo* gdbjit_lineinfo_; |
| 874 #endif | 891 #endif |
| 875 | 892 JITCodeLineInfo* jit_code_event_line_info_; |
| 876 friend class PreservePositionScope; | 893 friend class PreservePositionScope; |
| 877 | 894 |
| 878 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); | 895 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); |
| 879 }; | 896 }; |
| 880 | 897 |
| 881 | 898 |
| 882 class PreservePositionScope BASE_EMBEDDED { | 899 class PreservePositionScope BASE_EMBEDDED { |
| 883 public: | 900 public: |
| 884 explicit PreservePositionScope(PositionsRecorder* positions_recorder) | 901 explicit PreservePositionScope(PositionsRecorder* positions_recorder) |
| 885 : positions_recorder_(positions_recorder), | 902 : positions_recorder_(positions_recorder), |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 958 public: | 975 public: |
| 959 NullCallWrapper() { } | 976 NullCallWrapper() { } |
| 960 virtual ~NullCallWrapper() { } | 977 virtual ~NullCallWrapper() { } |
| 961 virtual void BeforeCall(int call_size) const { } | 978 virtual void BeforeCall(int call_size) const { } |
| 962 virtual void AfterCall() const { } | 979 virtual void AfterCall() const { } |
| 963 }; | 980 }; |
| 964 | 981 |
| 965 } } // namespace v8::internal | 982 } } // namespace v8::internal |
| 966 | 983 |
| 967 #endif // V8_ASSEMBLER_H_ | 984 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |