v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
int64-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_INT64_LOWERING_H_
6#define V8_COMPILER_INT64_LOWERING_H_
7
8#include <memory>
9
15
16namespace v8 {
17namespace internal {
18
19template <typename T>
20class Signature;
21
22namespace compiler {
23
24#if !V8_TARGET_ARCH_32_BIT
26 public:
31
32 void LowerGraph() {}
33};
34#else
35
36class V8_EXPORT_PRIVATE Int64Lowering {
37 public:
38 Int64Lowering(TFGraph* graph, MachineOperatorBuilder* machine,
39 CommonOperatorBuilder* common,
40 SimplifiedOperatorBuilder* simplified_, Zone* zone,
42
43 void LowerGraph();
44
45 private:
46 static int GetParameterCountAfterLowering(
48
49 enum class State : uint8_t { kUnvisited, kOnStack, kVisited };
50
51 struct Replacement {
52 Node* low;
53 Node* high;
54 };
55
56 Zone* zone() const { return zone_; }
57 TFGraph* graph() const { return graph_; }
58 MachineOperatorBuilder* machine() const { return machine_; }
59 CommonOperatorBuilder* common() const { return common_; }
60 SimplifiedOperatorBuilder* simplified() const { return simplified_; }
61 Signature<MachineRepresentation>* signature() const { return signature_; }
62
63 void PushNode(Node* node);
64 void LowerNode(Node* node);
65 bool DefaultLowering(Node* node, bool low_word_only = false);
66 void LowerComparison(Node* node, const Operator* signed_op,
67 const Operator* unsigned_op);
68 void LowerWord64AtomicBinop(Node* node, const Operator* op);
69 void LowerWord64AtomicNarrowOp(Node* node, const Operator* op);
70 void LowerLoadOperator(Node* node, MachineRepresentation rep,
71 const Operator* load_op);
72 void LowerStoreOperator(Node* node, MachineRepresentation rep,
73 const Operator* store_op);
74
75 const CallDescriptor* LowerCallDescriptor(
76 const CallDescriptor* call_descriptor);
77
78 void ReplaceNode(Node* old, Node* new_low, Node* new_high);
79 bool HasReplacementLow(Node* node);
80 Node* GetReplacementLow(Node* node);
81 bool HasReplacementHigh(Node* node);
82 Node* GetReplacementHigh(Node* node);
83 void PreparePhiReplacement(Node* phi);
84 void GetIndexNodes(Node* index, Node** index_low, Node** index_high);
85 void ReplaceNodeWithProjections(Node* node);
86 void LowerMemoryBaseAndIndex(Node* node);
87
88 struct NodeState {
89 Node* node;
90 int input_index;
91 };
92
93 TFGraph* const graph_;
94 MachineOperatorBuilder* machine_;
95 CommonOperatorBuilder* common_;
96 SimplifiedOperatorBuilder* simplified_;
97 Zone* zone_;
98 Signature<MachineRepresentation>* signature_;
99 std::vector<State> state_;
100 ZoneDeque<NodeState> stack_;
101 Replacement* replacements_;
102 Node* placeholder_;
103};
104
105#endif // V8_TARGET_ARCH_32_BIT
106
107} // namespace compiler
108} // namespace internal
109} // namespace v8
110
111#endif // V8_COMPILER_INT64_LOWERING_H_
TFGraph * graph
SimplifiedOperatorBuilder * simplified
friend Zone
Definition asm-types.cc:195
Int64Lowering(TFGraph *graph, MachineOperatorBuilder *machine, CommonOperatorBuilder *common, SimplifiedOperatorBuilder *simplified_, Zone *zone, Signature< MachineRepresentation > *signature)
Zone * zone_
enum v8::internal::@1270::DeoptimizableCodeIterator::@67 state_
Node * node
#define V8_EXPORT_PRIVATE
Definition macros.h:460
TFGraph * graph_