[turbofan] MachineOperatorReducer uses MachineGraph

R=mstarzinger@chromium.org

Bug: v8:7721
Change-Id: I8fd2c532c36bfd5faec2947d3154a2984c13ed46
Reviewed-on: https://chromium-review.googlesource.com/1047668
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53042}
This commit is contained in:
Ben L. Titzer 2018-05-07 18:18:55 +02:00 committed by Commit Bot
parent 23652c5f4c
commit 6e2f6a6c44
2 changed files with 13 additions and 14 deletions

View File

@ -9,17 +9,18 @@
#include "src/base/ieee754.h"
#include "src/compiler/diamond.h"
#include "src/compiler/graph.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/machine-graph.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
#include "src/conversions-inl.h"
namespace v8 {
namespace internal {
namespace compiler {
MachineOperatorReducer::MachineOperatorReducer(JSGraph* jsgraph,
MachineOperatorReducer::MachineOperatorReducer(MachineGraph* mcgraph,
bool allow_signalling_nan)
: jsgraph_(jsgraph), allow_signalling_nan_(allow_signalling_nan) {}
: mcgraph_(mcgraph), allow_signalling_nan_(allow_signalling_nan) {}
MachineOperatorReducer::~MachineOperatorReducer() {}
@ -30,12 +31,12 @@ Node* MachineOperatorReducer::Float32Constant(volatile float value) {
Node* MachineOperatorReducer::Float64Constant(volatile double value) {
return jsgraph()->Float64Constant(value);
return mcgraph()->Float64Constant(value);
}
Node* MachineOperatorReducer::Int32Constant(int32_t value) {
return jsgraph()->Int32Constant(value);
return mcgraph()->Int32Constant(value);
}
@ -1424,16 +1425,15 @@ Reduction MachineOperatorReducer::ReduceFloat64RoundDown(Node* node) {
}
CommonOperatorBuilder* MachineOperatorReducer::common() const {
return jsgraph()->common();
return mcgraph()->common();
}
MachineOperatorBuilder* MachineOperatorReducer::machine() const {
return jsgraph()->machine();
return mcgraph()->machine();
}
Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); }
Graph* MachineOperatorReducer::graph() const { return mcgraph()->graph(); }
} // namespace compiler
} // namespace internal

View File

@ -16,15 +16,14 @@ namespace compiler {
// Forward declarations.
class CommonOperatorBuilder;
class JSGraph;
class MachineGraph;
// Performs constant folding and strength reduction on nodes that have
// machine operators.
class V8_EXPORT_PRIVATE MachineOperatorReducer final
: public NON_EXPORTED_BASE(Reducer) {
public:
explicit MachineOperatorReducer(JSGraph* jsgraph,
explicit MachineOperatorReducer(MachineGraph* mcgraph,
bool allow_signalling_nan = true);
~MachineOperatorReducer();
@ -102,11 +101,11 @@ class V8_EXPORT_PRIVATE MachineOperatorReducer final
Reduction ReduceFloat64RoundDown(Node* node);
Graph* graph() const;
JSGraph* jsgraph() const { return jsgraph_; }
MachineGraph* mcgraph() const { return mcgraph_; }
CommonOperatorBuilder* common() const;
MachineOperatorBuilder* machine() const;
JSGraph* jsgraph_;
MachineGraph* mcgraph_;
bool allow_signalling_nan_;
};