OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler/bytecode-analysis.h" | 7 #include "src/compiler/bytecode-analysis.h" |
8 #include "src/interpreter/bytecode-array-builder.h" | 8 #include "src/interpreter/bytecode-array-builder.h" |
9 #include "src/interpreter/bytecode-array-iterator.h" | 9 #include "src/interpreter/bytecode-array-iterator.h" |
10 #include "src/interpreter/bytecode-decoder.h" | 10 #include "src/interpreter/bytecode-decoder.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 } | 51 } |
52 return out; | 52 return out; |
53 } | 53 } |
54 | 54 |
55 void EnsureLivenessMatches( | 55 void EnsureLivenessMatches( |
56 Handle<BytecodeArray> bytecode, | 56 Handle<BytecodeArray> bytecode, |
57 const std::vector<std::pair<std::string, std::string>>& | 57 const std::vector<std::pair<std::string, std::string>>& |
58 expected_liveness) { | 58 expected_liveness) { |
59 BytecodeAnalysis analysis(bytecode, zone(), true); | 59 BytecodeAnalysis analysis(bytecode, zone(), true); |
60 analysis.Analyze(); | 60 analysis.Analyze(BailoutId::None()); |
61 | 61 |
62 interpreter::BytecodeArrayIterator iterator(bytecode); | 62 interpreter::BytecodeArrayIterator iterator(bytecode); |
63 for (auto liveness : expected_liveness) { | 63 for (auto liveness : expected_liveness) { |
64 std::stringstream ss; | 64 std::stringstream ss; |
65 ss << std::setw(4) << iterator.current_offset() << " : "; | 65 ss << std::setw(4) << iterator.current_offset() << " : "; |
66 iterator.PrintTo(ss); | 66 iterator.PrintTo(ss); |
67 | 67 |
68 EXPECT_EQ(liveness.first, ToLivenessString(analysis.GetInLivenessFor( | 68 EXPECT_EQ(liveness.first, ToLivenessString(analysis.GetInLivenessFor( |
69 iterator.current_offset()))) | 69 iterator.current_offset()))) |
70 << " at bytecode " << ss.str(); | 70 << " at bytecode " << ss.str(); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 expected_liveness.emplace_back("...L", "...."); | 408 expected_liveness.emplace_back("...L", "...."); |
409 | 409 |
410 Handle<BytecodeArray> bytecode = builder.ToBytecodeArray(isolate()); | 410 Handle<BytecodeArray> bytecode = builder.ToBytecodeArray(isolate()); |
411 | 411 |
412 EnsureLivenessMatches(bytecode, expected_liveness); | 412 EnsureLivenessMatches(bytecode, expected_liveness); |
413 } | 413 } |
414 | 414 |
415 } // namespace compiler | 415 } // namespace compiler |
416 } // namespace internal | 416 } // namespace internal |
417 } // namespace v8 | 417 } // namespace v8 |
OLD | NEW |