Home | History | Annotate | Download | only in interpreter

Lines Matching refs:node

45 void BytecodePeepholeOptimizer::WriteJump(BytecodeNode* node,
47 // Handlers for jump bytecodes do not emit |node| as WriteJump()
50 ApplyPeepholeAction(node);
51 next_stage()->WriteJump(node, label);
55 void BytecodePeepholeOptimizer::Write(BytecodeNode* node) {
58 ApplyPeepholeAction(node);
76 void BytecodePeepholeOptimizer::SetLast(const BytecodeNode* const node) {
80 DCHECK(node->bytecode() != Bytecode::kNop || node->source_info().is_valid());
81 last_ = *node;
103 // source position information is applied to the current node
124 BytecodeNode node(new_bytecode, last->operand(0), current->operand(0),
127 node.set_source_info(last->source_info());
129 return node;
136 BytecodeNode node(new_bytecode, 0, current->operand(0), current->operand(1),
139 node.set_source_info(last->source_info());
141 return node;
151 BytecodeNode node(new_bytecode, current->operand(0), current->source_info());
153 node.set_source_info(last->source_info());
155 return node;
161 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
163 DCHECK(!Bytecodes::IsJump(node->bytecode()));
166 SetLast(node);
170 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
172 DCHECK(!Bytecodes::IsJump(node->bytecode()));
174 SetLast(node);
178 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
180 DCHECK(!Bytecodes::IsJump(node->bytecode()));
182 if (node->source_info().is_valid()) {
183 SetLast(node);
188 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
190 DCHECK(!Bytecodes::IsJump(node->bytecode()));
192 if (node->source_info().is_valid()) {
193 // Preserve the source information by replacing the node bytecode
195 BytecodeNode new_node(BytecodeNode::Nop(node->source_info()));
203 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
205 DCHECK(!Bytecodes::IsJump(node->bytecode()));
207 if (last()->operand(0) == node->operand(0)) {
208 ElideCurrentAction(node);
210 DefaultAction(node);
215 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
217 DCHECK(!Bytecodes::IsJump(node->bytecode()));
219 if (CanElideLastBasedOnSourcePosition(node)) {
221 // |node| can not have a valid source position if the source
224 node->set_source_info(last()->source_info());
226 SetLast(node);
228 DefaultAction(node);
233 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
235 DCHECK(!Bytecodes::IsJump(node->bytecode()));
237 node->replace_bytecode(action_data->bytecode);
238 DefaultAction(node);
242 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
244 DCHECK(!Bytecodes::IsJump(node->bytecode()));
246 if (!node->source_info().is_valid() || !last()->source_info().is_valid()) {
249 action_data->bytecode, last(), node));
252 DefaultAction(node);
258 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
260 DCHECK(!Bytecodes::IsJump(node->bytecode()));
261 if (!node->source_info().is_valid() || !last()->source_info().is_valid()) {
264 action_data->bytecode, last(), node));
267 DefaultAction(node);
272 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
274 DCHECK(!Bytecodes::IsJump(node->bytecode()));
277 action_data->bytecode, last(), node));
282 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
284 DCHECK(Bytecodes::IsJump(node->bytecode()));
291 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
293 DCHECK(Bytecodes::IsJump(node->bytecode()));
297 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
299 DCHECK(Bytecodes::IsJump(node->bytecode()));
303 node->replace_bytecode(action_data->bytecode);
307 BytecodeNode* const node, const PeepholeActionAndData* action_data) {
309 DCHECK(Bytecodes::IsJump(node->bytecode()));
311 if (!CanElideLastBasedOnSourcePosition(node)) {
313 } else if (!node->source_info().is_valid()) {
314 node->set_source_info(last()->source_info());
319 void BytecodePeepholeOptimizer::ApplyPeepholeAction(BytecodeNode* const node) {
326 PeepholeActionTable::Lookup(last()->bytecode(), node->bytecode());
330 Action(node, action_data); \