| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent( | 133 LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent( |
| 134 jit_handler_data_, offset, source_position)); | 134 jit_handler_data_, offset, source_position)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void SourcePositionTableBuilder::AddEntry( | 137 void SourcePositionTableBuilder::AddEntry( |
| 138 const PositionTableEntry& entry, | 138 const PositionTableEntry& entry, |
| 139 SourcePositionTableBuilder::OnDuplicateCodeOffset on_duplicate) { | 139 SourcePositionTableBuilder::OnDuplicateCodeOffset on_duplicate) { |
| 140 // Don't encode a new entry if this bytecode already has a source position | 140 // Don't encode a new entry if this bytecode already has a source position |
| 141 // assigned. | 141 // assigned. |
| 142 if (candidate_.bytecode_offset == entry.bytecode_offset) { | 142 if (candidate_.bytecode_offset == entry.bytecode_offset) { |
| 143 if (on_duplicate == OVERWRITE_DUPLICATE) candidate_ = entry; | 143 if ((!candidate_.is_statement && entry.is_statement) || |
| 144 on_duplicate == OVERWRITE_DUPLICATE) { |
| 145 candidate_ = entry; |
| 146 } |
| 144 return; | 147 return; |
| 145 } | 148 } |
| 146 | 149 |
| 147 CommitEntry(); | 150 CommitEntry(); |
| 148 candidate_ = entry; | 151 candidate_ = entry; |
| 149 } | 152 } |
| 150 | 153 |
| 151 void SourcePositionTableBuilder::CommitEntry() { | 154 void SourcePositionTableBuilder::CommitEntry() { |
| 152 if (candidate_.bytecode_offset == kUninitializedCandidateOffset) return; | 155 if (candidate_.bytecode_offset == kUninitializedCandidateOffset) return; |
| 153 PositionTableEntry tmp(candidate_); | 156 PositionTableEntry tmp(candidate_); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } else { | 202 } else { |
| 200 PositionTableEntry tmp; | 203 PositionTableEntry tmp; |
| 201 DecodeEntry(table_, &index_, &tmp); | 204 DecodeEntry(table_, &index_, &tmp); |
| 202 AddAndSetEntry(current_, tmp); | 205 AddAndSetEntry(current_, tmp); |
| 203 } | 206 } |
| 204 } | 207 } |
| 205 | 208 |
| 206 } // namespace interpreter | 209 } // namespace interpreter |
| 207 } // namespace internal | 210 } // namespace internal |
| 208 } // namespace v8 | 211 } // namespace v8 |
| OLD | NEW |