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

Unified Diff: src/compiler/raw-machine-assembler.cc

Issue 1477413002: Move RMA::Label out of the class, so it can be forward declared. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: RawLabel -> RawMachineLabel Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/test-basic-block-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/raw-machine-assembler.cc
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc
index d658c294d9bdcf28feef6d5a09b330b39d2da5ca..b88fe8c4f07486b9ed93668d603a8b891990c3b9 100644
--- a/src/compiler/raw-machine-assembler.cc
+++ b/src/compiler/raw-machine-assembler.cc
@@ -51,15 +51,15 @@ Node* RawMachineAssembler::Parameter(size_t index) {
}
-void RawMachineAssembler::Goto(Label* label) {
+void RawMachineAssembler::Goto(RawMachineLabel* label) {
DCHECK(current_block_ != schedule()->end());
schedule()->AddGoto(CurrentBlock(), Use(label));
current_block_ = nullptr;
}
-void RawMachineAssembler::Branch(Node* condition, Label* true_val,
- Label* false_val) {
+void RawMachineAssembler::Branch(Node* condition, RawMachineLabel* true_val,
+ RawMachineLabel* false_val) {
DCHECK(current_block_ != schedule()->end());
Node* branch = AddNode(common()->Branch(), condition);
schedule()->AddBranch(CurrentBlock(), branch, Use(true_val), Use(false_val));
@@ -67,8 +67,9 @@ void RawMachineAssembler::Branch(Node* condition, Label* true_val,
}
-void RawMachineAssembler::Switch(Node* index, Label* default_label,
- int32_t* case_values, Label** case_labels,
+void RawMachineAssembler::Switch(Node* index, RawMachineLabel* default_label,
+ int32_t* case_values,
+ RawMachineLabel** case_labels,
size_t case_count) {
DCHECK_NE(schedule()->end(), current_block_);
size_t succ_count = case_count + 1;
@@ -292,7 +293,7 @@ Node* RawMachineAssembler::CallCFunction8(
}
-void RawMachineAssembler::Bind(Label* label) {
+void RawMachineAssembler::Bind(RawMachineLabel* label) {
DCHECK(current_block_ == nullptr);
DCHECK(!label->bound_);
label->bound_ = true;
@@ -300,13 +301,13 @@ void RawMachineAssembler::Bind(Label* label) {
}
-BasicBlock* RawMachineAssembler::Use(Label* label) {
+BasicBlock* RawMachineAssembler::Use(RawMachineLabel* label) {
label->used_ = true;
return EnsureBlock(label);
}
-BasicBlock* RawMachineAssembler::EnsureBlock(Label* label) {
+BasicBlock* RawMachineAssembler::EnsureBlock(RawMachineLabel* label) {
if (label->block_ == nullptr) label->block_ = schedule()->NewBasicBlock();
return label->block_;
}
@@ -335,6 +336,13 @@ Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
return graph()->NewNodeUnchecked(op, input_count, inputs);
}
+
+RawMachineLabel::RawMachineLabel()
+ : block_(NULL), used_(false), bound_(false) {}
+
+
+RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); }
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/test-basic-block-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698