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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 }; | 837 }; |
838 | 838 |
839 | 839 |
840 class PositionsRecorder BASE_EMBEDDED { | 840 class PositionsRecorder BASE_EMBEDDED { |
841 public: | 841 public: |
842 explicit PositionsRecorder(Assembler* assembler) | 842 explicit PositionsRecorder(Assembler* assembler) |
843 : assembler_(assembler) { | 843 : assembler_(assembler) { |
844 #ifdef ENABLE_GDB_JIT_INTERFACE | 844 #ifdef ENABLE_GDB_JIT_INTERFACE |
845 gdbjit_lineinfo_ = NULL; | 845 gdbjit_lineinfo_ = NULL; |
846 #endif | 846 #endif |
847 jit_handler_data_ = NULL; | |
847 } | 848 } |
848 | 849 |
849 #ifdef ENABLE_GDB_JIT_INTERFACE | 850 #ifdef ENABLE_GDB_JIT_INTERFACE |
850 ~PositionsRecorder() { | 851 ~PositionsRecorder() { |
851 delete gdbjit_lineinfo_; | 852 delete gdbjit_lineinfo_; |
852 } | 853 } |
853 | 854 |
854 void StartGDBJITLineInfoRecording() { | 855 void StartGDBJITLineInfoRecording() { |
855 if (FLAG_gdbjit) { | 856 if (FLAG_gdbjit) { |
856 gdbjit_lineinfo_ = new GDBJITLineInfo(); | 857 gdbjit_lineinfo_ = new GDBJITLineInfo(); |
857 } | 858 } |
858 } | 859 } |
859 | 860 |
860 GDBJITLineInfo* DetachGDBJITLineInfo() { | 861 GDBJITLineInfo* DetachGDBJITLineInfo() { |
861 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; | 862 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; |
862 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. | 863 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. |
863 return lineinfo; | 864 return lineinfo; |
864 } | 865 } |
865 #endif | 866 #endif |
867 void AttachJITHandlerData(void* user_data) { | |
868 jit_handler_data_ = user_data; | |
869 } | |
866 | 870 |
871 void* DetachJITHandlerData() { | |
872 void* old_data = jit_handler_data_; | |
873 jit_handler_data_ = NULL; | |
874 return old_data; | |
875 } | |
867 // Set current position to pos. | 876 // Set current position to pos. |
868 void RecordPosition(int pos); | 877 void RecordPosition(int pos); |
869 | 878 |
870 // Set current statement position to pos. | 879 // Set current statement position to pos. |
871 void RecordStatementPosition(int pos); | 880 void RecordStatementPosition(int pos); |
872 | 881 |
873 // Write recorded positions to relocation information. | 882 // Write recorded positions to relocation information. |
874 bool WriteRecordedPositions(); | 883 bool WriteRecordedPositions(); |
875 | 884 |
876 int current_position() const { return state_.current_position; } | 885 int current_position() const { return state_.current_position; } |
877 | 886 |
878 int current_statement_position() const { | 887 int current_statement_position() const { |
879 return state_.current_statement_position; | 888 return state_.current_statement_position; |
880 } | 889 } |
881 | 890 |
891 Assembler* assembler() { | |
danno
2013/02/06 14:21:34
Why is this necessary? You access directly assembl
| |
892 return assembler_; | |
893 } | |
894 | |
882 private: | 895 private: |
883 Assembler* assembler_; | 896 Assembler* assembler_; |
884 PositionState state_; | 897 PositionState state_; |
885 #ifdef ENABLE_GDB_JIT_INTERFACE | 898 #ifdef ENABLE_GDB_JIT_INTERFACE |
886 GDBJITLineInfo* gdbjit_lineinfo_; | 899 GDBJITLineInfo* gdbjit_lineinfo_; |
887 #endif | 900 #endif |
888 | 901 // Currently jit_handler_data_ is used to store JITHandler-specific data |
902 // over the lifetime of a PositionsRecorder | |
903 void* jit_handler_data_; | |
889 friend class PreservePositionScope; | 904 friend class PreservePositionScope; |
890 | 905 |
891 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); | 906 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); |
892 }; | 907 }; |
893 | 908 |
894 | 909 |
895 class PreservePositionScope BASE_EMBEDDED { | 910 class PreservePositionScope BASE_EMBEDDED { |
896 public: | 911 public: |
897 explicit PreservePositionScope(PositionsRecorder* positions_recorder) | 912 explicit PreservePositionScope(PositionsRecorder* positions_recorder) |
898 : positions_recorder_(positions_recorder), | 913 : positions_recorder_(positions_recorder), |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
971 public: | 986 public: |
972 NullCallWrapper() { } | 987 NullCallWrapper() { } |
973 virtual ~NullCallWrapper() { } | 988 virtual ~NullCallWrapper() { } |
974 virtual void BeforeCall(int call_size) const { } | 989 virtual void BeforeCall(int call_size) const { } |
975 virtual void AfterCall() const { } | 990 virtual void AfterCall() const { } |
976 }; | 991 }; |
977 | 992 |
978 } } // namespace v8::internal | 993 } } // namespace v8::internal |
979 | 994 |
980 #endif // V8_ASSEMBLER_H_ | 995 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |