Lines Matching refs:Node
36 Reduction EscapeAnalysisReducer::ReplaceNode(Node* original,
37 Node* replacement) {
56 Node* effect = NodeProperties::GetEffectInput(original);
57 Node* control = NodeProperties::GetControlInput(original);
73 Node* SkipTypeGuards(Node* node) {
74 while (node->opcode() == IrOpcode::kTypeGuard) {
75 node = NodeProperties::GetValueInput(node, 0);
77 return node;
82 Node* EscapeAnalysisReducer::ObjectIdNode(const VirtualObject* vobject) {
86 Node* node = jsgraph()->graph()->NewNode(jsgraph()->common()->ObjectId(id));
87 NodeProperties::SetType(node, Type::Object());
88 object_id_cache_[id] = node;
93 Reduction EscapeAnalysisReducer::Reduce(Node* node) {
94 if (Node* replacement = analysis_result().GetReplacementOf(node)) {
95 DCHECK(node->opcode() != IrOpcode::kAllocate &&
96 node->opcode() != IrOpcode::kFinishRegion);
97 DCHECK_NE(replacement, node);
98 return ReplaceNode(node, replacement);
101 switch (node->opcode()) {
104 const VirtualObject* vobject = analysis_result().GetVirtualObject(node);
106 RelaxEffectsAndControls(node);
111 Node* effect = NodeProperties::GetEffectInput(node, 0);
114 RelaxEffectsAndControls(node);
119 arguments_elements_.insert(node);
124 // whether a node might have a frame state input.
125 if (node->op()->EffectInputCount() > 0) {
126 ReduceFrameStateInputs(node);
152 void EscapeAnalysisReducer::ReduceFrameStateInputs(Node* node) {
153 DCHECK_GE(node->op()->EffectInputCount(), 1);
154 for (int i = 0; i < node->InputCount(); ++i) {
155 Node* input = node->InputAt(i);
158 if (Node* ret = ReduceDeoptState(input, node, &deduplicator)) {
159 node->ReplaceInput(i, ret);
165 Node* EscapeAnalysisReducer::ReduceDeoptState(Node* node, Node* effect,
167 if (node->opcode() == IrOpcode::kFrameState) {
168 NodeHashCache::Constructor new_node(&node_cache_, node);
171 // duplicate node before the original one.
175 Node* input = node->InputAt(input_id);
180 } else if (node->opcode() == IrOpcode::kStateValues) {
181 NodeHashCache::Constructor new_node(&node_cache_, node);
182 for (int i = 0; i < node->op()->ValueInputCount(); ++i) {
183 Node* input = NodeProperties::GetValueInput(node, i);
189 analysis_result().GetVirtualObject(SkipTypeGuards(node))) {
190 if (vobject->HasEscaped()) return node;
194 std::vector<Node*> inputs;
196 Node* field =
207 num_inputs, &inputs.front(), NodeProperties::GetType(node));
211 return node;
217 for (Node* node : all.reachable) {
218 if (node->opcode() == IrOpcode::kAllocate) {
220 analysis_result().GetVirtualObject(node)) {
222 FATAL("Escape analysis failed to remove node %s#%d\n",
223 node->op()->mnemonic(), node->id());
231 for (Node* node : arguments_elements_) {
232 int mapped_count = NewArgumentsElementsMappedCountOf(node->op());
234 Node* arguments_frame = NodeProperties::GetValueInput(node, 0);
236 Node* arguments_length = NodeProperties::GetValueInput(node, 1);
252 Node* arguments_length_state = nullptr;
254 Node* use = edge.from();
274 ZoneVector<Node*> loads(zone());
275 for (Edge edge : node->use_edges()) {
276 Node* use = edge.from();
279 // A node without uses is dead, so we don't have to care about it.
303 // If the arguments elements node node is used by an unhandled node,
311 Node* arguments_elements_state = jsgraph()->graph()->NewNode(
314 ReplaceWithValue(node, arguments_elements_state);
328 for (Node* load : loads) {
331 Node* index = NodeProperties::GetValueInput(load, 1);
334 Node* offset = jsgraph()->graph()->NewNode(
347 Node* length = NodeProperties::GetValueInput(node, 1);
359 Node* NodeHashCache::Query(Node* node) {
360 auto it = cache_.find(node);
370 Node** inputs, Type type)
393 Node* NodeHashCache::Constructor::Get() {
395 Node* node;
397 node = node_cache_->Query(from_);
398 if (!node) node = from_;
400 node = node_cache_->Query(tmp_);
401 if (node) {
404 node = tmp_;
405 node_cache_->Insert(node);
409 return node;
412 Node* NodeHashCache::Constructor::MutableNode() {