Commit 5abc724e authored by Benedikt Meurer's avatar Benedikt Meurer

[turbofan] Minor cleanup for JSGenericLowering.

Include what you use, and move implementation details to .cc file.

R=svenpanne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#27062}
parent 47154aa8
......@@ -6,6 +6,7 @@
#include "src/code-stubs.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/js-generic-lowering.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-matchers.h"
#include "src/compiler/node-properties.h"
......@@ -20,6 +21,9 @@ JSGenericLowering::JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph)
: is_typing_enabled_(is_typing_enabled), jsgraph_(jsgraph) {}
JSGenericLowering::~JSGenericLowering() {}
Reduction JSGenericLowering::Reduce(Node* node) {
switch (node->opcode()) {
#define DECLARE_CASE(x) \
......@@ -528,6 +532,25 @@ void JSGenericLowering::LowerJSStackCheck(Node* node) {
ReplaceWithRuntimeCall(node, Runtime::kStackGuard);
}
Zone* JSGenericLowering::zone() const { return graph()->zone(); }
Isolate* JSGenericLowering::isolate() const { return jsgraph()->isolate(); }
Graph* JSGenericLowering::graph() const { return jsgraph()->graph(); }
CommonOperatorBuilder* JSGenericLowering::common() const {
return jsgraph()->common();
}
MachineOperatorBuilder* JSGenericLowering::machine() const {
return jsgraph()->machine();
}
} // namespace compiler
} // namespace internal
} // namespace v8
......@@ -5,11 +5,8 @@
#ifndef V8_COMPILER_JS_GENERIC_LOWERING_H_
#define V8_COMPILER_JS_GENERIC_LOWERING_H_
#include "src/allocation.h"
#include "src/code-factory.h"
#include "src/compiler/graph.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/linkage.h"
#include "src/compiler/opcodes.h"
......@@ -19,6 +16,7 @@ namespace compiler {
// Forward declarations.
class CommonOperatorBuilder;
class JSGraph;
class MachineOperatorBuilder;
class Linkage;
......@@ -26,8 +24,8 @@ class Linkage;
// Lowers JS-level operators to runtime and IC calls in the "generic" case.
class JSGenericLowering FINAL : public Reducer {
public:
JSGenericLowering(bool is_typing_enabled, JSGraph* graph);
~JSGenericLowering() FINAL {}
JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph);
~JSGenericLowering() FINAL;
Reduction Reduce(Node* node) FINAL;
......@@ -46,16 +44,16 @@ class JSGenericLowering FINAL : public Reducer {
// Helper for optimization of JSCallFunction.
bool TryLowerDirectJSCall(Node* node);
Zone* zone() const { return graph()->zone(); }
Isolate* isolate() const { return jsgraph()->isolate(); }
Zone* zone() const;
Isolate* isolate() const;
JSGraph* jsgraph() const { return jsgraph_; }
Graph* graph() const { return jsgraph()->graph(); }
CommonOperatorBuilder* common() const { return jsgraph()->common(); }
MachineOperatorBuilder* machine() const { return jsgraph()->machine(); }
Graph* graph() const;
CommonOperatorBuilder* common() const;
MachineOperatorBuilder* machine() const;
private:
bool is_typing_enabled_;
JSGraph* jsgraph_;
bool const is_typing_enabled_;
JSGraph* const jsgraph_;
};
} // namespace compiler
......
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