Cleanup and simplify TurboFan generic lowering.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/565893002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c90c951b
This diff is collapsed.
......@@ -13,7 +13,6 @@
#include "src/compiler/graph-reducer.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/opcodes.h"
#include "src/unique.h"
namespace v8 {
namespace internal {
......@@ -27,15 +26,14 @@ class Linkage;
// Lowers JS-level operators to runtime and IC calls in the "generic" case.
class JSGenericLowering : public Reducer {
public:
JSGenericLowering(CompilationInfo* info, JSGraph* graph,
MachineOperatorBuilder* machine);
JSGenericLowering(CompilationInfo* info, JSGraph* graph);
virtual ~JSGenericLowering() {}
virtual Reduction Reduce(Node* node);
protected:
// Dispatched depending on opcode.
#define DECLARE_LOWER(x) Node* Lower##x(Node* node);
#define DECLARE_LOWER(x) void Lower##x(Node* node);
// Dispatched depending on opcode.
ALL_OP_LIST(DECLARE_LOWER)
#undef DECLARE_LOWER
......@@ -52,8 +50,7 @@ class JSGenericLowering : public Reducer {
// Helpers to replace existing nodes with a generic call.
void ReplaceWithCompareIC(Node* node, Token::Value token, bool pure);
void ReplaceWithStubCall(Node* node, Callable callable,
CallDescriptor::Flags flags);
void ReplaceWithStubCall(Node* node, Callable c, CallDescriptor::Flags flags);
void ReplaceWithBuiltinCall(Node* node, Builtins::JavaScript id, int args);
void ReplaceWithRuntimeCall(Node* node, Runtime::FunctionId f, int args = -1);
......@@ -64,13 +61,12 @@ class JSGenericLowering : public Reducer {
Linkage* linkage() const { return linkage_; }
CompilationInfo* info() const { return info_; }
CommonOperatorBuilder* common() const { return jsgraph()->common(); }
MachineOperatorBuilder* machine() const { return machine_; }
MachineOperatorBuilder* machine() const { return jsgraph()->machine(); }
private:
CompilationInfo* info_;
JSGraph* jsgraph_;
Linkage* linkage_;
MachineOperatorBuilder* machine_;
SetOncePointer<Node> centrystub_constant_;
};
......
......@@ -282,7 +282,7 @@ Handle<Code> Pipeline::GenerateCode() {
"generic lowering");
SourcePositionTable::Scope pos(&source_positions,
SourcePosition::Unknown());
JSGenericLowering lowering(info(), &jsgraph, &machine);
JSGenericLowering lowering(info(), &jsgraph);
GraphReducer graph_reducer(&graph);
graph_reducer.AddReducer(&lowering);
graph_reducer.ReduceGraph();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment