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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 835 }; | 835 }; |
| 836 | 836 |
| 837 | 837 |
| 838 class PositionsRecorder BASE_EMBEDDED { | 838 class PositionsRecorder BASE_EMBEDDED { |
| 839 public: | 839 public: |
| 840 explicit PositionsRecorder(Assembler* assembler) | 840 explicit PositionsRecorder(Assembler* assembler) |
| 841 : assembler_(assembler) { | 841 : assembler_(assembler) { |
| 842 #ifdef ENABLE_GDB_JIT_INTERFACE | 842 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 843 gdbjit_lineinfo_ = NULL; | 843 gdbjit_lineinfo_ = NULL; |
| 844 #endif | 844 #endif |
| 845 user_data_ = NULL; | |
|
danno
2013/02/01 13:43:10
please call this (and all names of variables deriv
| |
| 845 } | 846 } |
| 846 | 847 |
| 847 #ifdef ENABLE_GDB_JIT_INTERFACE | 848 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 848 ~PositionsRecorder() { | 849 ~PositionsRecorder() { |
| 849 delete gdbjit_lineinfo_; | 850 delete gdbjit_lineinfo_; |
| 850 } | 851 } |
| 851 | 852 |
| 852 void StartGDBJITLineInfoRecording() { | 853 void StartGDBJITLineInfoRecording() { |
| 853 if (FLAG_gdbjit) { | 854 if (FLAG_gdbjit) { |
| 854 gdbjit_lineinfo_ = new GDBJITLineInfo(); | 855 gdbjit_lineinfo_ = new GDBJITLineInfo(); |
| 855 } | 856 } |
| 856 } | 857 } |
| 857 | 858 |
| 858 GDBJITLineInfo* DetachGDBJITLineInfo() { | 859 GDBJITLineInfo* DetachGDBJITLineInfo() { |
| 859 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; | 860 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; |
| 860 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. | 861 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. |
| 861 return lineinfo; | 862 return lineinfo; |
| 862 } | 863 } |
| 863 #endif | 864 #endif |
| 865 void InitializeUserData(void* user_data) { | |
|
danno
2013/02/01 13:43:10
AttachJITHandlerData?
| |
| 866 user_data_ = user_data; | |
| 867 } | |
| 864 | 868 |
| 869 void* DetachJITLineInfo() { | |
|
danno
2013/02/01 13:43:10
DetachJITHandlerData?
| |
| 870 void* old_user_data = user_data_; | |
| 871 user_data_ = NULL; | |
| 872 return old_user_data; | |
| 873 } | |
| 865 // Set current position to pos. | 874 // Set current position to pos. |
| 866 void RecordPosition(int pos); | 875 void RecordPosition(int pos); |
| 867 | 876 |
| 868 // Set current statement position to pos. | 877 // Set current statement position to pos. |
| 869 void RecordStatementPosition(int pos); | 878 void RecordStatementPosition(int pos); |
| 870 | 879 |
| 871 // Write recorded positions to relocation information. | 880 // Write recorded positions to relocation information. |
| 872 bool WriteRecordedPositions(); | 881 bool WriteRecordedPositions(); |
| 873 | 882 |
| 874 int current_position() const { return state_.current_position; } | 883 int current_position() const { return state_.current_position; } |
| 875 | 884 |
| 876 int current_statement_position() const { | 885 int current_statement_position() const { |
| 877 return state_.current_statement_position; | 886 return state_.current_statement_position; |
| 878 } | 887 } |
| 879 | 888 |
| 889 Assembler* assembler() { | |
| 890 return assembler_; | |
| 891 } | |
| 892 | |
| 880 private: | 893 private: |
| 881 Assembler* assembler_; | 894 Assembler* assembler_; |
| 882 PositionState state_; | 895 PositionState state_; |
| 883 #ifdef ENABLE_GDB_JIT_INTERFACE | 896 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 884 GDBJITLineInfo* gdbjit_lineinfo_; | 897 GDBJITLineInfo* gdbjit_lineinfo_; |
| 885 #endif | 898 #endif |
| 886 | 899 // Currently user_data_ is used to keep the JITted code line info. |
|
danno
2013/02/01 13:43:10
I don't think this comment is exactly correct. It
| |
| 900 void* user_data_; | |
| 887 friend class PreservePositionScope; | 901 friend class PreservePositionScope; |
| 888 | 902 |
| 889 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); | 903 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); |
| 890 }; | 904 }; |
| 891 | 905 |
| 892 | 906 |
| 893 class PreservePositionScope BASE_EMBEDDED { | 907 class PreservePositionScope BASE_EMBEDDED { |
| 894 public: | 908 public: |
| 895 explicit PreservePositionScope(PositionsRecorder* positions_recorder) | 909 explicit PreservePositionScope(PositionsRecorder* positions_recorder) |
| 896 : positions_recorder_(positions_recorder), | 910 : positions_recorder_(positions_recorder), |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 969 public: | 983 public: |
| 970 NullCallWrapper() { } | 984 NullCallWrapper() { } |
| 971 virtual ~NullCallWrapper() { } | 985 virtual ~NullCallWrapper() { } |
| 972 virtual void BeforeCall(int call_size) const { } | 986 virtual void BeforeCall(int call_size) const { } |
| 973 virtual void AfterCall() const { } | 987 virtual void AfterCall() const { } |
| 974 }; | 988 }; |
| 975 | 989 |
| 976 } } // namespace v8::internal | 990 } } // namespace v8::internal |
| 977 | 991 |
| 978 #endif // V8_ASSEMBLER_H_ | 992 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |