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.
5 #ifndef V8_COMPILER_SIMPLIFIED_LOWERING_H_
6 #define V8_COMPILER_SIMPLIFIED_LOWERING_H_
8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node.h"
11 #include "src/compiler/simplified-operator.h"
17 class SimplifiedLowering FINAL {
19 explicit SimplifiedLowering(JSGraph* jsgraph) : jsgraph_(jsgraph) {}
20 ~SimplifiedLowering() {}
24 // TODO(titzer): These are exposed for direct testing. Use a friend class.
25 void DoLoadField(Node* node);
26 void DoStoreField(Node* node);
27 // TODO(turbofan): The output_type can be removed once the result of the
28 // representation analysis is stored in the node bounds.
29 void DoLoadElement(Node* node, MachineType output_type);
30 void DoStoreElement(Node* node);
31 void DoStringAdd(Node* node);
32 void DoStringEqual(Node* node);
33 void DoStringLessThan(Node* node);
34 void DoStringLessThanOrEqual(Node* node);
39 Node* SmiTag(Node* node);
40 Node* IsTagged(Node* node);
41 Node* Untag(Node* node);
42 Node* OffsetMinusTagConstant(int32_t offset);
43 Node* ComputeIndex(const ElementAccess& access, Node* const key);
44 Node* StringComparison(Node* node, bool requires_ordering);
45 Node* Int32Div(Node* const node);
46 Node* Int32Mod(Node* const node);
47 Node* Uint32Div(Node* const node);
48 Node* Uint32Mod(Node* const node);
50 friend class RepresentationSelector;
52 Zone* zone() { return jsgraph_->zone(); }
53 JSGraph* jsgraph() { return jsgraph_; }
54 Graph* graph() { return jsgraph()->graph(); }
55 CommonOperatorBuilder* common() { return jsgraph()->common(); }
56 MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
59 } // namespace compiler
60 } // namespace internal
63 #endif // V8_COMPILER_SIMPLIFIED_LOWERING_H_