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

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

Issue 2111793002: Simplify JIT event logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix forward declaration 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/log.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"
11 #include "src/log.h"
12 #include "src/zone-containers.h" 11 #include "src/zone-containers.h"
13 12
14 namespace v8 { 13 namespace v8 {
15 namespace internal { 14 namespace internal {
16 15
16 class AbstractCode;
17 class BytecodeArray; 17 class BytecodeArray;
18 class ByteArray; 18 class ByteArray;
19 class Isolate; 19 class Isolate;
20 class Zone; 20 class Zone;
21 21
22 struct PositionTableEntry { 22 struct PositionTableEntry {
23 PositionTableEntry() 23 PositionTableEntry()
24 : code_offset(0), source_position(0), is_statement(false) {} 24 : code_offset(0), source_position(0), is_statement(false) {}
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 final : public PositionsRecorder { 33 class SourcePositionTableBuilder {
34 public: 34 public:
35 SourcePositionTableBuilder(Isolate* isolate, Zone* zone) 35 SourcePositionTableBuilder(Isolate* isolate, Zone* zone);
36 : isolate_(isolate), 36
37 bytes_(zone), 37 void EndJitLogging(AbstractCode* code);
38 #ifdef ENABLE_SLOW_DCHECKS
39 raw_entries_(zone),
40 #endif
41 previous_() {
42 }
43 38
44 void AddPosition(size_t code_offset, int source_position, bool is_statement); 39 void AddPosition(size_t code_offset, int source_position, bool is_statement);
45 Handle<ByteArray> ToSourcePositionTable(); 40 Handle<ByteArray> ToSourcePositionTable();
46 41
47 private: 42 private:
48 void AddEntry(const PositionTableEntry& entry); 43 void AddEntry(const PositionTableEntry& entry);
49 void CommitEntry();
50 44
51 Isolate* isolate_; 45 Isolate* isolate_;
52 ZoneVector<byte> bytes_; 46 ZoneVector<byte> bytes_;
53 #ifdef ENABLE_SLOW_DCHECKS 47 #ifdef ENABLE_SLOW_DCHECKS
54 ZoneVector<PositionTableEntry> raw_entries_; 48 ZoneVector<PositionTableEntry> raw_entries_;
55 #endif 49 #endif
56 PositionTableEntry previous_; // Previously written entry, to compute delta. 50 PositionTableEntry previous_; // Previously written entry, to compute delta.
51 // Currently jit_handler_data_ is used to store JITHandler-specific data
52 // over the lifetime of a SourcePositionTableBuilder.
53 void* jit_handler_data_;
57 }; 54 };
58 55
59 class SourcePositionTableIterator { 56 class SourcePositionTableIterator {
60 public: 57 public:
61 explicit SourcePositionTableIterator(ByteArray* byte_array); 58 explicit SourcePositionTableIterator(ByteArray* byte_array);
62 59
63 void Advance(); 60 void Advance();
64 61
65 int code_offset() const { 62 int code_offset() const {
66 DCHECK(!done()); 63 DCHECK(!done());
(...skipping 15 matching lines...) Expand all
82 ByteArray* table_; 79 ByteArray* table_;
83 int index_; 80 int index_;
84 PositionTableEntry current_; 81 PositionTableEntry current_;
85 DisallowHeapAllocation no_gc; 82 DisallowHeapAllocation no_gc;
86 }; 83 };
87 84
88 } // namespace internal 85 } // namespace internal
89 } // namespace v8 86 } // namespace v8
90 87
91 #endif // V8_SOURCE_POSITION_TABLE_H_ 88 #endif // V8_SOURCE_POSITION_TABLE_H_
OLDNEW
« no previous file with comments | « src/log.cc ('k') | src/source-position-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698