Chromium Code Reviews

Side by Side Diff: test/cctest/interpreter/source-position-matcher.h

Issue 2042633002: [interpreter] Ensure optimizations preserve source positions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef TEST_CCTEST_INTERPRETER_SOURCE_POSITION_COMPARER_H_
6 #define TEST_CCTEST_INTERPRETER_SOURCE_POSITION_COMPARER_H_
7
8 #include "src/interpreter/source-position-table.h"
9 #include "src/objects.h"
10 #include "src/v8.h"
11
12 namespace v8 {
13 namespace internal {
14 namespace interpreter {
15
16 class SourcePositionMatcher final {
17 public:
18 explicit SourcePositionMatcher(int number_of_locals)
19 : number_of_locals_(number_of_locals) {}
20
21 bool Match(Handle<BytecodeArray> original, Handle<BytecodeArray> optimized);
22
23 private:
24 bool NewExpressionPositionsInOptimized(
25 const std::vector<PositionTableEntry>* const original_positions,
26 const std::vector<PositionTableEntry>* const optimized_positions);
27
28 bool CompareExpressionPositions(
29 const std::vector<PositionTableEntry>* const original_positions,
30 const std::vector<PositionTableEntry>* const optimized_positions);
31
32 void StripUnneededExpressionPositions(
33 Handle<BytecodeArray> bytecode_array,
34 std::vector<PositionTableEntry>* positions);
35
36 bool ExpressionPositionIsNeeded(Handle<BytecodeArray> bytecode_array,
37 int start_offset, int end_offset);
38
39 void MoveToNextStatement(
40 SourcePositionTableIterator* iterator,
41 std::vector<PositionTableEntry>* expression_positions);
42
43 int number_of_locals() const { return number_of_locals_; }
rmcilroy 2016/06/07 09:46:11 This seems unused. Are you intending to add a test
oth 2016/06/07 13:46:18 Removed, at least for now. I think the check is pr
44
45 const int number_of_locals_;
46 };
47
48 } // namespace interpreter
49 } // namespace internal
50 } // namespace v8
51
52 #endif // TEST_CCTEST_INTERPRETER_SOURCE_POSITION_COMPARER_H_
OLDNEW

Powered by Google App Engine