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

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

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: 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
Index: src/compiler/raw-machine-assembler.h
diff --git a/src/compiler/raw-machine-assembler.h b/src/compiler/raw-machine-assembler.h
index d48c24d616f16e9a9b984d9e1eafe05d992b6305..1858258fbd7ef1fa0ab49f86e2b89e6130bf0a08 100644
--- a/src/compiler/raw-machine-assembler.h
+++ b/src/compiler/raw-machine-assembler.h
@@ -21,6 +21,21 @@ namespace compiler {
class BasicBlock;
class Schedule;
+
+class RawLabel {
Michael Starzinger 2015/11/27 17:10:27 super-nit: Can we move this class down to the bott
vogelheim 2015/11/27 17:21:14 Done.
+ public:
+ RawLabel() : block_(NULL), used_(false), bound_(false) {}
+ ~RawLabel() { DCHECK(bound_ || !used_); }
+
+ private:
+ BasicBlock* block_;
+ bool used_;
+ bool bound_;
+ friend class RawMachineAssembler;
+ DISALLOW_COPY_AND_ASSIGN(RawLabel);
+};
+
+
// The RawMachineAssembler produces a low-level IR graph. All nodes are wired
// into a graph and also placed into a schedule immediately, hence subsequent
// code generation can happen without the need for scheduling.
@@ -34,19 +49,6 @@ class Schedule;
// non-schedulable due to missing control and effect dependencies.
class RawMachineAssembler {
public:
- class Label {
- public:
- Label() : block_(NULL), used_(false), bound_(false) {}
- ~Label() { DCHECK(bound_ || !used_); }
-
- private:
- BasicBlock* block_;
- bool used_;
- bool bound_;
- friend class RawMachineAssembler;
- DISALLOW_COPY_AND_ASSIGN(Label);
- };
-
RawMachineAssembler(Isolate* isolate, Graph* graph,
CallDescriptor* call_descriptor,
MachineType word = kMachPtr,
@@ -584,14 +586,14 @@ class RawMachineAssembler {
// the current basic block or create new basic blocks for labels.
// Control flow.
- void Goto(Label* label);
- void Branch(Node* condition, Label* true_val, Label* false_val);
- void Switch(Node* index, Label* default_label, int32_t* case_values,
- Label** case_labels, size_t case_count);
+ void Goto(RawLabel* label);
+ void Branch(Node* condition, RawLabel* true_val, RawLabel* false_val);
+ void Switch(Node* index, RawLabel* default_label, int32_t* case_values,
+ RawLabel** case_labels, size_t case_count);
void Return(Node* value);
void Return(Node* v1, Node* v2);
void Return(Node* v1, Node* v2, Node* v3);
- void Bind(Label* label);
+ void Bind(RawLabel* label);
void Deoptimize(Node* state);
// Variables.
@@ -624,8 +626,8 @@ class RawMachineAssembler {
private:
Node* MakeNode(const Operator* op, int input_count, Node** inputs);
- BasicBlock* Use(Label* label);
- BasicBlock* EnsureBlock(Label* label);
+ BasicBlock* Use(RawLabel* label);
+ BasicBlock* EnsureBlock(RawLabel* label);
BasicBlock* CurrentBlock();
Schedule* schedule() { return schedule_; }

Powered by Google App Engine
This is Rietveld 408576698