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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 | 46 |
| 47 namespace v8 { | 47 namespace v8 { |
| 48 | 48 |
| 49 class ApiFunction; | 49 class ApiFunction; |
| 50 | 50 |
| 51 namespace internal { | 51 namespace internal { |
| 52 | 52 |
| 53 struct StatsCounter; | 53 struct StatsCounter; |
| 54 // ----------------------------------------------------------------------------- | 54 // ----------------------------------------------------------------------------- |
| 55 // Platform independent assembler base class. | 55 // Platform independent assembler base class. |
| 56 | |
|
danno
2012/12/20 16:27:20
nit: don't make whitespace changes unrelated to yo
| |
| 57 class AssemblerBase: public Malloced { | 56 class AssemblerBase: public Malloced { |
| 58 public: | 57 public: |
| 59 AssemblerBase(Isolate* isolate, void* buffer, int buffer_size); | 58 AssemblerBase(Isolate* isolate, void* buffer, int buffer_size); |
| 60 virtual ~AssemblerBase(); | 59 virtual ~AssemblerBase(); |
| 61 | 60 |
| 62 Isolate* isolate() const { return isolate_; } | 61 Isolate* isolate() const { return isolate_; } |
| 63 int jit_cookie() const { return jit_cookie_; } | 62 int jit_cookie() const { return jit_cookie_; } |
| 64 | 63 |
| 65 bool emit_debug_code() const { return emit_debug_code_; } | 64 bool emit_debug_code() const { return emit_debug_code_; } |
| 66 void set_emit_debug_code(bool value) { emit_debug_code_ = value; } | 65 void set_emit_debug_code(bool value) { emit_debug_code_ = value; } |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 814 current_statement_position(RelocInfo::kNoPosition), | 813 current_statement_position(RelocInfo::kNoPosition), |
| 815 written_statement_position(RelocInfo::kNoPosition) {} | 814 written_statement_position(RelocInfo::kNoPosition) {} |
| 816 | 815 |
| 817 int current_position; | 816 int current_position; |
| 818 int written_position; | 817 int written_position; |
| 819 | 818 |
| 820 int current_statement_position; | 819 int current_statement_position; |
| 821 int written_statement_position; | 820 int written_statement_position; |
| 822 }; | 821 }; |
| 823 | 822 |
| 824 | |
|
danno
2012/12/20 16:27:20
nit: don't make whitespace changes unrelated to yo
| |
| 825 class PositionsRecorder BASE_EMBEDDED { | 823 class PositionsRecorder BASE_EMBEDDED { |
| 826 public: | 824 public: |
| 827 explicit PositionsRecorder(Assembler* assembler) | 825 explicit PositionsRecorder(Assembler* assembler) |
| 828 : assembler_(assembler) { | 826 : assembler_(assembler) { |
| 829 #ifdef ENABLE_GDB_JIT_INTERFACE | 827 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 830 gdbjit_lineinfo_ = NULL; | 828 gdbjit_lineinfo_ = NULL; |
| 831 #endif | 829 #endif |
| 830 jit_code_event_line_info_ = NULL; | |
| 831 } | |
| 832 | |
| 833 ~PositionsRecorder() { | |
| 834 #ifdef ENABLE_GDB_JIT_INTERFACE | |
| 835 delete gdbjit_lineinfo_; | |
| 836 #endif | |
| 837 delete jit_code_event_line_info_; | |
| 832 } | 838 } |
| 833 | 839 |
| 834 #ifdef ENABLE_GDB_JIT_INTERFACE | 840 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 835 ~PositionsRecorder() { | |
| 836 delete gdbjit_lineinfo_; | |
| 837 } | |
| 838 | |
| 839 void StartGDBJITLineInfoRecording() { | 841 void StartGDBJITLineInfoRecording() { |
| 840 if (FLAG_gdbjit) { | 842 if (FLAG_gdbjit) { |
| 841 gdbjit_lineinfo_ = new GDBJITLineInfo(); | 843 gdbjit_lineinfo_ = new GDBJITLineInfo(); |
| 842 } | 844 } |
| 843 } | 845 } |
| 844 | 846 |
| 845 GDBJITLineInfo* DetachGDBJITLineInfo() { | 847 GDBJITLineInfo* DetachGDBJITLineInfo() { |
| 846 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; | 848 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; |
| 847 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. | 849 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. |
| 848 return lineinfo; | 850 return lineinfo; |
| 849 } | 851 } |
| 850 #endif | 852 #endif |
| 853 JITCodeLineInfo* InitializeJITLineInfo() { | |
| 854 jit_code_event_line_info_ = new JITCodeLineInfo(); | |
| 855 return jit_code_event_line_info_; | |
| 856 } | |
| 851 | 857 |
| 858 JITCodeLineInfo* DetachJITLineInfo() { | |
| 859 JITCodeLineInfo* lineinfo = jit_code_event_line_info_; | |
| 860 jit_code_event_line_info_ = NULL; | |
| 861 return lineinfo; | |
| 862 } | |
| 852 // Set current position to pos. | 863 // Set current position to pos. |
| 853 void RecordPosition(int pos); | 864 void RecordPosition(int pos); |
| 854 | 865 |
| 855 // Set current statement position to pos. | 866 // Set current statement position to pos. |
| 856 void RecordStatementPosition(int pos); | 867 void RecordStatementPosition(int pos); |
| 857 | 868 |
| 858 // Write recorded positions to relocation information. | 869 // Write recorded positions to relocation information. |
| 859 bool WriteRecordedPositions(); | 870 bool WriteRecordedPositions(); |
| 860 | 871 |
| 861 int current_position() const { return state_.current_position; } | 872 int current_position() const { return state_.current_position; } |
| 862 | 873 |
| 863 int current_statement_position() const { | 874 int current_statement_position() const { |
| 864 return state_.current_statement_position; | 875 return state_.current_statement_position; |
| 865 } | 876 } |
| 866 | 877 |
| 878 Assembler* assembler() { | |
| 879 return assembler_; | |
| 880 } | |
| 867 private: | 881 private: |
| 868 Assembler* assembler_; | 882 Assembler* assembler_; |
| 869 PositionState state_; | 883 PositionState state_; |
| 870 #ifdef ENABLE_GDB_JIT_INTERFACE | 884 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 871 GDBJITLineInfo* gdbjit_lineinfo_; | 885 GDBJITLineInfo* gdbjit_lineinfo_; |
| 872 #endif | 886 #endif |
| 873 | 887 JITCodeLineInfo* jit_code_event_line_info_; |
| 874 friend class PreservePositionScope; | 888 friend class PreservePositionScope; |
| 875 | 889 |
| 876 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); | 890 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); |
| 877 }; | 891 }; |
| 878 | 892 |
| 879 | 893 |
| 880 class PreservePositionScope BASE_EMBEDDED { | 894 class PreservePositionScope BASE_EMBEDDED { |
| 881 public: | 895 public: |
| 882 explicit PreservePositionScope(PositionsRecorder* positions_recorder) | 896 explicit PreservePositionScope(PositionsRecorder* positions_recorder) |
| 883 : positions_recorder_(positions_recorder), | 897 : positions_recorder_(positions_recorder), |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 956 public: | 970 public: |
| 957 NullCallWrapper() { } | 971 NullCallWrapper() { } |
| 958 virtual ~NullCallWrapper() { } | 972 virtual ~NullCallWrapper() { } |
| 959 virtual void BeforeCall(int call_size) const { } | 973 virtual void BeforeCall(int call_size) const { } |
| 960 virtual void AfterCall() const { } | 974 virtual void AfterCall() const { } |
| 961 }; | 975 }; |
| 962 | 976 |
| 963 } } // namespace v8::internal | 977 } } // namespace v8::internal |
| 964 | 978 |
| 965 #endif // V8_ASSEMBLER_H_ | 979 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |