OLD | NEW |
(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_SIMPLIFIED_LOWERING_H_ |
| 6 #define V8_COMPILER_SIMPLIFIED_LOWERING_H_ |
| 7 |
| 8 #include "src/compiler/graph-reducer.h" |
| 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/lowering-builder.h" |
| 11 #include "src/compiler/machine-operator.h" |
| 12 #include "src/compiler/node.h" |
| 13 #include "src/compiler/simplified-operator.h" |
| 14 |
| 15 namespace v8 { |
| 16 namespace internal { |
| 17 namespace compiler { |
| 18 |
| 19 class SimplifiedLowering : public LoweringBuilder { |
| 20 public: |
| 21 explicit SimplifiedLowering(JSGraph* jsgraph, |
| 22 SourcePositionTable* source_positions) |
| 23 : LoweringBuilder(jsgraph->graph(), source_positions), |
| 24 jsgraph_(jsgraph), |
| 25 machine_(jsgraph->zone()) {} |
| 26 virtual ~SimplifiedLowering() {} |
| 27 |
| 28 virtual void Lower(Node* node); |
| 29 |
| 30 private: |
| 31 JSGraph* jsgraph_; |
| 32 MachineOperatorBuilder machine_; |
| 33 |
| 34 Node* DoChangeTaggedToInt32(Node* node, Node* effect, Node* control); |
| 35 Node* DoChangeTaggedToUint32(Node* node, Node* effect, Node* control); |
| 36 Node* DoChangeTaggedToFloat64(Node* node, Node* effect, Node* control); |
| 37 Node* DoChangeInt32ToTagged(Node* node, Node* effect, Node* control); |
| 38 Node* DoChangeUint32ToTagged(Node* node, Node* effect, Node* control); |
| 39 Node* DoChangeFloat64ToTagged(Node* node, Node* effect, Node* control); |
| 40 Node* DoChangeBoolToBit(Node* node, Node* effect, Node* control); |
| 41 Node* DoChangeBitToBool(Node* node, Node* effect, Node* control); |
| 42 Node* DoLoadField(Node* node, Node* effect, Node* control); |
| 43 Node* DoStoreField(Node* node, Node* effect, Node* control); |
| 44 Node* DoLoadElement(Node* node, Node* effect, Node* control); |
| 45 Node* DoStoreElement(Node* node, Node* effect, Node* control); |
| 46 |
| 47 Node* ComputeIndex(const ElementAccess& access, Node* index); |
| 48 |
| 49 Zone* zone() { return jsgraph_->zone(); } |
| 50 JSGraph* jsgraph() { return jsgraph_; } |
| 51 Graph* graph() { return jsgraph()->graph(); } |
| 52 CommonOperatorBuilder* common() { return jsgraph()->common(); } |
| 53 MachineOperatorBuilder* machine() { return &machine_; } |
| 54 }; |
| 55 |
| 56 } // namespace compiler |
| 57 } // namespace internal |
| 58 } // namespace v8 |
| 59 |
| 60 #endif // V8_COMPILER_SIMPLIFIED_LOWERING_H_ |
OLD | NEW |