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

Side by Side Diff: test/cctest/compiler/test-jump-threading.cc

Issue 951553005: [turbofan] remove dependence of InstructionBlock on BasicBlock (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "test/cctest/cctest.h" 6 #include "test/cctest/cctest.h"
7 7
8 #include "src/compiler/instruction.h" 8 #include "src/compiler/instruction.h"
9 #include "src/compiler/instruction-codes.h" 9 #include "src/compiler/instruction-codes.h"
10 #include "src/compiler/jump-threading.h" 10 #include "src/compiler/jump-threading.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 namespace compiler { 14 namespace compiler {
15 15
16 typedef BasicBlock::RpoNumber RpoNumber; 16 typedef RpoNumber RpoNumber;
Michael Starzinger 2015/02/25 14:59:37 nit: Redundant typedef is redundant.
dcarney 2015/02/25 16:08:26 Done.
17 17
18 class TestCode : public HandleAndZoneScope { 18 class TestCode : public HandleAndZoneScope {
19 public: 19 public:
20 TestCode() 20 TestCode()
21 : HandleAndZoneScope(), 21 : HandleAndZoneScope(),
22 blocks_(main_zone()), 22 blocks_(main_zone()),
23 sequence_(main_isolate(), main_zone(), &blocks_), 23 sequence_(main_isolate(), main_zone(), &blocks_),
24 rpo_number_(RpoNumber::FromInt(0)), 24 rpo_number_(RpoNumber::FromInt(0)),
25 current_(NULL) {} 25 current_(NULL) {}
26 26
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 sequence_.EndBlock(current_->rpo_number()); 80 sequence_.EndBlock(current_->rpo_number());
81 current_ = NULL; 81 current_ = NULL;
82 rpo_number_ = RpoNumber::FromInt(rpo_number_.ToInt() + 1); 82 rpo_number_ = RpoNumber::FromInt(rpo_number_.ToInt() + 1);
83 } 83 }
84 InstructionOperand UseRpo(int num) { 84 InstructionOperand UseRpo(int num) {
85 int index = sequence_.AddImmediate(Constant(RpoNumber::FromInt(num))); 85 int index = sequence_.AddImmediate(Constant(RpoNumber::FromInt(num)));
86 return ImmediateOperand(index); 86 return ImmediateOperand(index);
87 } 87 }
88 void Start(bool deferred = false) { 88 void Start(bool deferred = false) {
89 if (current_ == NULL) { 89 if (current_ == NULL) {
90 current_ = new (main_zone()) InstructionBlock( 90 current_ = new (main_zone())
91 main_zone(), BasicBlock::Id::FromInt(rpo_number_.ToInt()), 91 InstructionBlock(main_zone(), rpo_number_, RpoNumber::Invalid(),
92 rpo_number_, RpoNumber::Invalid(), RpoNumber::Invalid(), deferred); 92 RpoNumber::Invalid(), deferred);
93 blocks_.push_back(current_); 93 blocks_.push_back(current_);
94 sequence_.StartBlock(rpo_number_); 94 sequence_.StartBlock(rpo_number_);
95 } 95 }
96 } 96 }
97 void Defer() { 97 void Defer() {
98 CHECK(current_ == NULL); 98 CHECK(current_ == NULL);
99 Start(true); 99 Start(true);
100 } 100 }
101 }; 101 };
102 102
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 for (int k = 4; k < 5; k++) assembly[k]--; 755 for (int k = 4; k < 5; k++) assembly[k]--;
756 } 756 }
757 CheckAssemblyOrder(code, 5, assembly); 757 CheckAssemblyOrder(code, 5, assembly);
758 } 758 }
759 } 759 }
760 } 760 }
761 761
762 } // namespace compiler 762 } // namespace compiler
763 } // namespace internal 763 } // namespace internal
764 } // namespace v8 764 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698