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