Lines Matching refs:instr
106 void HBasicBlock::AddInstruction(HInstruction* instr) {
108 ASSERT(!instr->IsLinked());
115 instr->InsertAfter(last_);
116 last_ = instr;
126 HDeoptimize* instr = new(zone()) HDeoptimize(environment->length());
129 instr->AddEnvironmentValue(val);
132 return instr;
145 HSimulate* instr = new(zone()) HSimulate(ast_id, pop_count);
147 instr->AddPushedValue(environment->ExpressionStackAt(i));
151 instr->AddAssignedValue(index, environment->Lookup(index));
154 return instr;
174 HGoto* instr = new(zone()) HGoto(block);
175 Finish(instr);
188 HGoto* instr = new(zone()) HGoto(target);
189 Finish(instr);
735 HInstruction* instr = blocks()->at(i)->first();
736 while (instr != NULL) {
737 HValue* value = instr->Canonicalize();
738 if (value != instr) instr->DeleteAndReplaceWith(value);
739 instr = instr->next();
1038 instr = block->first();
1039 while (instr != block->end()) {
1040 InferRange(instr);
1041 instr = instr->next();
1346 HInstruction* instr = dominator->first();
1347 while (instr != NULL) {
1348 if (instr->IsCall()) {
1352 instr = instr->next();
1439 bool ShouldMove(HInstruction* instr, HBasicBlock* loop_header);
1483 HInstruction* instr = block->first();
1486 while (instr != NULL) {
1487 side_effects.Add(instr->ChangesFlags());
1488 if (instr->IsSoftDeoptimize()) {
1493 instr = instr->next();
1546 HInstruction* instr = block->first();
1547 while (instr != NULL) {
1548 HInstruction* next = instr->next();
1550 if (instr->CheckFlag(HValue::kUseGVN)) {
1553 instr->id(),
1554 instr->Mnemonic(),
1555 instr->gvn_flags().ToIntegral(),
1557 bool can_hoist = !instr->gvn_flags().ContainsAnyOf(depends_flags);
1558 if (instr->IsTransitionElementsKind()) {
1563 GVNFlagSet changes = instr->ChangesFlags();
1572 HTransitionElementsKind* trans = HTransitionElementsKind::cast(instr);
1582 instr->id(),
1583 instr->Mnemonic(),
1603 for (int i = 0; i < instr->OperandCount(); ++i) {
1604 if (instr->OperandAt(i)->IsDefinedAfter(pre_header)) {
1609 if (inputs_loop_invariant && ShouldMove(instr, loop_header)) {
1610 TraceGVN("Hoisting loop invariant instruction %d\n", instr->id());
1612 instr->Unlink();
1613 instr->InsertBefore(pre_header->end());
1614 if (instr->HasSideEffects()) removed_side_effects_ = true;
1622 first_time_depends->Add(instr->DependsOnFlags());
1623 first_time_changes->Add(instr->ChangesFlags());
1625 instr = next;
1635 bool HGlobalValueNumberer::ShouldMove(HInstruction* instr,
1639 return AllowCodeMotion() && !instr->block()->IsDeoptimizing();
1674 HInstruction* instr = block->first();
1675 while (instr != NULL) {
1676 HInstruction* next = instr->next();
1677 GVNFlagSet flags = instr->ChangesFlags();
1681 TraceGVN("Instruction %d kills\n", instr->id());
1683 if (instr->CheckFlag(HValue::kUseGVN)) {
1684 ASSERT(!instr->HasObservableSideEffects());
1685 HValue* other = map->Lookup(instr);
1687 ASSERT(instr->Equals(other) && other->Equals(instr));
1689 instr->id(),
1690 instr->Mnemonic(),
1693 if (instr->HasSideEffects()) removed_side_effects_ = true;
1694 instr->DeleteAndReplaceWith(other);
1696 map->Add(instr);
1699 instr = next;
2268 void EffectContext::ReturnInstruction(HInstruction* instr, int ast_id) {
2269 ASSERT(!instr->IsControlInstruction());
2270 owner()->AddInstruction(instr);
2271 if (instr->HasObservableSideEffects()) owner()->AddSimulate(ast_id);
2275 void EffectContext::ReturnControl(HControlInstruction* instr, int ast_id) {
2276 ASSERT(!instr->HasObservableSideEffects());
2279 instr->SetSuccessorAt(0, empty_true);
2280 instr->SetSuccessorAt(1, empty_false);
2281 owner()->current_block()->Finish(instr);
2287 void ValueContext::ReturnInstruction(HInstruction* instr, int ast_id) {
2288 ASSERT(!instr->IsControlInstruction());
2289 if (!arguments_allowed() && instr->CheckFlag(HValue::kIsArguments)) {
2292 owner()->AddInstruction(instr);
2293 owner()->Push(instr);
2294 if (instr->HasObservableSideEffects()) owner()->AddSimulate(ast_id);
2298 void ValueContext::ReturnControl(HControlInstruction* instr, int ast_id) {
2299 ASSERT(!instr->HasObservableSideEffects());
2300 if (!arguments_allowed() && instr->CheckFlag(HValue::kIsArguments)) {
2305 instr->SetSuccessorAt(0, materialize_true);
2306 instr->SetSuccessorAt(1, materialize_false);
2307 owner()->current_block()->Finish(instr);
2318 void TestContext::ReturnInstruction(HInstruction* instr, int ast_id) {
2319 ASSERT(!instr->IsControlInstruction());
2321 builder->AddInstruction(instr);
2324 if (instr->HasObservableSideEffects()) {
2325 builder->Push(instr);
2329 BuildBranch(instr);
2333 void TestContext::ReturnControl(HControlInstruction* instr, int ast_id) {
2334 ASSERT(!instr->HasObservableSideEffects());
2337 instr->SetSuccessorAt(0, empty_true);
2338 instr->SetSuccessorAt(1, empty_false);
2339 owner()->current_block()->Finish(instr);
2500 HReturn* instr = new(zone()) HReturn(graph()->GetConstantUndefined());
2501 current_block()->FinishExit(instr);
2581 HInstruction* instr = blocks()->at(i)->first();
2582 while (instr != NULL) {
2583 if (instr->IsBoundsCheck()) {
2585 ASSERT(instr->UseCount() > 0);
2586 instr->ReplaceAllUsesWith(HBoundsCheck::cast(instr)->index());
2588 instr = instr->next();
2594 HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) {
2596 current_block()->AddInstruction(instr);
2597 return instr;
2607 void HGraphBuilder::AddPhi(HPhi* instr) {
2609 current_block()->AddPhi(instr);
2613 void HGraphBuilder::PushAndAdd(HInstruction* instr) {
2614 Push(instr);
2615 AddInstruction(instr);
3488 HFunctionLiteral* instr =
3490 return ast_context()->ReturnInstruction(instr, expr->id());
3587 HConstant* instr =
3589 return ast_context()->ReturnInstruction(instr, expr->id());
3604 HLoadGlobalCell* instr =
3606 return ast_context()->ReturnInstruction(instr, expr->id());
3611 HLoadGlobalGeneric* instr =
3616 instr->set_position(expr->position());
3617 return ast_context()->ReturnInstruction(instr, expr->id());
3635 HLoadContextSlot* instr = new(zone()) HLoadContextSlot(context, variable);
3636 return ast_context()->ReturnInstruction(instr, expr->id());
3649 HConstant* instr =
3651 return ast_context()->ReturnInstruction(instr, expr->id());
3661 HRegExpLiteral* instr = new(zone()) HRegExpLiteral(context,
3665 return ast_context()->ReturnInstruction(instr, expr->id());
3964 HStoreNamedField* instr =
3968 instr->set_transition(transition);
3971 instr->SetGVNFlag(kChangesMaps);
3973 return instr;
4057 HInstruction* instr =
4059 instr->set_position(expr->position());
4061 AddInstruction(instr);
4075 HInstruction* instr = BuildStoreNamedGeneric(object, name, value);
4076 instr->set_position(expr->position());
4077 AddInstruction(instr);
4086 if (instr->HasObservableSideEffects()) {
4113 HInstruction* instr = NULL;
4129 instr = BuildStoreNamed(object, value, expr);
4136 instr = BuildStoreNamedGeneric(object, name, value);
4157 instr->set_position(expr->position());
4158 AddInstruction(instr);
4159 if (instr->HasObservableSideEffects()) AddSimulate(expr->AssignmentId());
4176 HInstruction* instr =
4178 instr->set_position(position);
4179 AddInstruction(instr);
4180 if (instr->HasObservableSideEffects()) AddSimulate(ast_id);
4185 HStoreGlobalGeneric* instr =
4191 instr->set_position(position);
4192 AddInstruction(instr);
4193 ASSERT(instr->HasObservableSideEffects());
4194 if (instr->HasObservableSideEffects()) AddSimulate(ast_id);
4267 HStoreContextSlot* instr =
4269 AddInstruction(instr);
4270 if (instr->HasObservableSideEffects()) {
4304 HInstruction* instr = BuildBinaryOperation(operation, left, right);
4305 PushAndAdd(instr);
4306 if (instr->HasObservableSideEffects()) AddSimulate(operation->id());
4308 HInstruction* store = BuildStoreNamed(obj, instr, prop);
4312 Push(instr);
4336 HInstruction* instr = BuildBinaryOperation(operation, left, right);
4337 PushAndAdd(instr);
4338 if (instr
4341 HandleKeyedElementAccess(obj, key, instr, expr, expr->AssignmentId(),
4348 Push(instr);
4469 HStoreContextSlot* instr = new(zone()) HStoreContextSlot(
4471 AddInstruction(instr);
4472 if (instr->HasObservableSideEffects()) {
4499 HThrow* instr = new(zone()) HThrow(context, value);
4500 instr->set_position(expr->position());
4501 AddInstruction(instr);
4756 HInstruction* instr = NULL;
4758 instr = AddInstruction(is_store ? BuildStoreKeyedGeneric(object, key, val)
4761 instr = AddInstruction(BuildMonomorphicElementAccess(
4764 *has_side_effects |= instr->HasObservableSideEffects();
4765 instr
4766 return is_store ? NULL : instr;
4896 HInstruction* instr = NULL;
4900 instr = is_store ? BuildStoreKeyedGeneric(obj, key, val)
4904 instr = BuildMonomorphicElementAccess(obj, key, val, map, is_store);
4912 instr = BuildStoreKeyedGeneric(obj, key, val);
4914 instr = BuildLoadKeyedGeneric(obj, key);
4917 instr->set_position(position);
4918 AddInstruction(instr);
4919 *has_side_effects = instr->HasObservableSideEffects();
4920 return instr;
4985 HInstruction* instr = NULL;
4991 instr = new(zone()) HJSArrayLength(array, mapcheck);
4997 instr = new(zone()) HStringLength(string);
5006 instr = new(zone()) HStringCharFromCode(context, char_code);
5011 instr = new(zone()) HLoadFunctionPrototype(function);
5019 instr = BuildLoadNamed(obj, expr, types->first(), name);
5023 instr = new(zone()) HLoadNamedFieldPolymorphic(context, obj, types, name);
5025 instr = BuildLoadNamedGeneric(obj, expr);
5050 instr->set_position(expr->position());
5051 return ast_context()->ReturnInstruction(instr, expr->id());
6154 HDeleteProperty* instr = new(zone()) HDeleteProperty(context, obj, key);
6155 return ast_context()->ReturnInstruction(instr, expr->id());
6190 HInstruction* instr = new(zone()) HTypeof(context, value);
6191 return ast_context()->ReturnInstruction(instr, expr->id());
6199 HInstruction* instr =
6201 return ast_context()->ReturnInstruction(instr, expr->id());
6209 HInstruction* instr =
6218 TraceRepresentation(expr->op(), info, instr, rep);
6219 instr->AssumeRepresentation(rep);
6220 return ast_context()->ReturnInstruction(instr, expr->id());
6232 HInstruction* instr = new(zone()) HBitNot(value);
6233 return ast_context()->ReturnInstruction(instr, expr->id());
6307 HInstruction* instr = new(zone()) HAdd(context, Top(), delta);
6308 TraceRepresentation(expr->op(), info, instr, rep);
6309 instr->AssumeRepresentation(rep);
6310 AddInstruction(instr);
6311 return instr;
6380 HStoreContextSlot* instr =
6382 AddInstruction(instr);
6383 if (instr->HasObservableSideEffects()) {
6494 HInstruction* instr = NULL;
6502 instr = new(zone()) HStringAdd(context, left, right);
6504 instr = HAdd::NewHAdd(zone(), context, left, right);
6508 instr = HSub::NewHSub(zone(), context, left, right);
6511 instr = HMul::NewHMul(zone(), context, left, right);
6514 instr = HMod::NewHMod(zone(), context, left, right);
6517 instr = HDiv::NewHDiv(zone(), context, left, right);
6522 instr = HBitwise::NewHBitwise(zone(), expr->op(), context, left, right);
6525 instr = HSar::NewHSar(zone(), context, left, right);
6528 instr = HShr::NewHShr(zone(), context, left, right);
6531 instr = HShl::NewHShl(zone(), context, left, right);
6543 return instr;
6547 if (instr->IsBitwiseBinaryOperation() && rep.IsDouble()) {
6550 TraceRepresentation(expr->op(), info, instr, rep);
6551 instr->AssumeRepresentation(rep);
6552 return instr;
6689 HInstruction* instr = BuildBinaryOperation(expr, left, right);
6690 instr->set_position(expr->position());
6691 return ast_context()->ReturnInstruction(instr, expr->id());
6729 HTypeofIsAndBranch* instr = new(zone()) HTypeofIsAndBranch(value, check);
6730 instr->set_position(expr->position());
6731 return ast_context()->ReturnControl(instr, expr->id());
6807 HClassOfTestAndBranch* instr =
6809 instr->set_position(expr->position());
6810 return ast_context()->ReturnControl(instr, expr->id());
6960 HIsNilAndBranch* instr = new(zone()) HIsNilAndBranch(value, kind, nil);
6961 instr->set_position(expr->position());
6962 return ast_context()->ReturnControl(instr, expr->id());