v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
simplified-lowering.h
Go to the documentation of this file.
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
11#include "src/compiler/node.h"
13
14namespace v8 {
15namespace internal {
16
17class TickCounter;
18
19namespace compiler {
20
21// Forward declarations.
22class NodeOriginTable;
23class ObserveNodeManager;
24class RepresentationChanger;
25class RepresentationSelector;
26class SourcePositionTable;
27class TypeCache;
28
30 public:
32 SourcePositionTable* source_position,
33 NodeOriginTable* node_origins, TickCounter* tick_counter,
35 ObserveNodeManager* observe_node_manager = nullptr);
37
38 void LowerAllNodes();
39
40 void DoMax(Node* node, Operator const* op, MachineRepresentation rep);
41 void DoMin(Node* node, Operator const* op, MachineRepresentation rep);
42 void DoJSToNumberOrNumericTruncatesToFloat64(
43 Node* node, RepresentationSelector* selector);
44 void DoJSToNumberOrNumericTruncatesToWord32(Node* node,
45 RepresentationSelector* selector);
46 void DoIntegral32ToBit(Node* node);
47 void DoOrderedNumberToBit(Node* node);
48 void DoNumberToBit(Node* node);
49 void DoIntegerToUint8Clamped(Node* node);
50 void DoNumberToUint8Clamped(Node* node);
51 void DoSigned32ToUint8Clamped(Node* node);
52 void DoUnsigned32ToUint8Clamped(Node* node);
53
54 private:
55 // The purpose of this nested class is to hide method
56 // v8::internal::compiler::NodeProperties::ChangeOp which should not be
57 // directly used by code in SimplifiedLowering.
58 // SimplifiedLowering code should call SimplifiedLowering::ChangeOp instead,
59 // in order to notify the changes to ObserveNodeManager and support the
60 // %ObserveNode intrinsic.
62 static void ChangeOp(Node* node, const Operator* new_op) { UNREACHABLE(); }
63 };
64 void ChangeOp(Node* node, const Operator* new_op);
65
68 Zone* const zone_;
76
77 // TODO(danno): SimplifiedLowering shouldn't know anything about the source
78 // positions table, but must for now since there currently is no other way to
79 // pass down source position information to nodes created during
80 // lowering. Once this phase becomes a vanilla reducer, it should get source
81 // position information via the SourcePositionWrapper like all other reducers.
84
88
90
91 Node* Float64Round(Node* const node);
92 Node* Float64Sign(Node* const node);
93 Node* Int32Abs(Node* const node);
94 Node* Int32Div(Node* const node);
95 Node* Int32Mod(Node* const node);
96 Node* Int32Sign(Node* const node);
97 Node* Uint32Div(Node* const node);
98 Node* Uint32Mod(Node* const node);
99
100 Node* ToNumberCode();
101 Node* ToNumberConvertBigIntCode();
102 Node* ToNumericCode();
104 Operator const* ToNumberOperator();
105 Operator const* ToNumberConvertBigIntOperator();
106 Operator const* ToNumericOperator();
108
110
111 Isolate* isolate() { return jsgraph_->isolate(); }
112 Zone* zone() { return jsgraph_->zone(); }
113 JSGraph* jsgraph() { return jsgraph_; }
114 TFGraph* graph() { return jsgraph()->graph(); }
115 CommonOperatorBuilder* common() { return jsgraph()->common(); }
116 MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
117 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); }
118 Linkage* linkage() { return linkage_; }
119};
120
121} // namespace compiler
122} // namespace internal
123} // namespace v8
124
125#endif // V8_COMPILER_SIMPLIFIED_LOWERING_H_
JSGraph * jsgraph
Isolate * isolate() const
Definition js-graph.h:106
static void ChangeOp(Node *node, const Operator *new_op)
SetOncePointer< Operator const > to_number_operator_
SetOncePointer< Operator const > to_number_convert_big_int_operator_
Operator const * Ieee754Fp64ToFp16RawBitsOperator()
SetOncePointer< Operator const > to_numeric_operator_
JSHeapBroker * broker
Linkage * linkage
Linkage const *const linkage_
#define UNREACHABLE()
Definition logging.h:67
#define V8_EXPORT_PRIVATE
Definition macros.h:460