OLD | NEW |
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 #include "src/interpreter/source-position-table.h" | 5 #include "src/interpreter/source-position-table.h" |
6 | 6 |
7 #include "src/objects-inl.h" | 7 #include "src/objects-inl.h" |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // numbers properly. | 110 // numbers properly. |
111 entry->bytecode_offset = (tmp >> 1); | 111 entry->bytecode_offset = (tmp >> 1); |
112 | 112 |
113 DecodeInt(bytes, index, &entry->source_position); | 113 DecodeInt(bytes, index, &entry->source_position); |
114 } | 114 } |
115 | 115 |
116 } // namespace | 116 } // namespace |
117 | 117 |
118 void SourcePositionTableBuilder::AddStatementPosition(size_t bytecode_offset, | 118 void SourcePositionTableBuilder::AddStatementPosition(size_t bytecode_offset, |
119 int source_position) { | 119 int source_position) { |
120 AddEntry({static_cast<int>(bytecode_offset), source_position, true}); | 120 int offset = static_cast<int>(bytecode_offset); |
| 121 AddEntry({offset, source_position, true}); |
| 122 LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddStatementPositionEvent( |
| 123 jit_handler_data_, offset, source_position)); |
| 124 LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent( |
| 125 jit_handler_data_, offset, source_position)); |
121 } | 126 } |
122 | 127 |
123 void SourcePositionTableBuilder::AddExpressionPosition(size_t bytecode_offset, | 128 void SourcePositionTableBuilder::AddExpressionPosition(size_t bytecode_offset, |
124 int source_position) { | 129 int source_position) { |
125 AddEntry({static_cast<int>(bytecode_offset), source_position, false}); | 130 int offset = static_cast<int>(bytecode_offset); |
| 131 AddEntry({offset, source_position, false}); |
| 132 LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent( |
| 133 jit_handler_data_, offset, source_position)); |
126 } | 134 } |
127 | 135 |
128 void SourcePositionTableBuilder::AddEntry(const PositionTableEntry& entry) { | 136 void SourcePositionTableBuilder::AddEntry(const PositionTableEntry& entry) { |
129 // Don't encode a new entry if this bytecode already has a source position | 137 // Don't encode a new entry if this bytecode already has a source position |
130 // assigned. | 138 // assigned. |
131 if (bytes_.size() > 0 && previous_.bytecode_offset == entry.bytecode_offset) { | 139 if (bytes_.size() > 0 && previous_.bytecode_offset == entry.bytecode_offset) { |
132 return; | 140 return; |
133 } | 141 } |
134 | 142 |
135 PositionTableEntry tmp(entry); | 143 PositionTableEntry tmp(entry); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } else { | 187 } else { |
180 PositionTableEntry tmp; | 188 PositionTableEntry tmp; |
181 DecodeEntry(table_, &index_, &tmp); | 189 DecodeEntry(table_, &index_, &tmp); |
182 AddAndSetEntry(current_, tmp); | 190 AddAndSetEntry(current_, tmp); |
183 } | 191 } |
184 } | 192 } |
185 | 193 |
186 } // namespace interpreter | 194 } // namespace interpreter |
187 } // namespace internal | 195 } // namespace internal |
188 } // namespace v8 | 196 } // namespace v8 |
OLD | NEW |