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

Side by Side Diff: src/interpreter/source-position-table.cc

Issue 1682853003: [debugger] introduce abstract interface for break location. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: revert stray edit Created 4 years, 10 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/source-position-table.h ('k') | src/mips/assembler-mips-inl.h » ('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 #include "src/interpreter/source-position-table.h" 5 #include "src/interpreter/source-position-table.h"
6 6
7 #include "src/assembler.h" 7 #include "src/assembler.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 DCHECK(bytecode_offset_ < new_bytecode_offset || index_ == 0); 70 DCHECK(bytecode_offset_ < new_bytecode_offset || index_ == 0);
71 bytecode_offset_ = new_bytecode_offset; 71 bytecode_offset_ = new_bytecode_offset;
72 uint32_t source_position_and_type = 72 uint32_t source_position_and_type =
73 static_cast<uint32_t>(Smi::cast(table_->get(index_ + 1))->value()); 73 static_cast<uint32_t>(Smi::cast(table_->get(index_ + 1))->value());
74 is_statement_ = IsStatementField::decode(source_position_and_type); 74 is_statement_ = IsStatementField::decode(source_position_and_type);
75 source_position_ = SourcePositionField::decode(source_position_and_type); 75 source_position_ = SourcePositionField::decode(source_position_and_type);
76 } 76 }
77 index_ += 2; 77 index_ += 2;
78 } 78 }
79 79
80 int SourcePositionTableIterator::PositionFromBytecodeOffset(
81 BytecodeArray* bytecode_array, int bytecode_offset) {
82 int last_position = 0;
83 for (SourcePositionTableIterator iterator(bytecode_array);
84 !iterator.done() && iterator.bytecode_offset() <= bytecode_offset;
85 iterator.Advance()) {
86 last_position = iterator.source_position();
87 }
88 return last_position;
89 }
90
91 } // namespace interpreter 80 } // namespace interpreter
92 } // namespace internal 81 } // namespace internal
93 } // namespace v8 82 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/source-position-table.h ('k') | src/mips/assembler-mips-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698