Lines Matching refs:instruction
291 void HBasicBlock::InsertInstructionBefore(HInstruction* instruction, HInstruction* cursor) { in InsertInstructionBefore() argument
293 DCHECK(instruction->AsPhi() == nullptr); in InsertInstructionBefore()
294 DCHECK_EQ(instruction->GetId(), -1); in InsertInstructionBefore()
297 DCHECK(!instruction->IsControlFlow()); in InsertInstructionBefore()
298 instruction->next_ = cursor; in InsertInstructionBefore()
299 instruction->previous_ = cursor->previous_; in InsertInstructionBefore()
300 cursor->previous_ = instruction; in InsertInstructionBefore()
302 instructions_.first_instruction_ = instruction; in InsertInstructionBefore()
304 instruction->previous_->next_ = instruction; in InsertInstructionBefore()
306 instruction->SetBlock(this); in InsertInstructionBefore()
307 instruction->SetId(GetGraph()->GetNextInstructionId()); in InsertInstructionBefore()
312 HInstruction* instruction) { in Add() argument
313 DCHECK(instruction->GetBlock() == nullptr); in Add()
314 DCHECK_EQ(instruction->GetId(), -1); in Add()
315 instruction->SetBlock(block); in Add()
316 instruction->SetId(block->GetGraph()->GetNextInstructionId()); in Add()
317 instruction_list->AddInstruction(instruction); in Add()
320 void HBasicBlock::AddInstruction(HInstruction* instruction) { in AddInstruction() argument
321 Add(&instructions_, this, instruction); in AddInstruction()
330 HInstruction* instruction) { in Remove() argument
331 DCHECK_EQ(block, instruction->GetBlock()); in Remove()
332 DCHECK(instruction->GetUses() == nullptr); in Remove()
333 DCHECK(instruction->GetEnvUses() == nullptr); in Remove()
334 instruction->SetBlock(nullptr); in Remove()
335 instruction_list->RemoveInstruction(instruction); in Remove()
337 for (size_t i = 0; i < instruction->InputCount(); i++) { in Remove()
338 instruction->InputAt(i)->RemoveUser(instruction, i); in Remove()
342 void HBasicBlock::RemoveInstruction(HInstruction* instruction) { in RemoveInstruction() argument
343 Remove(&instructions_, this, instruction); in RemoveInstruction()
366 void HInstructionList::AddInstruction(HInstruction* instruction) { in AddInstruction() argument
369 first_instruction_ = last_instruction_ = instruction; in AddInstruction()
371 last_instruction_->next_ = instruction; in AddInstruction()
372 instruction->previous_ = last_instruction_; in AddInstruction()
373 last_instruction_ = instruction; in AddInstruction()
375 for (size_t i = 0; i < instruction->InputCount(); i++) { in AddInstruction()
376 instruction->InputAt(i)->AddUseAt(instruction, i); in AddInstruction()
380 void HInstructionList::RemoveInstruction(HInstruction* instruction) { in RemoveInstruction() argument
381 if (instruction->previous_ != nullptr) { in RemoveInstruction()
382 instruction->previous_->next_ = instruction->next_; in RemoveInstruction()
384 if (instruction->next_ != nullptr) { in RemoveInstruction()
385 instruction->next_->previous_ = instruction->previous_; in RemoveInstruction()
387 if (instruction == first_instruction_) { in RemoveInstruction()
388 first_instruction_ = instruction->next_; in RemoveInstruction()
390 if (instruction == last_instruction_) { in RemoveInstruction()
391 last_instruction_ = instruction->previous_; in RemoveInstruction()