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

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: Review feedback: Move RawLabel class. 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/interpreter-assembler.cc ('k') | src/compiler/raw-machine-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5969d653df7db0f8c0205f9204d4d1e2f3ea01c4 100644
--- a/src/compiler/raw-machine-assembler.h
+++ b/src/compiler/raw-machine-assembler.h
@@ -19,8 +19,10 @@ namespace internal {
namespace compiler {
class BasicBlock;
+class RawLabel;
class Schedule;
+
// 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 +36,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 +573,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 +613,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_; }
@@ -646,6 +635,20 @@ class RawMachineAssembler {
DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler);
};
+
+class RawLabel {
Benedikt Meurer 2015/11/28 19:51:30 Nit: Can we mark it as final?
vogelheim 2015/11/30 09:55:16 Done.
+ public:
+ RawLabel() : block_(NULL), used_(false), bound_(false) {}
Benedikt Meurer 2015/11/28 19:51:31 Nit: Can we put the implementation of both constru
vogelheim 2015/11/30 09:55:16 Done.
+ ~RawLabel() { DCHECK(bound_ || !used_); }
+
+ private:
+ BasicBlock* block_;
+ bool used_;
+ bool bound_;
+ friend class RawMachineAssembler;
+ DISALLOW_COPY_AND_ASSIGN(RawLabel);
+};
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/interpreter-assembler.cc ('k') | src/compiler/raw-machine-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698