Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Unified Diff: src/compiler/change-lowering.h

Issue 480863002: Refactor ChangeLowering class to avoid template specialization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/change-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.h
diff --git a/src/compiler/change-lowering.h b/src/compiler/change-lowering.h
index 3e16d800de73f76b3afa83c5692a4c783977444f..93ba14206203aa754b89370f3a6b50c4a7c8a7c0 100644
--- a/src/compiler/change-lowering.h
+++ b/src/compiler/change-lowering.h
@@ -5,71 +5,47 @@
#ifndef V8_COMPILER_CHANGE_LOWERING_H_
#define V8_COMPILER_CHANGE_LOWERING_H_
-#include "include/v8.h"
-#include "src/compiler/common-operator.h"
#include "src/compiler/graph-reducer.h"
-#include "src/compiler/machine-operator.h"
namespace v8 {
namespace internal {
namespace compiler {
// Forward declarations.
-class CommonNodeCache;
+class CommonOperatorBuilder;
+class JSGraph;
class Linkage;
+class MachineOperatorBuilder;
-class ChangeLoweringBase : public Reducer {
+class ChangeLowering V8_FINAL : public Reducer {
public:
- ChangeLoweringBase(Graph* graph, Linkage* linkage, CommonNodeCache* cache);
- virtual ~ChangeLoweringBase();
+ ChangeLowering(JSGraph* jsgraph, Linkage* linkage,
+ MachineOperatorBuilder* machine)
+ : jsgraph_(jsgraph), linkage_(linkage), machine_(machine) {}
+ virtual ~ChangeLowering();
+
+ virtual Reduction Reduce(Node* node) V8_OVERRIDE;
protected:
- Node* ExternalConstant(ExternalReference reference);
- Node* HeapConstant(PrintableUnique<HeapObject> value);
- Node* ImmovableHeapConstant(Handle<HeapObject> value);
- Node* Int32Constant(int32_t value);
- Node* NumberConstant(double value);
- Node* CEntryStubConstant();
- Node* TrueConstant();
- Node* FalseConstant();
+ Node* HeapNumberValueIndexConstant();
+ Node* SmiShiftBitsConstant();
Reduction ChangeBitToBool(Node* val, Node* control);
+ Reduction ChangeBoolToBit(Node* val);
+ Reduction ChangeInt32ToTagged(Node* val, Node* effect, Node* control);
+ Reduction ChangeTaggedToFloat64(Node* val, Node* effect, Node* control);
- Graph* graph() const { return graph_; }
- Isolate* isolate() const { return isolate_; }
+ Graph* graph() const;
+ Isolate* isolate() const;
+ JSGraph* jsgraph() const { return jsgraph_; }
Linkage* linkage() const { return linkage_; }
- CommonNodeCache* cache() const { return cache_; }
- CommonOperatorBuilder* common() { return &common_; }
- MachineOperatorBuilder* machine() { return &machine_; }
+ CommonOperatorBuilder* common() const;
+ MachineOperatorBuilder* machine() const { return machine_; }
private:
- Graph* graph_;
- Isolate* isolate_;
+ JSGraph* jsgraph_;
Linkage* linkage_;
- CommonNodeCache* cache_;
- CommonOperatorBuilder common_;
- MachineOperatorBuilder machine_;
-
- SetOncePointer<Node> c_entry_stub_constant_;
- SetOncePointer<Node> true_constant_;
- SetOncePointer<Node> false_constant_;
-};
-
-
-template <size_t kPointerSize = kApiPointerSize>
-class ChangeLowering V8_FINAL : public ChangeLoweringBase {
- public:
- ChangeLowering(Graph* graph, Linkage* linkage);
- ChangeLowering(Graph* graph, Linkage* linkage, CommonNodeCache* cache)
- : ChangeLoweringBase(graph, linkage, cache) {}
- virtual ~ChangeLowering() {}
-
- virtual Reduction Reduce(Node* node) V8_OVERRIDE;
-
- private:
- Reduction ChangeBoolToBit(Node* val);
- Reduction ChangeInt32ToTagged(Node* val, Node* effect, Node* control);
- Reduction ChangeTaggedToFloat64(Node* val, Node* effect, Node* control);
+ MachineOperatorBuilder* machine_;
};
} // namespace compiler
« no previous file with comments | « no previous file | src/compiler/change-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698