Lines Matching refs:node
10 #include "src/compiler/node-matchers.h"
11 #include "src/compiler/node-properties.h"
19 Reduction JSContextSpecialization::Reduce(Node* node) {
20 switch (node->opcode()) {
22 return ReduceJSLoadContext(node);
24 return ReduceJSStoreContext(node);
33 Node* node) {
34 DCHECK(node->opcode() == IrOpcode::kJSLoadContext ||
35 node->opcode() == IrOpcode::kJSStoreContext);
36 Node* const object = NodeProperties::GetValueInput(node, 0);
41 Reduction JSContextSpecialization::ReduceJSLoadContext(Node* node) {
42 DCHECK_EQ(IrOpcode::kJSLoadContext, node->opcode());
44 // Get the specialization context from the node.
46 if (!GetSpecializationContext(node).ToHandle(&context)) return NoChange();
49 const ContextAccess& access = ContextAccessOf(node->op());
62 node->ReplaceInput(0, jsgraph_->Constant(context));
63 NodeProperties::ChangeOp(node, op);
64 return Changed(node);
80 Node* constant = jsgraph_->Constant(value);
81 ReplaceWithValue(node, constant);
86 Reduction JSContextSpecialization::ReduceJSStoreContext(Node* node) {
87 DCHECK_EQ(IrOpcode::kJSStoreContext, node->opcode());
89 // Get the specialization context from the node.
91 if (!GetSpecializationContext(node).ToHandle(&context)) return NoChange();
94 const ContextAccess& access = ContextAccessOf(node->op());
104 node->ReplaceInput(0, jsgraph_->Constant(context));
105 NodeProperties::ChangeOp(node, javascript()->StoreContext(0, access.index()));
106 return Changed(node);