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

Side by Side Diff: test/unittests/compiler/bytecode-analysis-unittest.cc

Issue 2552723004: [ignition/turbofan] Wrap bytecode liveness bitvectors (Closed)
Patch Set: Created 4 years 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/compiler/bytecode-liveness-map.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19 matching lines...) Expand all
30 30
31 TestWithIsolateAndZone::SetUpTestCase(); 31 TestWithIsolateAndZone::SetUpTestCase();
32 } 32 }
33 33
34 static void TearDownTestCase() { 34 static void TearDownTestCase() {
35 TestWithIsolateAndZone::TearDownTestCase(); 35 TestWithIsolateAndZone::TearDownTestCase();
36 i::FLAG_ignition_peephole = old_FLAG_ignition_peephole_; 36 i::FLAG_ignition_peephole = old_FLAG_ignition_peephole_;
37 i::FLAG_ignition_reo = old_FLAG_ignition_reo_; 37 i::FLAG_ignition_reo = old_FLAG_ignition_reo_;
38 } 38 }
39 39
40 std::string ToLivenessString(const BitVector* liveness) const { 40 std::string ToLivenessString(const BytecodeLivenessState* liveness) const {
41 const BitVector& bit_vector = liveness->bit_vector();
42
41 std::string out; 43 std::string out;
42 out.resize(liveness->length()); 44 out.resize(bit_vector.length());
43 for (int i = 0; i < liveness->length(); ++i) { 45 for (int i = 0; i < bit_vector.length(); ++i) {
44 if (liveness->Contains(i)) { 46 if (bit_vector.Contains(i)) {
45 out[i] = 'L'; 47 out[i] = 'L';
46 } else { 48 } else {
47 out[i] = '.'; 49 out[i] = '.';
48 } 50 }
49 } 51 }
50 return out; 52 return out;
51 } 53 }
52 54
53 void EnsureLivenessMatches( 55 void EnsureLivenessMatches(
54 Handle<BytecodeArray> bytecode, 56 Handle<BytecodeArray> bytecode,
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 expected_liveness.emplace_back("...L", "...."); 408 expected_liveness.emplace_back("...L", "....");
407 409
408 Handle<BytecodeArray> bytecode = builder.ToBytecodeArray(isolate()); 410 Handle<BytecodeArray> bytecode = builder.ToBytecodeArray(isolate());
409 411
410 EnsureLivenessMatches(bytecode, expected_liveness); 412 EnsureLivenessMatches(bytecode, expected_liveness);
411 } 413 }
412 414
413 } // namespace compiler 415 } // namespace compiler
414 } // namespace internal 416 } // namespace internal
415 } // namespace v8 417 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bytecode-liveness-map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698