Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: src/source-position-table.h

Issue 2112853002: Do not record source positions for non-JS or native script code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@simplifyjitlogging
Patch Set: update test expectation Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/source-position-table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_SOURCE_POSITION_TABLE_H_ 5 #ifndef V8_SOURCE_POSITION_TABLE_H_
6 #define V8_SOURCE_POSITION_TABLE_H_ 6 #define V8_SOURCE_POSITION_TABLE_H_
7 7
8 #include "src/assert-scope.h" 8 #include "src/assert-scope.h"
9 #include "src/checks.h" 9 #include "src/checks.h"
10 #include "src/handles.h" 10 #include "src/handles.h"
(...skipping 14 matching lines...) Expand all
25 PositionTableEntry(int offset, int source, bool statement) 25 PositionTableEntry(int offset, int source, bool statement)
26 : code_offset(offset), source_position(source), is_statement(statement) {} 26 : code_offset(offset), source_position(source), is_statement(statement) {}
27 27
28 int code_offset; 28 int code_offset;
29 int source_position; 29 int source_position;
30 bool is_statement; 30 bool is_statement;
31 }; 31 };
32 32
33 class SourcePositionTableBuilder { 33 class SourcePositionTableBuilder {
34 public: 34 public:
35 SourcePositionTableBuilder(Isolate* isolate, Zone* zone); 35 enum RecordingMode { OMIT_SOURCE_POSITIONS, RECORD_SOURCE_POSITIONS };
36
37 SourcePositionTableBuilder(Isolate* isolate, Zone* zone,
38 RecordingMode mode = RECORD_SOURCE_POSITIONS);
36 39
37 void EndJitLogging(AbstractCode* code); 40 void EndJitLogging(AbstractCode* code);
38 41
39 void AddPosition(size_t code_offset, int source_position, bool is_statement); 42 void AddPosition(size_t code_offset, int source_position, bool is_statement);
40 Handle<ByteArray> ToSourcePositionTable(); 43 Handle<ByteArray> ToSourcePositionTable();
41 44
42 private: 45 private:
43 void AddEntry(const PositionTableEntry& entry); 46 void AddEntry(const PositionTableEntry& entry);
44 47
48 inline bool Omit() const { return mode_ == OMIT_SOURCE_POSITIONS; }
49
45 Isolate* isolate_; 50 Isolate* isolate_;
51 RecordingMode mode_;
46 ZoneVector<byte> bytes_; 52 ZoneVector<byte> bytes_;
47 #ifdef ENABLE_SLOW_DCHECKS 53 #ifdef ENABLE_SLOW_DCHECKS
48 ZoneVector<PositionTableEntry> raw_entries_; 54 ZoneVector<PositionTableEntry> raw_entries_;
49 #endif 55 #endif
50 PositionTableEntry previous_; // Previously written entry, to compute delta. 56 PositionTableEntry previous_; // Previously written entry, to compute delta.
51 // Currently jit_handler_data_ is used to store JITHandler-specific data 57 // Currently jit_handler_data_ is used to store JITHandler-specific data
52 // over the lifetime of a SourcePositionTableBuilder. 58 // over the lifetime of a SourcePositionTableBuilder.
53 void* jit_handler_data_; 59 void* jit_handler_data_;
54 }; 60 };
55 61
(...skipping 23 matching lines...) Expand all
79 ByteArray* table_; 85 ByteArray* table_;
80 int index_; 86 int index_;
81 PositionTableEntry current_; 87 PositionTableEntry current_;
82 DisallowHeapAllocation no_gc; 88 DisallowHeapAllocation no_gc;
83 }; 89 };
84 90
85 } // namespace internal 91 } // namespace internal
86 } // namespace v8 92 } // namespace v8
87 93
88 #endif // V8_SOURCE_POSITION_TABLE_H_ 94 #endif // V8_SOURCE_POSITION_TABLE_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/source-position-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698