Revision: 23982
Author:   [email protected]
Date:     Tue Sep 16 16:20:10 2014 UTC
Log:      Avoid usage of temporary MachineOperatorBuilder.

[email protected]

Review URL: https://codereview.chromium.org/562203004
https://code.google.com/p/v8/source/detail?r=23982

Modified:
 /branches/bleeding_edge/src/compiler/ast-graph-builder.cc
 /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc
 /branches/bleeding_edge/src/compiler/change-lowering.cc
 /branches/bleeding_edge/src/compiler/change-lowering.h
 /branches/bleeding_edge/src/compiler/js-typed-lowering.h
 /branches/bleeding_edge/src/compiler/machine-operator-reducer.cc
 /branches/bleeding_edge/src/compiler/machine-operator-reducer.h
 /branches/bleeding_edge/src/compiler/pipeline.cc
 /branches/bleeding_edge/src/compiler/representation-change.h
 /branches/bleeding_edge/src/compiler/simplified-lowering.cc
 /branches/bleeding_edge/src/compiler/simplified-lowering.h
/branches/bleeding_edge/src/compiler/simplified-operator-reducer-unittest.cc
 /branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc
 /branches/bleeding_edge/src/compiler/simplified-operator-reducer.h
 /branches/bleeding_edge/test/cctest/compiler/test-changes-lowering.cc
 /branches/bleeding_edge/test/cctest/compiler/test-representation-change.cc

=======================================
--- /branches/bleeding_edge/src/compiler/ast-graph-builder.cc Mon Sep 15 09:21:39 2014 UTC +++ /branches/bleeding_edge/src/compiler/ast-graph-builder.cc Tue Sep 16 16:20:10 2014 UTC
@@ -1931,9 +1931,8 @@

 Node* AstGraphBuilder::BuildLoadObjectField(Node* object, int offset) {
   // TODO(sigurds) Use simplified load here once it is ready.
-  MachineOperatorBuilder machine;
-  Node* field_load = NewNode(machine.Load(kMachAnyTagged), object,
- jsgraph_->Int32Constant(offset - kHeapObjectTag)); + Node* field_load = NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, + jsgraph()->Int32Constant(offset - kHeapObjectTag));
   return field_load;
 }

=======================================
--- /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc Fri Sep 12 11:06:37 2014 UTC +++ /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc Tue Sep 16 16:20:10 2014 UTC
@@ -79,7 +79,7 @@
     JSGraph jsgraph(graph(), common(), &javascript, &typer, &machine);
     CompilationInfo info(isolate(), zone());
     Linkage linkage(&info);
-    ChangeLowering reducer(&jsgraph, &linkage, &machine);
+    ChangeLowering reducer(&jsgraph, &linkage);
     return reducer.Reduce(node);
   }

=======================================
--- /branches/bleeding_edge/src/compiler/change-lowering.cc Thu Sep 11 10:37:49 2014 UTC +++ /branches/bleeding_edge/src/compiler/change-lowering.cc Tue Sep 16 16:20:10 2014 UTC
@@ -245,6 +245,11 @@
 CommonOperatorBuilder* ChangeLowering::common() const {
   return jsgraph()->common();
 }
+
+
+MachineOperatorBuilder* ChangeLowering::machine() const {
+  return jsgraph()->machine();
+}

 }  // namespace compiler
 }  // namespace internal
=======================================
--- /branches/bleeding_edge/src/compiler/change-lowering.h Tue Sep 2 07:07:52 2014 UTC +++ /branches/bleeding_edge/src/compiler/change-lowering.h Tue Sep 16 16:20:10 2014 UTC
@@ -19,9 +19,8 @@

 class ChangeLowering FINAL : public Reducer {
  public:
-  ChangeLowering(JSGraph* jsgraph, Linkage* linkage,
-                 MachineOperatorBuilder* machine)
-      : jsgraph_(jsgraph), linkage_(linkage), machine_(machine) {}
+  ChangeLowering(JSGraph* jsgraph, Linkage* linkage)
+      : jsgraph_(jsgraph), linkage_(linkage) {}
   virtual ~ChangeLowering();

   virtual Reduction Reduce(Node* node) OVERRIDE;
@@ -50,11 +49,10 @@
   JSGraph* jsgraph() const { return jsgraph_; }
   Linkage* linkage() const { return linkage_; }
   CommonOperatorBuilder* common() const;
-  MachineOperatorBuilder* machine() const { return machine_; }
+  MachineOperatorBuilder* machine() const;

   JSGraph* jsgraph_;
   Linkage* linkage_;
-  MachineOperatorBuilder* machine_;
 };

 }  // namespace compiler
=======================================
--- /branches/bleeding_edge/src/compiler/js-typed-lowering.h Thu Sep 11 16:09:21 2014 UTC +++ /branches/bleeding_edge/src/compiler/js-typed-lowering.h Tue Sep 16 16:20:10 2014 UTC
@@ -51,11 +51,10 @@
   JSOperatorBuilder* javascript() { return jsgraph_->javascript(); }
   CommonOperatorBuilder* common() { return jsgraph_->common(); }
   SimplifiedOperatorBuilder* simplified() { return &simplified_; }
-  MachineOperatorBuilder* machine() { return &machine_; }
+  MachineOperatorBuilder* machine() { return jsgraph_->machine(); }

   JSGraph* jsgraph_;
   SimplifiedOperatorBuilder simplified_;
-  MachineOperatorBuilder machine_;
 };

 }  // namespace compiler
=======================================
--- /branches/bleeding_edge/src/compiler/machine-operator-reducer.cc Thu Sep 11 10:37:49 2014 UTC +++ /branches/bleeding_edge/src/compiler/machine-operator-reducer.cc Tue Sep 16 16:20:10 2014 UTC
@@ -475,6 +475,11 @@
 CommonOperatorBuilder* MachineOperatorReducer::common() const {
   return jsgraph()->common();
 }
+
+
+MachineOperatorBuilder* MachineOperatorReducer::machine() const {
+  return jsgraph()->machine();
+}


 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); }
=======================================
--- /branches/bleeding_edge/src/compiler/machine-operator-reducer.h Tue Sep 9 14:18:17 2014 UTC +++ /branches/bleeding_edge/src/compiler/machine-operator-reducer.h Tue Sep 16 16:20:10 2014 UTC
@@ -47,10 +47,9 @@
   Graph* graph() const;
   JSGraph* jsgraph() const { return jsgraph_; }
   CommonOperatorBuilder* common() const;
-  MachineOperatorBuilder* machine() { return &machine_; }
+  MachineOperatorBuilder* machine() const;

   JSGraph* jsgraph_;
-  MachineOperatorBuilder machine_;
 };

 }  // namespace compiler
=======================================
--- /branches/bleeding_edge/src/compiler/pipeline.cc Fri Sep 12 14:49:07 2014 UTC +++ /branches/bleeding_edge/src/compiler/pipeline.cc Tue Sep 16 16:20:10 2014 UTC
@@ -259,8 +259,8 @@
                                      SourcePosition::Unknown());
       Linkage linkage(info());
       ValueNumberingReducer vn_reducer(zone());
-      SimplifiedOperatorReducer simple_reducer(&jsgraph, &machine);
-      ChangeLowering lowering(&jsgraph, &linkage, &machine);
+      SimplifiedOperatorReducer simple_reducer(&jsgraph);
+      ChangeLowering lowering(&jsgraph, &linkage);
       MachineOperatorReducer mach_reducer(&jsgraph);
       GraphReducer graph_reducer(&graph);
// TODO(titzer): Figure out if we should run all reducers at once here.
=======================================
--- /branches/bleeding_edge/src/compiler/representation-change.h Wed Sep 10 12:23:45 2014 UTC +++ /branches/bleeding_edge/src/compiler/representation-change.h Tue Sep 16 16:20:10 2014 UTC
@@ -21,10 +21,9 @@
 class RepresentationChanger {
  public:
RepresentationChanger(JSGraph* jsgraph, SimplifiedOperatorBuilder* simplified,
-                        MachineOperatorBuilder* machine, Isolate* isolate)
+                        Isolate* isolate)
       : jsgraph_(jsgraph),
         simplified_(simplified),
-        machine_(machine),
         isolate_(isolate),
         testing_type_errors_(false),
         type_error_(false) {}
@@ -309,7 +308,6 @@
  private:
   JSGraph* jsgraph_;
   SimplifiedOperatorBuilder* simplified_;
-  MachineOperatorBuilder* machine_;
   Isolate* isolate_;

   friend class RepresentationChangerTester;  // accesses the below fields.
@@ -339,7 +337,7 @@
   JSGraph* jsgraph() { return jsgraph_; }
   Isolate* isolate() { return isolate_; }
   SimplifiedOperatorBuilder* simplified() { return simplified_; }
-  MachineOperatorBuilder* machine() { return machine_; }
+  MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
 };
 }
 }
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-lowering.cc Thu Sep 11 13:18:58 2014 UTC +++ /branches/bleeding_edge/src/compiler/simplified-lowering.cc Tue Sep 16 16:20:10 2014 UTC
@@ -764,7 +764,7 @@

 void SimplifiedLowering::LowerAllNodes() {
   SimplifiedOperatorBuilder simplified(graph()->zone());
-  RepresentationChanger changer(jsgraph(), &simplified, machine(),
+  RepresentationChanger changer(jsgraph(), &simplified,
                                 graph()->zone()->isolate());
   RepresentationSelector selector(jsgraph(), zone(), &changer);
   selector.Run(this);
@@ -805,7 +805,7 @@

 void SimplifiedLowering::DoLoadField(Node* node) {
   const FieldAccess& access = FieldAccessOf(node->op());
-  node->set_op(machine_.Load(access.machine_type));
+  node->set_op(machine()->Load(access.machine_type));
   Node* offset = jsgraph()->Int32Constant(access.offset - access.tag());
   node->InsertInput(zone(), 1, offset);
 }
@@ -815,7 +815,8 @@
   const FieldAccess& access = FieldAccessOf(node->op());
   WriteBarrierKind kind = ComputeWriteBarrierKind(
       access.base_is_tagged, access.machine_type, access.type);
- node->set_op(machine_.Store(StoreRepresentation(access.machine_type, kind)));
+  node->set_op(
+      machine()->Store(StoreRepresentation(access.machine_type, kind)));
   Node* offset = jsgraph()->Int32Constant(access.offset - access.tag());
   node->InsertInput(zone(), 1, offset);
 }
@@ -837,7 +838,7 @@

 void SimplifiedLowering::DoLoadElement(Node* node) {
   const ElementAccess& access = ElementAccessOf(node->op());
-  node->set_op(machine_.Load(access.machine_type));
+  node->set_op(machine()->Load(access.machine_type));
   node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1)));
 }

@@ -846,7 +847,8 @@
   const ElementAccess& access = ElementAccessOf(node->op());
   WriteBarrierKind kind = ComputeWriteBarrierKind(
       access.base_is_tagged, access.machine_type, access.type);
- node->set_op(machine_.Store(StoreRepresentation(access.machine_type, kind)));
+  node->set_op(
+      machine()->Store(StoreRepresentation(access.machine_type, kind)));
   node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1)));
 }

=======================================
--- /branches/bleeding_edge/src/compiler/simplified-lowering.h Thu Sep 11 10:37:49 2014 UTC +++ /branches/bleeding_edge/src/compiler/simplified-lowering.h Tue Sep 16 16:20:10 2014 UTC
@@ -33,7 +33,6 @@

  private:
   JSGraph* jsgraph_;
-  MachineOperatorBuilder machine_;

   Node* SmiTag(Node* node);
   Node* IsTagged(Node* node);
@@ -48,7 +47,7 @@
   JSGraph* jsgraph() { return jsgraph_; }
   Graph* graph() { return jsgraph()->graph(); }
   CommonOperatorBuilder* common() { return jsgraph()->common(); }
-  MachineOperatorBuilder* machine() { return &machine_; }
+  MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
 };

 }  // namespace compiler
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-operator-reducer-unittest.cc Mon Sep 15 09:09:45 2014 UTC +++ /branches/bleeding_edge/src/compiler/simplified-operator-reducer-unittest.cc Tue Sep 16 16:20:10 2014 UTC
@@ -25,7 +25,7 @@
     MachineOperatorBuilder machine;
     JSOperatorBuilder javascript(zone());
     JSGraph jsgraph(graph(), common(), &javascript, &typer, &machine);
-    SimplifiedOperatorReducer reducer(&jsgraph, &machine);
+    SimplifiedOperatorReducer reducer(&jsgraph);
     return reducer.Reduce(node);
   }

=======================================
--- /branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc Wed Sep 10 12:23:45 2014 UTC +++ /branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc Tue Sep 16 16:20:10 2014 UTC
@@ -136,6 +136,11 @@
 Factory* SimplifiedOperatorReducer::factory() const {
   return jsgraph()->isolate()->factory();
 }
+
+
+MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const {
+  return jsgraph()->machine();
+}

 }  // namespace compiler
 }  // namespace internal
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-operator-reducer.h Wed Sep 10 12:23:45 2014 UTC +++ /branches/bleeding_edge/src/compiler/simplified-operator-reducer.h Tue Sep 16 16:20:10 2014 UTC
@@ -21,8 +21,7 @@

 class SimplifiedOperatorReducer FINAL : public Reducer {
  public:
- SimplifiedOperatorReducer(JSGraph* jsgraph, MachineOperatorBuilder* machine)
-      : jsgraph_(jsgraph), machine_(machine) {}
+ explicit SimplifiedOperatorReducer(JSGraph* jsgraph) : jsgraph_(jsgraph) {}
   virtual ~SimplifiedOperatorReducer();

   virtual Reduction Reduce(Node* node) OVERRIDE;
@@ -40,10 +39,9 @@
   Graph* graph() const;
   Factory* factory() const;
   JSGraph* jsgraph() const { return jsgraph_; }
-  MachineOperatorBuilder* machine() const { return machine_; }
+  MachineOperatorBuilder* machine() const;

   JSGraph* jsgraph_;
-  MachineOperatorBuilder* machine_;

   DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorReducer);
 };
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-changes-lowering.cc Fri Sep 12 11:06:37 2014 UTC +++ /branches/bleeding_edge/test/cctest/compiler/test-changes-lowering.cc Tue Sep 16 16:20:10 2014 UTC
@@ -149,7 +149,7 @@
     // Run the graph reducer with changes lowering on a single node.
     CompilationInfo info(this->isolate(), this->zone());
     Linkage linkage(&info);
-    ChangeLowering lowering(&jsgraph, &linkage, this->machine());
+    ChangeLowering lowering(&jsgraph, &linkage);
     GraphReducer reducer(this->graph());
     reducer.AddReducer(&lowering);
     reducer.ReduceNode(change);
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-representation-change.cc Fri Sep 12 11:06:37 2014 UTC +++ /branches/bleeding_edge/test/cctest/compiler/test-representation-change.cc Tue Sep 16 16:20:10 2014 UTC
@@ -28,7 +28,7 @@
         javascript_(main_zone()),
         jsgraph_(main_graph_, &main_common_, &javascript_, &typer_,
                  &main_machine_),
- changer_(&jsgraph_, &main_simplified_, &main_machine_, main_isolate()) {
+        changer_(&jsgraph_, &main_simplified_, main_isolate()) {
     Node* s = graph()->NewNode(common()->Start(num_parameters));
     graph()->SetStart(s);
   }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to