| 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/source-position-table.h" | 5 #include "src/source-position-table.h" |
| 6 | 6 |
| 7 #include "src/log.h" | 7 #include "src/log.h" |
| 8 #include "src/objects-inl.h" | 8 #include "src/objects-inl.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 | 10 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 | 169 |
| 170 SourcePositionTableIterator::SourcePositionTableIterator(ByteArray* byte_array) | 170 SourcePositionTableIterator::SourcePositionTableIterator(ByteArray* byte_array) |
| 171 : table_(byte_array), index_(0), current_() { | 171 : table_(byte_array), index_(0), current_() { |
| 172 Advance(); | 172 Advance(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void SourcePositionTableIterator::Advance() { | 175 void SourcePositionTableIterator::Advance() { |
| 176 DCHECK(!done()); | 176 DCHECK(!done()); |
| 177 DCHECK(index_ >= 0 && index_ <= table_->length()); | 177 DCHECK(index_ >= 0 && index_ <= table_->length()); |
| 178 if (index_ == table_->length()) { | 178 if (index_ >= table_->length()) { |
| 179 index_ = kDone; | 179 index_ = kDone; |
| 180 } else { | 180 } else { |
| 181 PositionTableEntry tmp; | 181 PositionTableEntry tmp; |
| 182 DecodeEntry(table_, &index_, &tmp); | 182 DecodeEntry(table_, &index_, &tmp); |
| 183 AddAndSetEntry(current_, tmp); | 183 AddAndSetEntry(current_, tmp); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace internal | 187 } // namespace internal |
| 188 } // namespace v8 | 188 } // namespace v8 |
| OLD | NEW |