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

Side by Side Diff: src/compiler/change-lowering.h

Issue 460593003: Initial import of ChangeLowering. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/compiler/change-lowering.cc » ('j') | src/compiler/change-lowering.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_COMPILER_CHANGE_LOWERING_H_
6 #define V8_COMPILER_CHANGE_LOWERING_H_
7
8 #include "include/v8.h"
9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/graph-reducer.h"
11 #include "src/compiler/machine-operator.h"
12
13 namespace v8 {
14 namespace internal {
15 namespace compiler {
16
17 // Forward declarations.
18 class CommonNodeCache;
19 class Linkage;
20
21 class ChangeLoweringBase : public Reducer {
22 public:
23 ChangeLoweringBase(Graph* graph, Linkage* linkage, CommonNodeCache* cache);
24 virtual ~ChangeLoweringBase();
25
26 protected:
27 Node* ExternalConstant(ExternalReference reference);
28 Node* HeapConstant(PrintableUnique<HeapObject> value);
29 Node* ImmovableHeapConstant(Handle<HeapObject> value);
30 Node* Int32Constant(int32_t value);
31 Node* NumberConstant(double value);
32 Node* CEntryStubConstant();
33 Node* TrueConstant();
34 Node* FalseConstant();
35
36 Reduction ChangeBitToBool(Node* val, Node* control);
37
38 Graph* graph() const { return graph_; }
39 Isolate* isolate() const { return isolate_; }
40 Linkage* linkage() const { return linkage_; }
41 CommonNodeCache* cache() const { return cache_; }
42 CommonOperatorBuilder* common() { return &common_; }
43 MachineOperatorBuilder* machine() { return &machine_; }
44
45 private:
46 Graph* graph_;
47 Isolate* isolate_;
48 Linkage* linkage_;
49 CommonNodeCache* cache_;
50 CommonOperatorBuilder common_;
51 MachineOperatorBuilder machine_;
52
53 SetOncePointer<Node> c_entry_stub_constant_;
54 SetOncePointer<Node> true_constant_;
55 SetOncePointer<Node> false_constant_;
56 };
57
58
59 template <size_t kPointerSize = kApiPointerSize>
60 class ChangeLowering V8_FINAL : public ChangeLoweringBase {
61 public:
62 ChangeLowering(Graph* graph, Linkage* linkage);
63 ChangeLowering(Graph* graph, Linkage* linkage, CommonNodeCache* cache)
64 : ChangeLoweringBase(graph, linkage, cache) {}
65 virtual ~ChangeLowering() {}
66
67 virtual Reduction Reduce(Node* node) V8_OVERRIDE;
68
69 private:
70 Reduction ChangeBoolToBit(Node* val);
71 Reduction ChangeInt32ToTagged(Node* val, Node* effect, Node* control);
72 Reduction ChangeTaggedToFloat64(Node* val, Node* effect, Node* control);
73 };
74
75 } // namespace compiler
76 } // namespace internal
77 } // namespace v8
78
79 #endif // V8_COMPILER_CHANGE_LOWERING_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/change-lowering.cc » ('j') | src/compiler/change-lowering.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698