| 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 "test/cctest/interpreter/source-position-matcher.h" | 5 #include "test/cctest/interpreter/source-position-matcher.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // | 49 // |
| 50 // 5. Expression positions may be dropped when they are applied to | 50 // 5. Expression positions may be dropped when they are applied to |
| 51 // bytecodes that manipulate local frame state and immediately | 51 // bytecodes that manipulate local frame state and immediately |
| 52 // proceeded by another source position. | 52 // proceeded by another source position. |
| 53 // | 53 // |
| 54 // 6. The relative ordering of source positions must be preserved. | 54 // 6. The relative ordering of source positions must be preserved. |
| 55 // | 55 // |
| 56 bool SourcePositionMatcher::Match(Handle<BytecodeArray> original_bytecode, | 56 bool SourcePositionMatcher::Match(Handle<BytecodeArray> original_bytecode, |
| 57 Handle<BytecodeArray> optimized_bytecode) { | 57 Handle<BytecodeArray> optimized_bytecode) { |
| 58 SourcePositionTableIterator original( | 58 SourcePositionTableIterator original( |
| 59 original_bytecode->source_position_table()); | 59 original_bytecode->SourcePositionTable()); |
| 60 SourcePositionTableIterator optimized( | 60 SourcePositionTableIterator optimized( |
| 61 optimized_bytecode->source_position_table()); | 61 optimized_bytecode->SourcePositionTable()); |
| 62 | 62 |
| 63 int last_original_bytecode_offset = 0; | 63 int last_original_bytecode_offset = 0; |
| 64 int last_optimized_bytecode_offset = 0; | 64 int last_optimized_bytecode_offset = 0; |
| 65 | 65 |
| 66 // Ordered lists of expression positions immediately before the | 66 // Ordered lists of expression positions immediately before the |
| 67 // latest statements in each bytecode array. | 67 // latest statements in each bytecode array. |
| 68 std::vector<PositionTableEntry> original_expression_entries; | 68 std::vector<PositionTableEntry> original_expression_entries; |
| 69 std::vector<PositionTableEntry> optimized_expression_entries; | 69 std::vector<PositionTableEntry> optimized_expression_entries; |
| 70 | 70 |
| 71 while (true) { | 71 while (true) { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 positions->push_back({iterator->code_offset(), | 216 positions->push_back({iterator->code_offset(), |
| 217 iterator->source_position().raw(), | 217 iterator->source_position().raw(), |
| 218 iterator->is_statement()}); | 218 iterator->is_statement()}); |
| 219 iterator->Advance(); | 219 iterator->Advance(); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace interpreter | 223 } // namespace interpreter |
| 224 } // namespace internal | 224 } // namespace internal |
| 225 } // namespace v8 | 225 } // namespace v8 |
| OLD | NEW |