Reviewers: Sven Panne,
Description:
[turbofan] Minor cleanup for JSGenericLowering.
Include what you use, and move implementation details to .cc file.
[email protected]
Please review this at https://codereview.chromium.org/986243002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+30, -15 lines):
M src/compiler/js-generic-lowering.h
M src/compiler/js-generic-lowering.cc
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc
b/src/compiler/js-generic-lowering.cc
index
42c5e56dce46e3fa7451fe5c1412a46f044170b1..3a9143e2c5c18e215bf799d9a232c86dbb5c3172
100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -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"
@@ -16,10 +17,6 @@ namespace v8 {
namespace internal {
namespace compiler {
-JSGenericLowering::JSGenericLowering(bool is_typing_enabled, JSGraph*
jsgraph)
- : is_typing_enabled_(is_typing_enabled), jsgraph_(jsgraph) {}
-
-
Reduction JSGenericLowering::Reduce(Node* node) {
switch (node->opcode()) {
#define DECLARE_CASE(x) \
@@ -514,6 +511,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
Index: src/compiler/js-generic-lowering.h
diff --git a/src/compiler/js-generic-lowering.h
b/src/compiler/js-generic-lowering.h
index
10057eb9e11207203931822b9f1f85cca676731c..422f0dd92d2a37d207a0280682812d5edd05e44f
100644
--- a/src/compiler/js-generic-lowering.h
+++ b/src/compiler/js-generic-lowering.h
@@ -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,7 +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(bool is_typing_enabled, JSGraph* jsgraph)
+ : is_typing_enabled_(is_typing_enabled), jsgraph_(jsgraph) {}
~JSGenericLowering() FINAL {}
Reduction Reduce(Node* node) FINAL;
@@ -46,16 +45,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
--
--
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.