Version 1.24.0-dev.6.4
Cherry-pick 97b750425db5568aa16f3cf0fd808d933151e2dd to dev
Cherry-pick 93864c0db92d0a4066912507cbf5466b50996cc3 to dev
diff --git a/DEPS b/DEPS
index 9ffdeec..9a2afb2 100644
--- a/DEPS
+++ b/DEPS
@@ -109,7 +109,7 @@
"source_map_stack_trace_tag": "@1.1.4",
"source_maps-0.9.4_rev": "@38524",
"source_maps_tag": "@0.10.4",
- "source_span_tag": "@1.3.1",
+ "source_span_tag": "@1.4.0",
"stack_trace_tag": "@1.7.2",
"stream_channel_tag": "@1.6.1",
"string_scanner_tag": "@1.0.1",
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
index 3bf995a..513936c 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -710,7 +710,7 @@
StrictCompareInstr* comp = new (Z)
StrictCompareInstr(call->token_pos(), Token::kEQ_STRICT,
new (Z) Value(left), new (Z) Value(right),
- /* number_check = */ false, Thread::kNoDeoptId);
+ false); // No number check.
ReplaceCall(call, comp);
return true;
}
@@ -1441,9 +1441,10 @@
ConstantInstr* cid =
flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(type_cid)));
- StrictCompareInstr* check_cid = new (Z) StrictCompareInstr(
- call->token_pos(), Token::kEQ_STRICT, new (Z) Value(left_cid),
- new (Z) Value(cid), /* number_check = */ false, Thread::kNoDeoptId);
+ StrictCompareInstr* check_cid =
+ new (Z) StrictCompareInstr(call->token_pos(), Token::kEQ_STRICT,
+ new (Z) Value(left_cid), new (Z) Value(cid),
+ false); // No number check.
ReplaceCall(call, check_cid);
return;
}
diff --git a/runtime/vm/branch_optimizer.cc b/runtime/vm/branch_optimizer.cc
index 0048b7e..f68bbca 100644
--- a/runtime/vm/branch_optimizer.cc
+++ b/runtime/vm/branch_optimizer.cc
@@ -65,8 +65,8 @@
// Convert a target block into a join block. Branches will be duplicated
// so the former true and false targets become joins of the control flows
// from all the duplicated branches.
- JoinEntryInstr* join = new (zone) JoinEntryInstr(
- target->block_id(), target->try_index(), Thread::kNoDeoptId);
+ JoinEntryInstr* join =
+ new (zone) JoinEntryInstr(target->block_id(), target->try_index());
join->InheritDeoptTarget(zone, target);
join->LinkTo(target->next());
join->set_last_instruction(target->last_instruction());
@@ -82,8 +82,7 @@
ComparisonInstr* comparison = branch->comparison();
ComparisonInstr* new_comparison =
comparison->CopyWithNewOperands(new_left, new_right);
- BranchInstr* new_branch =
- new (zone) BranchInstr(new_comparison, Thread::kNoDeoptId);
+ BranchInstr* new_branch = new (zone) BranchInstr(new_comparison);
return new_branch;
}
@@ -184,24 +183,20 @@
// Connect the branch to the true and false joins, via empty target
// blocks.
- TargetEntryInstr* true_target =
- new (zone) TargetEntryInstr(flow_graph->max_block_id() + 1,
- block->try_index(), Thread::kNoDeoptId);
+ TargetEntryInstr* true_target = new (zone) TargetEntryInstr(
+ flow_graph->max_block_id() + 1, block->try_index());
true_target->InheritDeoptTarget(zone, join_true);
- TargetEntryInstr* false_target =
- new (zone) TargetEntryInstr(flow_graph->max_block_id() + 2,
- block->try_index(), Thread::kNoDeoptId);
+ TargetEntryInstr* false_target = new (zone) TargetEntryInstr(
+ flow_graph->max_block_id() + 2, block->try_index());
false_target->InheritDeoptTarget(zone, join_false);
flow_graph->set_max_block_id(flow_graph->max_block_id() + 2);
*new_branch->true_successor_address() = true_target;
*new_branch->false_successor_address() = false_target;
- GotoInstr* goto_true =
- new (zone) GotoInstr(join_true, Thread::kNoDeoptId);
+ GotoInstr* goto_true = new (zone) GotoInstr(join_true);
goto_true->InheritDeoptTarget(zone, join_true);
true_target->LinkTo(goto_true);
true_target->set_last_instruction(goto_true);
- GotoInstr* goto_false =
- new (zone) GotoInstr(join_false, Thread::kNoDeoptId);
+ GotoInstr* goto_false = new (zone) GotoInstr(join_false);
goto_false->InheritDeoptTarget(zone, join_false);
false_target->LinkTo(goto_false);
false_target->set_last_instruction(goto_false);
@@ -300,9 +295,8 @@
ComparisonInstr* new_comparison = comparison->CopyWithNewOperands(
comparison->left()->Copy(zone), comparison->right()->Copy(zone));
- IfThenElseInstr* if_then_else = new (zone)
- IfThenElseInstr(new_comparison, if_true->Copy(zone),
- if_false->Copy(zone), Thread::kNoDeoptId);
+ IfThenElseInstr* if_then_else = new (zone) IfThenElseInstr(
+ new_comparison, if_true->Copy(zone), if_false->Copy(zone));
flow_graph->InsertBefore(branch, if_then_else, NULL,
FlowGraph::kValue);
diff --git a/runtime/vm/constant_propagator.cc b/runtime/vm/constant_propagator.cc
index d080aed..2792f82 100644
--- a/runtime/vm/constant_propagator.cc
+++ b/runtime/vm/constant_propagator.cc
@@ -1551,8 +1551,7 @@
// Drop the comparison, which does not have side effects
JoinEntryInstr* join = if_true->AsJoinEntry();
if (join->phis() == NULL) {
- GotoInstr* jump =
- new (Z) GotoInstr(if_true->AsJoinEntry(), Thread::kNoDeoptId);
+ GotoInstr* jump = new (Z) GotoInstr(if_true->AsJoinEntry());
jump->InheritDeoptTarget(Z, branch);
Instruction* previous = branch->previous();
@@ -1695,16 +1694,16 @@
ASSERT(reachable_->Contains(if_false->preorder_number()));
ASSERT(if_false->parallel_move() == NULL);
ASSERT(if_false->loop_info() == NULL);
- join = new (Z) JoinEntryInstr(
- if_false->block_id(), if_false->try_index(), Thread::kNoDeoptId);
+ join =
+ new (Z) JoinEntryInstr(if_false->block_id(), if_false->try_index());
join->InheritDeoptTarget(Z, if_false);
if_false->UnuseAllInputs();
next = if_false->next();
} else if (!reachable_->Contains(if_false->preorder_number())) {
ASSERT(if_true->parallel_move() == NULL);
ASSERT(if_true->loop_info() == NULL);
- join = new (Z) JoinEntryInstr(if_true->block_id(), if_true->try_index(),
- Thread::kNoDeoptId);
+ join =
+ new (Z) JoinEntryInstr(if_true->block_id(), if_true->try_index());
join->InheritDeoptTarget(Z, if_true);
if_true->UnuseAllInputs();
next = if_true->next();
@@ -1715,7 +1714,7 @@
// Drop the comparison, which does not have side effects as long
// as it is a strict compare (the only one we can determine is
// constant with the current analysis).
- GotoInstr* jump = new (Z) GotoInstr(join, Thread::kNoDeoptId);
+ GotoInstr* jump = new (Z) GotoInstr(join);
jump->InheritDeoptTarget(Z, branch);
Instruction* previous = branch->previous();
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index a9c8302..2ca8a16 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -1018,8 +1018,7 @@
for (intptr_t i = parameter_count(); i < variable_count(); ++i) {
if (i == CurrentContextEnvIndex()) {
if (function().IsClosureFunction()) {
- CurrentContextInstr* context =
- new CurrentContextInstr(Thread::kNoDeoptId);
+ CurrentContextInstr* context = new CurrentContextInstr();
context->set_ssa_temp_index(alloc_ssa_temp_index()); // New SSA temp.
AddToInitialDefinitions(context);
env.Add(context);
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 8973cc4..96ccbae 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -173,8 +173,8 @@
JoinEntryInstr* NestedStatement::BreakTargetFor(SourceLabel* label) {
if (label != label_) return NULL;
if (break_target_ == NULL) {
- break_target_ = new (owner()->zone()) JoinEntryInstr(
- owner()->AllocateBlockId(), try_index(), owner()->GetNextDeoptId());
+ break_target_ = new (owner()->zone())
+ JoinEntryInstr(owner()->AllocateBlockId(), try_index());
}
return break_target_;
}
@@ -246,8 +246,8 @@
JoinEntryInstr* NestedLoop::ContinueTargetFor(SourceLabel* label) {
if (label != this->label()) return NULL;
if (continue_target_ == NULL) {
- continue_target_ = new (owner()->zone()) JoinEntryInstr(
- owner()->AllocateBlockId(), try_index(), owner()->GetNextDeoptId());
+ continue_target_ = new (owner()->zone())
+ JoinEntryInstr(owner()->AllocateBlockId(), try_index());
}
return continue_target_;
}
@@ -289,8 +289,8 @@
for (intptr_t i = 0; i < case_labels_.length(); ++i) {
if (label != case_labels_[i]) continue;
if (case_targets_[i] == NULL) {
- case_targets_[i] = new (owner()->zone()) JoinEntryInstr(
- owner()->AllocateBlockId(), try_index(), owner()->GetNextDeoptId());
+ case_targets_[i] = new (owner()->zone())
+ JoinEntryInstr(owner()->AllocateBlockId(), try_index());
}
return case_targets_[i];
}
@@ -442,8 +442,7 @@
// Create a join of the returns.
intptr_t join_id = caller_graph_->max_block_id() + 1;
caller_graph_->set_max_block_id(join_id);
- JoinEntryInstr* join = new (Z)
- JoinEntryInstr(join_id, try_index, Thread::Current()->GetNextDeoptId());
+ JoinEntryInstr* join = new (Z) JoinEntryInstr(join_id, try_index);
// The dominator set of the join is the intersection of the dominator
// sets of all the predecessors. If we keep the dominator sets ordered
@@ -461,8 +460,7 @@
GrowableArray<BlockEntryInstr*> join_dominators;
for (intptr_t i = 0; i < num_exits; ++i) {
// Add the control-flow edge.
- GotoInstr* goto_instr =
- new (Z) GotoInstr(join, Thread::Current()->GetNextDeoptId());
+ GotoInstr* goto_instr = new (Z) GotoInstr(join);
goto_instr->InheritDeoptTarget(zone(), ReturnAt(i));
LastInstructionAt(i)->LinkTo(goto_instr);
ExitBlockAt(i)->set_last_instruction(LastInstructionAt(i)->next());
@@ -548,19 +546,16 @@
// goes to the rest of the caller graph. It is removed as unreachable code
// by the constant propagation.
TargetEntryInstr* false_block = new (Z) TargetEntryInstr(
- caller_graph_->allocate_block_id(), call_block->try_index(),
- Thread::Current()->GetNextDeoptId());
+ caller_graph_->allocate_block_id(), call_block->try_index());
false_block->InheritDeoptTargetAfter(caller_graph_, call_, NULL);
false_block->LinkTo(call_->next());
call_block->ReplaceAsPredecessorWith(false_block);
ConstantInstr* true_const = caller_graph_->GetConstant(Bool::True());
- BranchInstr* branch = new (Z)
- BranchInstr(new (Z) StrictCompareInstr(
- TokenPosition::kNoSource, Token::kEQ_STRICT,
- new (Z) Value(true_const), new (Z) Value(true_const),
- false, Thread::Current()->GetNextDeoptId()),
- Thread::Current()->GetNextDeoptId()); // No number check.
+ BranchInstr* branch = new (Z) BranchInstr(new (Z) StrictCompareInstr(
+ TokenPosition::kNoSource, Token::kEQ_STRICT, new (Z) Value(true_const),
+ new (Z) Value(true_const),
+ false)); // No number check.
branch->InheritDeoptTarget(zone(), call_);
*branch->true_successor_address() = callee_entry;
*branch->false_successor_address() = false_block;
@@ -704,8 +699,7 @@
void EffectGraphVisitor::AddReturnExit(TokenPosition token_pos, Value* value) {
ASSERT(is_open());
- ReturnInstr* return_instr =
- new (Z) ReturnInstr(token_pos, value, owner()->GetNextDeoptId());
+ ReturnInstr* return_instr = new (Z) ReturnInstr(token_pos, value);
AddInstruction(return_instr);
InlineExitCollector* exit_collector = owner()->exit_collector();
if (exit_collector != NULL) {
@@ -718,7 +712,7 @@
void EffectGraphVisitor::Goto(JoinEntryInstr* join) {
ASSERT(is_open());
if (is_empty()) {
- entry_ = new (Z) GotoInstr(join, owner()->GetNextDeoptId());
+ entry_ = new (Z) GotoInstr(join);
} else {
exit()->Goto(join);
}
@@ -767,9 +761,8 @@
} else if (false_exit == NULL) {
exit_ = true_exit;
} else {
- JoinEntryInstr* join =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ JoinEntryInstr* join = new (Z)
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
true_exit->Goto(join);
false_exit->Goto(join);
exit_ = join;
@@ -799,11 +792,10 @@
Append(test_preamble_fragment);
Append(test_fragment);
} else {
- JoinEntryInstr* join =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
- CheckStackOverflowInstr* check = new (Z) CheckStackOverflowInstr(
- token_pos, owner()->loop_depth(), owner()->GetNextDeoptId());
+ JoinEntryInstr* join = new (Z)
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+ CheckStackOverflowInstr* check =
+ new (Z) CheckStackOverflowInstr(token_pos, owner()->loop_depth());
join->LinkTo(check);
if (!test_preamble_fragment.is_empty()) {
check->LinkTo(test_preamble_fragment.entry());
@@ -937,8 +929,7 @@
ASSERT(!branches.is_empty());
for (intptr_t i = 0; i < branches.length(); i++) {
TargetEntryInstr* target = new (Z)
- TargetEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ TargetEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
*(branches[i]) = target;
target->Goto(join);
}
@@ -961,15 +952,13 @@
if (branches.length() == 1) {
TargetEntryInstr* target = new (Z)
- TargetEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ TargetEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
*(branches[0]) = target;
return target;
}
JoinEntryInstr* join =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
ConnectBranchesTo(branches, join);
return join;
}
@@ -988,14 +977,13 @@
void TestGraphVisitor::ReturnValue(Value* value) {
Isolate* isolate = Isolate::Current();
if (isolate->type_checks() || isolate->asserts()) {
- value = Bind(new (Z) AssertBooleanInstr(condition_token_pos(), value,
- owner()->GetNextDeoptId()));
+ value = Bind(new (Z) AssertBooleanInstr(condition_token_pos(), value));
}
Value* constant_true = Bind(new (Z) ConstantInstr(Bool::True()));
StrictCompareInstr* comp = new (Z) StrictCompareInstr(
- condition_token_pos(), Token::kEQ_STRICT, value, constant_true, false,
- owner()->GetNextDeoptId()); // No number check.
- BranchInstr* branch = new (Z) BranchInstr(comp, owner()->GetNextDeoptId());
+ condition_token_pos(), Token::kEQ_STRICT, value, constant_true,
+ false); // No number check.
+ BranchInstr* branch = new (Z) BranchInstr(comp);
AddInstruction(branch);
CloseFragment();
@@ -1005,7 +993,7 @@
void TestGraphVisitor::MergeBranchWithStrictCompare(StrictCompareInstr* comp) {
- BranchInstr* branch = new (Z) BranchInstr(comp, owner()->GetNextDeoptId());
+ BranchInstr* branch = new (Z) BranchInstr(comp);
AddInstruction(branch);
CloseFragment();
true_successor_addresses_.Add(branch->true_successor_address());
@@ -1018,8 +1006,8 @@
Value* constant_true = Bind(new (Z) ConstantInstr(Bool::True()));
StrictCompareInstr* comp = new (Z) StrictCompareInstr(
condition_token_pos(), Token::kNE_STRICT, neg->value(), constant_true,
- false, owner()->GetNextDeoptId()); // No number check.
- BranchInstr* branch = new (Z) BranchInstr(comp, owner()->GetNextDeoptId());
+ false); // No number check.
+ BranchInstr* branch = new (Z) BranchInstr(comp);
AddInstruction(branch);
CloseFragment();
true_successor_addresses_.Add(branch->true_successor_address());
@@ -1153,11 +1141,11 @@
ZoneGrowableArray<PushArgumentInstr*>* no_arguments =
new (Z) ZoneGrowableArray<PushArgumentInstr*>(0);
const int kTypeArgsLen = 0;
- StaticCallInstr* call_async_clear_thread_stack_trace = new (Z)
- StaticCallInstr(node->token_pos().ToSynthetic(),
- async_clear_thread_stack_trace, kTypeArgsLen,
- Object::null_array(), no_arguments,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ StaticCallInstr* call_async_clear_thread_stack_trace =
+ new (Z) StaticCallInstr(node->token_pos().ToSynthetic(),
+ async_clear_thread_stack_trace, kTypeArgsLen,
+ Object::null_array(), no_arguments,
+ owner()->ic_data_array());
Do(call_async_clear_thread_stack_trace);
}
@@ -1192,8 +1180,7 @@
const int kTypeArgsLen = 0;
StaticCallInstr* call = new (Z) StaticCallInstr(
node->token_pos().ToSynthetic(), complete_on_async_return, kTypeArgsLen,
- Object::null_array(), arguments, owner()->ic_data_array(),
- owner()->GetNextDeoptId());
+ Object::null_array(), arguments, owner()->ic_data_array());
Do(call);
// Rebind the return value for the actual return call to be null.
@@ -1211,9 +1198,8 @@
if ((function.IsAsyncClosure() || function.IsSyncGenClosure() ||
function.IsAsyncGenClosure()) &&
(node->return_type() == ReturnNode::kContinuationTarget)) {
- JoinEntryInstr* const join =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ JoinEntryInstr* const join = new (Z)
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
owner()->await_joins()->Add(join);
exit_ = join;
}
@@ -1256,8 +1242,7 @@
function_type_arguments = BuildFunctionTypeArguments(token_pos);
}
ReturnDefinition(new (Z) InstantiateTypeInstr(
- token_pos, type, instantiator_type_arguments, function_type_arguments,
- owner()->GetNextDeoptId()));
+ token_pos, type, instantiator_type_arguments, function_type_arguments));
}
@@ -1347,8 +1332,8 @@
ValueGraphVisitor for_right(owner());
node->right()->Visit(&for_right);
Value* right_value = for_right.value();
- for_right.Do(new (Z) AssertBooleanInstr(
- node->right()->token_pos(), right_value, owner()->GetNextDeoptId()));
+ for_right.Do(
+ new (Z) AssertBooleanInstr(node->right()->token_pos(), right_value));
if (node->kind() == Token::kAND) {
Join(for_left, for_right, empty);
} else {
@@ -1383,10 +1368,9 @@
const String& name = Symbols::Token(node->kind());
const intptr_t kTypeArgsLen = 0;
const intptr_t kNumArgsChecked = 2;
- InstanceCallInstr* call = new (Z)
- InstanceCallInstr(node->token_pos(), name, node->kind(), arguments,
- kTypeArgsLen, Object::null_array(), kNumArgsChecked,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ InstanceCallInstr* call = new (Z) InstanceCallInstr(
+ node->token_pos(), name, node->kind(), arguments, kTypeArgsLen,
+ Object::null_array(), kNumArgsChecked, owner()->ic_data_array());
ReturnDefinition(call);
}
@@ -1409,13 +1393,13 @@
Value* right_value = for_right.value();
Isolate* isolate = Isolate::Current();
if (isolate->type_checks() || isolate->asserts()) {
- right_value = for_right.Bind(new (Z) AssertBooleanInstr(
- node->right()->token_pos(), right_value, owner()->GetNextDeoptId()));
+ right_value = for_right.Bind(
+ new (Z) AssertBooleanInstr(node->right()->token_pos(), right_value));
}
Value* constant_true = for_right.Bind(new (Z) ConstantInstr(Bool::True()));
Value* compare = for_right.Bind(new (Z) StrictCompareInstr(
- node->token_pos(), Token::kEQ_STRICT, right_value, constant_true, false,
- owner()->GetNextDeoptId())); // No number check.
+ node->token_pos(), Token::kEQ_STRICT, right_value, constant_true,
+ false)); // No number check.
for_right.Do(BuildStoreExprTemp(compare, node->token_pos()));
if (node->kind() == Token::kAND) {
@@ -1551,7 +1535,7 @@
Library::PrivateCoreLibName(Symbols::_simpleInstanceOf()), node->kind(),
arguments, kTypeArgsLen,
Object::null_array(), // No argument names.
- kNumArgsChecked, owner()->ic_data_array(), owner()->GetNextDeoptId());
+ kNumArgsChecked, owner()->ic_data_array());
if (negate_result) {
result = new (Z) BooleanNegateInstr(Bind(result));
}
@@ -1576,7 +1560,7 @@
node->token_pos(), Library::PrivateCoreLibName(Symbols::_instanceOf()),
node->kind(), arguments, kTypeArgsLen,
Object::null_array(), // No argument names.
- kNumArgsChecked, owner()->ic_data_array(), owner()->GetNextDeoptId());
+ kNumArgsChecked, owner()->ic_data_array());
if (negate_result) {
result = new (Z) BooleanNegateInstr(Bind(result));
}
@@ -1615,7 +1599,7 @@
node->token_pos(), Library::PrivateCoreLibName(Symbols::_as()),
node->kind(), arguments, kTypeArgsLen,
Object::null_array(), // No argument names.
- kNumArgsChecked, owner()->ic_data_array(), owner()->GetNextDeoptId());
+ kNumArgsChecked, owner()->ic_data_array());
ReturnDefinition(call);
}
@@ -1632,8 +1616,8 @@
right->Visit(&for_right_value);
Append(for_right_value);
StrictCompareInstr* comp = new (Z) StrictCompareInstr(
- token_pos, kind, for_left_value.value(), for_right_value.value(), true,
- owner()->GetNextDeoptId()); // Number check.
+ token_pos, kind, for_left_value.value(), for_right_value.value(),
+ true); // Number check.
return comp;
}
@@ -1689,17 +1673,16 @@
const intptr_t kTypeArgsLen = 0;
const intptr_t kNumArgsChecked = 2;
- Definition* result = new (Z) InstanceCallInstr(
- node->token_pos(), Symbols::EqualOperator(),
- Token::kEQ, // Result is negated later for kNE.
- arguments, kTypeArgsLen, Object::null_array(), kNumArgsChecked,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ Definition* result = new (Z)
+ InstanceCallInstr(node->token_pos(), Symbols::EqualOperator(),
+ Token::kEQ, // Result is negated later for kNE.
+ arguments, kTypeArgsLen, Object::null_array(),
+ kNumArgsChecked, owner()->ic_data_array());
if (node->kind() == Token::kNE) {
Isolate* isolate = Isolate::Current();
if (isolate->type_checks() || isolate->asserts()) {
Value* value = Bind(result);
- result = new (Z) AssertBooleanInstr(node->token_pos(), value,
- owner()->GetNextDeoptId());
+ result = new (Z) AssertBooleanInstr(node->token_pos(), value);
}
Value* value = Bind(result);
result = new (Z) BooleanNegateInstr(value);
@@ -1727,8 +1710,7 @@
const intptr_t kTypeArgsLen = 0;
InstanceCallInstr* comp = new (Z) InstanceCallInstr(
node->token_pos(), Symbols::Token(node->kind()), node->kind(), arguments,
- kTypeArgsLen, Object::null_array(), 2, owner()->ic_data_array(),
- owner()->GetNextDeoptId());
+ kTypeArgsLen, Object::null_array(), 2, owner()->ic_data_array());
ReturnDefinition(comp);
}
@@ -1742,8 +1724,8 @@
Value* value = for_value.value();
Isolate* isolate = Isolate::Current();
if (isolate->type_checks() || isolate->asserts()) {
- value = Bind(new (Z) AssertBooleanInstr(
- node->operand()->token_pos(), value, owner()->GetNextDeoptId()));
+ value =
+ Bind(new (Z) AssertBooleanInstr(node->operand()->token_pos(), value));
}
BooleanNegateInstr* negate = new (Z) BooleanNegateInstr(value);
ReturnDefinition(negate);
@@ -1760,8 +1742,7 @@
const intptr_t kTypeArgsLen = 0;
InstanceCallInstr* call = new (Z) InstanceCallInstr(
node->token_pos(), Symbols::Token(node->kind()), node->kind(), arguments,
- kTypeArgsLen, Object::null_array(), 1, owner()->ic_data_array(),
- owner()->GetNextDeoptId());
+ kTypeArgsLen, Object::null_array(), 1, owner()->ic_data_array());
ReturnDefinition(call);
}
@@ -1859,9 +1840,8 @@
// Compute the start of the statements fragment.
JoinEntryInstr* statement_start = NULL;
if (node->label() == NULL) {
- statement_start =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ statement_start = new (Z)
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
} else {
// The case nodes are nested inside a SequenceNode that is the body of a
// SwitchNode. The SwitchNode on the nesting stack contains the
@@ -1913,8 +1893,7 @@
} else {
if (statement_exit != NULL) {
JoinEntryInstr* join = new (Z)
- JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
statement_exit->Goto(join);
next_target->Goto(join);
exit_instruction = join;
@@ -1997,8 +1976,7 @@
// Tie do-while loop (test is after the body).
JoinEntryInstr* body_entry_join =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
Goto(body_entry_join);
Instruction* body_exit = AppendFragment(body_entry_join, for_body);
@@ -2006,11 +1984,10 @@
if ((body_exit != NULL) || (join != NULL)) {
if (join == NULL) {
join = new (Z)
- JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
}
- CheckStackOverflowInstr* check = new (Z) CheckStackOverflowInstr(
- node->token_pos(), owner()->loop_depth(), owner()->GetNextDeoptId());
+ CheckStackOverflowInstr* check = new (Z)
+ CheckStackOverflowInstr(node->token_pos(), owner()->loop_depth());
join->LinkTo(check);
check->LinkTo(for_test.entry());
if (body_exit != NULL) {
@@ -2058,9 +2035,8 @@
// Join the loop body and increment and then tie the loop.
JoinEntryInstr* continue_join = nested_loop.continue_target();
if ((continue_join != NULL) || for_body.is_open()) {
- JoinEntryInstr* loop_entry =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ JoinEntryInstr* loop_entry = new (Z)
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
if (continue_join != NULL) {
if (for_body.is_open()) for_body.Goto(continue_join);
Instruction* current = AppendFragment(continue_join, for_increment);
@@ -2077,8 +2053,7 @@
// the context level (if any) matches the that of the increment
// expression.
AddInstruction(new (Z) CheckStackOverflowInstr(
- node->increment()->token_pos(), owner()->loop_depth(),
- owner()->GetNextDeoptId()));
+ node->increment()->token_pos(), owner()->loop_depth()));
}
if (node->condition() == NULL) {
@@ -2273,8 +2248,8 @@
BuildInstantiatedTypeArguments(node->token_pos(), type_args);
Value* num_elements =
Bind(new (Z) ConstantInstr(Smi::ZoneHandle(Z, Smi::New(node->length()))));
- CreateArrayInstr* create = new (Z) CreateArrayInstr(
- node->token_pos(), element_type, num_elements, owner()->GetNextDeoptId());
+ CreateArrayInstr* create =
+ new (Z) CreateArrayInstr(node->token_pos(), element_type, num_elements);
Value* array_val = Bind(create);
{
@@ -2324,16 +2299,16 @@
Z, Resolver::ResolveStatic(
cls, Library::PrivateCoreLibName(Symbols::InterpolateSingle()),
kTypeArgsLen, kNumberOfArguments, kNoArgumentNames));
- StaticCallInstr* call = new (Z) StaticCallInstr(
- node->token_pos(), function, kTypeArgsLen, kNoArgumentNames, values,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ StaticCallInstr* call = new (Z)
+ StaticCallInstr(node->token_pos(), function, kTypeArgsLen,
+ kNoArgumentNames, values, owner()->ic_data_array());
ReturnDefinition(call);
return;
}
arguments->Visit(&for_argument);
Append(for_argument);
- StringInterpolateInstr* instr = new (Z) StringInterpolateInstr(
- for_argument.value(), node->token_pos(), owner()->GetNextDeoptId());
+ StringInterpolateInstr* instr =
+ new (Z) StringInterpolateInstr(for_argument.value(), node->token_pos());
ReturnDefinition(instr);
}
@@ -2555,7 +2530,7 @@
InstanceCallInstr* call = new (Z) InstanceCallInstr(
node->token_pos(), node->function_name(), Token::kILLEGAL, arguments,
node->arguments()->type_args_len(), node->arguments()->names(), 1,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ owner()->ic_data_array());
ReturnDefinition(call);
}
}
@@ -2571,8 +2546,7 @@
BuildPushArguments(*node->arguments(), arguments);
StaticCallInstr* call = new (Z) StaticCallInstr(
node->token_pos(), node->function(), node->arguments()->type_args_len(),
- node->arguments()->names(), arguments, owner()->ic_data_array(),
- owner()->GetNextDeoptId());
+ node->arguments()->names(), arguments, owner()->ic_data_array());
if (node->function().recognized_kind() != MethodRecognizer::kUnknown) {
call->set_result_cid(MethodRecognizer::ResultCid(node->function()));
}
@@ -2606,8 +2580,8 @@
function_load->set_is_immutable(true);
Value* function_val = Bind(function_load);
- Definition* closure_call = new (Z) ClosureCallInstr(
- function_val, node, arguments, owner()->GetNextDeoptId());
+ Definition* closure_call =
+ new (Z) ClosureCallInstr(function_val, node, arguments);
if (result_needed) {
Value* result = Bind(closure_call);
Do(new (Z) StoreLocalInstr(*tmp_var, result, ST(node->token_pos())));
@@ -2631,15 +2605,13 @@
void EffectGraphVisitor::VisitInitStaticFieldNode(InitStaticFieldNode* node) {
Value* field = Bind(
new (Z) ConstantInstr(Field::ZoneHandle(Z, node->field().Original())));
- AddInstruction(new (Z) InitStaticFieldInstr(field, node->field(),
- owner()->GetNextDeoptId()));
+ AddInstruction(new (Z) InitStaticFieldInstr(field, node->field()));
}
void EffectGraphVisitor::VisitCloneContextNode(CloneContextNode* node) {
Value* context = Bind(BuildCurrentContext(node->token_pos()));
- Value* clone = Bind(new (Z) CloneContextInstr(node->token_pos(), context,
- owner()->GetNextDeoptId()));
+ Value* clone = Bind(new (Z) CloneContextInstr(node->token_pos(), context));
Do(BuildStoreContext(clone, node->token_pos()));
}
@@ -2673,10 +2645,9 @@
BuildPushArguments(*node->arguments(), arguments);
const intptr_t kTypeArgsLen = 0;
- Do(new (Z)
- StaticCallInstr(node->token_pos(), node->constructor(), kTypeArgsLen,
- node->arguments()->names(), arguments,
- owner()->ic_data_array(), owner()->GetNextDeoptId()));
+ Do(new (Z) StaticCallInstr(node->token_pos(), node->constructor(),
+ kTypeArgsLen, node->arguments()->names(),
+ arguments, owner()->ic_data_array()));
}
@@ -2715,10 +2686,9 @@
ASSERT(arguments->length() == 1);
BuildPushArguments(*node->arguments(), arguments);
const int kTypeArgsLen = 0;
- StaticCallInstr* call = new (Z)
- StaticCallInstr(node->token_pos(), node->constructor(), kTypeArgsLen,
- node->arguments()->names(), arguments,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ StaticCallInstr* call = new (Z) StaticCallInstr(
+ node->token_pos(), node->constructor(), kTypeArgsLen,
+ node->arguments()->names(), arguments, owner()->ic_data_array());
const intptr_t result_cid = GetResultCidOfListFactory(node);
if (result_cid != kDynamicCid) {
call->set_result_cid(result_cid);
@@ -2860,7 +2830,7 @@
}
return Bind(new (Z) InstantiateTypeArgumentsInstr(
token_pos, type_arguments, instantiator_class, instantiator_type_args,
- function_type_args, owner()->GetNextDeoptId()));
+ function_type_args));
}
@@ -2949,10 +2919,9 @@
const String& name =
String::ZoneHandle(Z, Field::GetterSymbol(node->field_name()));
const intptr_t kTypeArgsLen = 0;
- InstanceCallInstr* call = new (Z)
- InstanceCallInstr(node->token_pos(), name, Token::kGET, arguments,
- kTypeArgsLen, Object::null_array(), 1,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ InstanceCallInstr* call = new (Z) InstanceCallInstr(
+ node->token_pos(), name, Token::kGET, arguments, kTypeArgsLen,
+ Object::null_array(), 1, owner()->ic_data_array());
ReturnDefinition(call);
}
}
@@ -3014,10 +2983,9 @@
String::ZoneHandle(Z, Field::SetterSymbol(node->field_name()));
const int kTypeArgsLen = 0;
const intptr_t kNumArgsChecked = 1; // Do not check value type.
- InstanceCallInstr* call = new (Z)
- InstanceCallInstr(token_pos, name, Token::kSET, arguments, kTypeArgsLen,
- Object::null_array(), kNumArgsChecked,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ InstanceCallInstr* call = new (Z) InstanceCallInstr(
+ token_pos, name, Token::kSET, arguments, kTypeArgsLen,
+ Object::null_array(), kNumArgsChecked, owner()->ic_data_array());
ReturnDefinition(call);
}
@@ -3062,8 +3030,7 @@
const intptr_t kNumArgsChecked = 1; // Do not check value type.
Do(new (Z) InstanceCallInstr(token_pos, name, Token::kSET, arguments,
kTypeArgsLen, Object::null_array(),
- kNumArgsChecked, owner()->ic_data_array(),
- owner()->GetNextDeoptId()));
+ kNumArgsChecked, owner()->ic_data_array()));
ReturnDefinition(BuildLoadExprTemp(token_pos));
}
@@ -3126,10 +3093,10 @@
}
ASSERT(!getter_function.IsNull());
const intptr_t kTypeArgsLen = 0;
- StaticCallInstr* call = new (Z) StaticCallInstr(
- node->token_pos(), getter_function, kTypeArgsLen,
- Object::null_array(), // No names
- arguments, owner()->ic_data_array(), owner()->GetNextDeoptId());
+ StaticCallInstr* call =
+ new (Z) StaticCallInstr(node->token_pos(), getter_function, kTypeArgsLen,
+ Object::null_array(), // No names
+ arguments, owner()->ic_data_array());
ReturnDefinition(call);
}
@@ -3191,8 +3158,7 @@
const intptr_t kTypeArgsLen = 0;
call = new (Z) StaticCallInstr(token_pos, setter_function, kTypeArgsLen,
Object::null_array(), // No names.
- arguments, owner()->ic_data_array(),
- owner()->GetNextDeoptId());
+ arguments, owner()->ic_data_array());
}
if (result_is_needed) {
Do(call);
@@ -3284,9 +3250,8 @@
Value* other = Bind(new (Z) LoadLocalInstr(*other_var, token_pos));
// Receiver is not a number because numbers override equality.
const bool kNoNumberCheck = false;
- StrictCompareInstr* compare = new (Z)
- StrictCompareInstr(token_pos, Token::kEQ_STRICT, receiver, other,
- kNoNumberCheck, owner()->GetNextDeoptId());
+ StrictCompareInstr* compare = new (Z) StrictCompareInstr(
+ token_pos, Token::kEQ_STRICT, receiver, other, kNoNumberCheck);
return ReturnDefinition(compare);
}
case MethodRecognizer::kStringBaseLength:
@@ -3306,9 +3271,9 @@
Value* zero_val =
Bind(new (Z) ConstantInstr(Smi::ZoneHandle(Z, Smi::New(0))));
Value* load_val = Bind(load);
- StrictCompareInstr* compare = new (Z) StrictCompareInstr(
- token_pos, Token::kEQ_STRICT, load_val, zero_val, false,
- owner()->GetNextDeoptId()); // No number check.
+ StrictCompareInstr* compare = new (Z)
+ StrictCompareInstr(token_pos, Token::kEQ_STRICT, load_val, zero_val,
+ false); // No number check.
return ReturnDefinition(compare);
}
case MethodRecognizer::kGrowableArrayLength:
@@ -3351,8 +3316,8 @@
node->scope()->LookupVariable(Symbols::Length(), true);
Value* length =
Bind(new (Z) LoadLocalInstr(*length_parameter, token_pos));
- CreateArrayInstr* create_array = new CreateArrayInstr(
- token_pos, element_type, length, owner()->GetNextDeoptId());
+ CreateArrayInstr* create_array =
+ new CreateArrayInstr(token_pos, element_type, length);
return ReturnDefinition(create_array);
}
case MethodRecognizer::kBigint_getDigits: {
@@ -3642,7 +3607,7 @@
// Generate static call to super operator.
StaticCallInstr* load = new (Z) StaticCallInstr(
node->token_pos(), *super_function, kTypeArgsLen, Object::null_array(),
- arguments, owner()->ic_data_array(), owner()->GetNextDeoptId());
+ arguments, owner()->ic_data_array());
ReturnDefinition(load);
} else {
// Generate dynamic call to index operator.
@@ -3650,7 +3615,7 @@
InstanceCallInstr* load = new (Z) InstanceCallInstr(
node->token_pos(), Symbols::IndexToken(), Token::kINDEX, arguments,
kTypeArgsLen, Object::null_array(), checked_argument_count,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ owner()->ic_data_array());
ReturnDefinition(load);
}
}
@@ -3716,7 +3681,7 @@
StaticCallInstr* store = new (Z) StaticCallInstr(
token_pos, *super_function, kTypeArgsLen, Object::null_array(),
- arguments, owner()->ic_data_array(), owner()->GetNextDeoptId());
+ arguments, owner()->ic_data_array());
if (result_is_needed) {
Do(store);
return BuildLoadExprTemp(token_pos);
@@ -3729,7 +3694,7 @@
InstanceCallInstr* store = new (Z) InstanceCallInstr(
token_pos, Symbols::AssignIndexToken(), Token::kASSIGN_INDEX, arguments,
kTypeArgsLen, Object::null_array(), checked_argument_count,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ owner()->ic_data_array());
if (result_is_needed) {
Do(store);
return BuildLoadExprTemp(token_pos);
@@ -3900,11 +3865,11 @@
ASSERT(!async_set_thread_stack_trace.IsNull());
// Call _asyncSetThreadStackTrace
const intptr_t kTypeArgsLen = 0;
- StaticCallInstr* call_async_set_thread_stack_trace = new (Z)
- StaticCallInstr(node->token_pos().ToSynthetic(),
- async_set_thread_stack_trace, kTypeArgsLen,
- Object::null_array(), arguments,
- owner()->ic_data_array(), owner()->GetNextDeoptId());
+ StaticCallInstr* call_async_set_thread_stack_trace =
+ new (Z) StaticCallInstr(node->token_pos().ToSynthetic(),
+ async_set_thread_stack_trace, kTypeArgsLen,
+ Object::null_array(), arguments,
+ owner()->ic_data_array());
Do(call_async_set_thread_stack_trace);
}
@@ -3938,8 +3903,8 @@
// if we inline or not.
if (!function.IsImplicitGetterFunction() &&
!function.IsImplicitSetterFunction()) {
- CheckStackOverflowInstr* check = new (Z) CheckStackOverflowInstr(
- node->token_pos(), 0, owner()->GetNextDeoptId());
+ CheckStackOverflowInstr* check =
+ new (Z) CheckStackOverflowInstr(node->token_pos(), 0);
// If we are inlining don't actually attach the stack check. We must still
// create the stack check in order to allocate a deopt id.
if (!owner()->IsInlining()) {
@@ -3979,9 +3944,8 @@
if (is_top_level_sequence &&
(function.IsAsyncClosure() || function.IsSyncGenClosure() ||
function.IsAsyncGenClosure())) {
- JoinEntryInstr* preamble_end =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ JoinEntryInstr* preamble_end = new (Z)
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
ASSERT(exit() != NULL);
exit()->Goto(preamble_end);
ASSERT(exit()->next()->IsGoto());
@@ -4123,14 +4087,13 @@
if (for_try.is_open()) {
JoinEntryInstr* after_try = new (Z)
- JoinEntryInstr(owner()->AllocateBlockId(), original_handler_index,
- owner()->GetNextDeoptId());
+ JoinEntryInstr(owner()->AllocateBlockId(), original_handler_index);
for_try.Goto(after_try);
for_try.exit_ = after_try;
}
- JoinEntryInstr* try_entry = new (Z) JoinEntryInstr(
- owner()->AllocateBlockId(), try_handler_index, owner()->GetNextDeoptId());
+ JoinEntryInstr* try_entry =
+ new (Z) JoinEntryInstr(owner()->AllocateBlockId(), try_handler_index);
Goto(try_entry);
AppendFragment(try_entry, for_try);
@@ -4170,8 +4133,7 @@
if (for_catch.is_open()) {
JoinEntryInstr* join = new (Z)
- JoinEntryInstr(owner()->AllocateBlockId(), original_handler_index,
- owner()->GetNextDeoptId());
+ JoinEntryInstr(owner()->AllocateBlockId(), original_handler_index);
for_catch.Goto(join);
if (is_open()) Goto(join);
exit_ = join;
@@ -4196,8 +4158,7 @@
catch_block->rethrow_stacktrace_var(), finally_block->token_pos()));
for_finally.PushArgument(stacktrace);
for_finally.AddInstruction(
- new (Z) ReThrowInstr(catch_block->token_pos(), catch_handler_index,
- owner()->GetNextDeoptId()));
+ new (Z) ReThrowInstr(catch_block->token_pos(), catch_handler_index));
for_finally.CloseFragment();
}
ASSERT(!for_finally.is_open());
@@ -4260,9 +4221,9 @@
ZoneGrowableArray<PushArgumentInstr*>* push_arguments =
new (Z) ZoneGrowableArray<PushArgumentInstr*>(2);
BuildPushArguments(*args, push_arguments);
- return new (Z) StaticCallInstr(
- args_pos, no_such_method_func, kTypeArgsLen, Object::null_array(),
- push_arguments, owner()->ic_data_array(), owner()->GetNextDeoptId());
+ return new (Z) StaticCallInstr(args_pos, no_such_method_func, kTypeArgsLen,
+ Object::null_array(), push_arguments,
+ owner()->ic_data_array());
}
@@ -4328,8 +4289,7 @@
ASSERT(!func.IsNull());
return new (Z) StaticCallInstr(token_pos, func, kTypeArgsLen,
Object::null_array(), // No names.
- arguments, owner()->ic_data_array(),
- owner()->GetNextDeoptId());
+ arguments, owner()->ic_data_array());
}
@@ -4349,14 +4309,13 @@
PushArgument(for_exception.value());
Instruction* instr = NULL;
if (node->stacktrace() == NULL) {
- instr = new (Z) ThrowInstr(node->token_pos(), owner()->GetNextDeoptId());
+ instr = new (Z) ThrowInstr(node->token_pos());
} else {
ValueGraphVisitor for_stack_trace(owner());
node->stacktrace()->Visit(&for_stack_trace);
Append(for_stack_trace);
PushArgument(for_stack_trace.value());
- instr = new (Z) ReThrowInstr(node->token_pos(), owner()->catch_try_index(),
- owner()->GetNextDeoptId());
+ instr = new (Z) ReThrowInstr(node->token_pos(), owner()->catch_try_index());
}
AddInstruction(instr);
}
@@ -4396,8 +4355,7 @@
// context variable.
JoinEntryInstr* finally_entry =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
EffectGraphVisitor for_finally_block(owner());
for_finally_block.AdjustContextLevel(node->finally_block()->scope());
node->finally_block()->Visit(&for_finally_block);
@@ -4407,9 +4365,8 @@
}
if (for_finally_block.is_open()) {
- JoinEntryInstr* after_finally =
- new (Z) JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index(),
- owner()->GetNextDeoptId());
+ JoinEntryInstr* after_finally = new (Z)
+ JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
for_finally_block.Goto(after_finally);
for_finally_block.exit_ = after_finally;
}
@@ -4439,8 +4396,8 @@
AstPrinter ast_printer;
ast_printer.PrintFunctionScope(parsed_function());
}
- TargetEntryInstr* normal_entry = new (Z) TargetEntryInstr(
- AllocateBlockId(), CatchClauseNode::kInvalidTryIndex, GetNextDeoptId());
+ TargetEntryInstr* normal_entry = new (Z)
+ TargetEntryInstr(AllocateBlockId(), CatchClauseNode::kInvalidTryIndex);
graph_entry_ =
new (Z) GraphEntryInstr(parsed_function(), normal_entry, osr_id_);
EffectGraphVisitor for_effect(this);
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 5fbc056..41f7e95 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -114,11 +114,6 @@
intptr_t AllocateBlockId() { return ++last_used_block_id_; }
void SetInitialBlockId(intptr_t id) { last_used_block_id_ = id; }
- intptr_t GetNextDeoptId() {
- // TODO(rmacnak): Record current scope / context level.
- return thread()->GetNextDeoptId();
- }
-
intptr_t context_level() const;
void IncrementLoopDepth() { ++loop_depth_; }
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index dc9f142..f5b3030 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -1480,10 +1480,10 @@
new_join->AddDominatedBlock(block);
}
// Create a new target with the join as unconditional successor.
- TargetEntryInstr* new_target = new TargetEntryInstr(
- AllocateBlockId(), old_target->try_index(), Thread::kNoDeoptId);
+ TargetEntryInstr* new_target =
+ new TargetEntryInstr(AllocateBlockId(), old_target->try_index());
new_target->InheritDeoptTarget(zone(), new_join);
- GotoInstr* new_goto = new (Z) GotoInstr(new_join, Thread::kNoDeoptId);
+ GotoInstr* new_goto = new (Z) GotoInstr(new_join);
new_goto->InheritDeoptTarget(zone(), new_join);
new_target->LinkTo(new_goto);
new_target->set_last_instruction(new_goto);
@@ -1622,9 +1622,8 @@
InlineExitCollector* exit_collector =
new (Z) InlineExitCollector(owner_->caller_graph(), call_);
- ReturnInstr* result =
- new (Z) ReturnInstr(call_->instance_call()->token_pos(),
- new (Z) Value(last), Thread::kNoDeoptId);
+ ReturnInstr* result = new (Z)
+ ReturnInstr(call_->instance_call()->token_pos(), new (Z) Value(last));
owner_->caller_graph()->AppendTo(
last, result,
call_->env(), // Return can become deoptimization target.
@@ -1654,8 +1653,8 @@
const intptr_t try_idx = call_->GetBlock()->try_index();
// Start with a fresh target entry.
- TargetEntryInstr* entry = new (Z) TargetEntryInstr(
- AllocateBlockId(), try_idx, Thread::Current()->GetNextDeoptId());
+ TargetEntryInstr* entry =
+ new (Z) TargetEntryInstr(AllocateBlockId(), try_idx);
entry->InheritDeoptTarget(zone(), call_);
// This function uses a cursor (a pointer to the 'current' instruction) to
@@ -1720,7 +1719,7 @@
// the join.
JoinEntryInstr* join = callee_entry->AsJoinEntry();
ASSERT(join->dominator() != NULL);
- GotoInstr* goto_join = new GotoInstr(join, Thread::kNoDeoptId);
+ GotoInstr* goto_join = new GotoInstr(join);
goto_join->InheritDeoptTarget(zone(), join);
cursor->LinkTo(goto_join);
current_block->set_last_instruction(goto_join);
@@ -1750,13 +1749,13 @@
new Value(load_cid), new Value(cid_constant_end), kSmiCid,
call_->deopt_id());
BranchInstr* branch_top = upper_limit_branch =
- new BranchInstr(compare_top, Thread::kNoDeoptId);
+ new BranchInstr(compare_top);
branch_top->InheritDeoptTarget(zone(), call_);
cursor = AppendInstruction(cursor, branch_top);
current_block->set_last_instruction(branch_top);
- TargetEntryInstr* below_target = new TargetEntryInstr(
- AllocateBlockId(), try_idx, Thread::kNoDeoptId);
+ TargetEntryInstr* below_target =
+ new TargetEntryInstr(AllocateBlockId(), try_idx);
below_target->InheritDeoptTarget(zone(), call_);
current_block->AddDominatedBlock(below_target);
cursor = current_block = below_target;
@@ -1766,13 +1765,13 @@
call_->instance_call()->token_pos(), Token::kGTE,
new Value(load_cid), new Value(cid_constant), kSmiCid,
call_->deopt_id());
- branch = new BranchInstr(compare_bottom, Thread::kNoDeoptId);
+ branch = new BranchInstr(compare_bottom);
} else {
StrictCompareInstr* compare = new StrictCompareInstr(
call_->instance_call()->token_pos(), Token::kEQ_STRICT,
new Value(load_cid), new Value(cid_constant),
- /* number_check = */ false, Thread::kNoDeoptId);
- branch = new BranchInstr(compare, Thread::kNoDeoptId);
+ false); // No number check.
+ branch = new BranchInstr(compare);
}
branch->InheritDeoptTarget(zone(), call_);
@@ -1803,10 +1802,9 @@
JoinEntryInstr* join = callee_entry->AsJoinEntry();
ASSERT(join != NULL);
ASSERT(join->dominator() != NULL);
- true_target = new TargetEntryInstr(AllocateBlockId(), try_idx,
- Thread::kNoDeoptId);
+ true_target = new TargetEntryInstr(AllocateBlockId(), try_idx);
true_target->InheritDeoptTarget(zone(), join);
- GotoInstr* goto_join = new GotoInstr(join, Thread::kNoDeoptId);
+ GotoInstr* goto_join = new GotoInstr(join);
goto_join->InheritDeoptTarget(zone(), join);
true_target->LinkTo(goto_join);
true_target->set_last_instruction(goto_join);
@@ -1818,7 +1816,7 @@
// fall-through code below for non-inlined variants.
TargetEntryInstr* false_target =
- new TargetEntryInstr(AllocateBlockId(), try_idx, Thread::kNoDeoptId);
+ new TargetEntryInstr(AllocateBlockId(), try_idx);
false_target->InheritDeoptTarget(zone(), call_);
*branch->false_successor_address() = false_target;
cid_test_entry_block->AddDominatedBlock(false_target);
@@ -1828,15 +1826,14 @@
if (test_is_range) {
// If we tested against a range of Cids there are two different tests
// that can go to the no-cid-match target.
- JoinEntryInstr* join =
- new JoinEntryInstr(AllocateBlockId(), try_idx, Thread::kNoDeoptId);
- TargetEntryInstr* false_target2 = new TargetEntryInstr(
- AllocateBlockId(), try_idx, Thread::kNoDeoptId);
+ JoinEntryInstr* join = new JoinEntryInstr(AllocateBlockId(), try_idx);
+ TargetEntryInstr* false_target2 =
+ new TargetEntryInstr(AllocateBlockId(), try_idx);
*upper_limit_branch->false_successor_address() = false_target2;
cid_test_entry_block->AddDominatedBlock(false_target2);
cid_test_entry_block->AddDominatedBlock(join);
- GotoInstr* goto_1 = new GotoInstr(join, Thread::kNoDeoptId);
- GotoInstr* goto_2 = new GotoInstr(join, Thread::kNoDeoptId);
+ GotoInstr* goto_1 = new GotoInstr(join);
+ GotoInstr* goto_2 = new GotoInstr(join);
false_target->LinkTo(goto_1);
false_target2->LinkTo(goto_2);
false_target->set_last_instruction(goto_1);
@@ -1869,9 +1866,8 @@
owner_->caller_graph()->alloc_ssa_temp_index());
fallback_call->InheritDeoptTarget(zone(), call_);
fallback_call->set_total_call_count(call_->CallCount());
- ReturnInstr* fallback_return =
- new ReturnInstr(call_->instance_call()->token_pos(),
- new Value(fallback_call), Thread::kNoDeoptId);
+ ReturnInstr* fallback_return = new ReturnInstr(
+ call_->instance_call()->token_pos(), new Value(fallback_call));
fallback_return->InheritDeoptTargetAfter(owner_->caller_graph(), call_,
fallback_call);
AppendInstruction(AppendInstruction(cursor, fallback_call),
@@ -2247,9 +2243,8 @@
Definition* array = receiver;
Definition* index = call->ArgumentAt(1);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
@@ -2297,9 +2292,8 @@
Definition* index = call->ArgumentAt(1);
Definition* stored_value = call->ArgumentAt(2);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
if (flow_graph->isolate()->type_checks()) {
@@ -2435,9 +2429,8 @@
Definition* left = receiver;
Definition* right = call->ArgumentAt(1);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
// Arguments are checked. No need for class check.
BinaryDoubleOpInstr* double_bin_op = new (Z)
@@ -2460,9 +2453,8 @@
return false;
}
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
// Arguments are checked. No need for class check.
@@ -2483,9 +2475,8 @@
Definition* left = receiver;
Definition* right = call->ArgumentAt(1);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
// Right arguments is known to be smi: other._bitAndFromSmi(this);
BinarySmiOpInstr* smi_op =
@@ -2508,9 +2499,8 @@
Definition* array = receiver;
Definition* value = call->ArgumentAt(1);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
// This is an internal method, no need to check argument types.
@@ -2595,9 +2585,8 @@
ASSERT(array_cid != kIllegalCid);
Definition* array = receiver;
Definition* index = call->ArgumentAt(1);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
@@ -2639,9 +2628,8 @@
ASSERT(array_cid != kIllegalCid);
Definition* array = receiver;
Definition* index = call->ArgumentAt(1);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
@@ -2806,9 +2794,8 @@
Definition* str = receiver;
Definition* index = call->ArgumentAt(1);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
*last = PrepareInlineStringIndexOp(flow_graph, call, cid, str, index, *entry);
@@ -2835,9 +2822,8 @@
Definition* str = receiver;
Definition* index = call->ArgumentAt(1);
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
*last = PrepareInlineStringIndexOp(flow_graph, call, cid, str, index, *entry);
@@ -2949,9 +2935,8 @@
return false;
}
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
switch (kind) {
@@ -3068,9 +3053,8 @@
if (!ShouldInlineSimd()) {
return false;
}
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
Definition* mask_definition = call->ArgumentAt(1);
@@ -3097,9 +3081,8 @@
if (!ShouldInlineSimd()) {
return false;
}
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
Definition* mask_definition = call->ArgumentAt(2);
@@ -3127,9 +3110,8 @@
if (!ShouldInlineSimd()) {
return false;
}
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
switch (kind) {
@@ -3184,9 +3166,8 @@
if (!ShouldInlineSimd()) {
return false;
}
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
switch (kind) {
@@ -3236,9 +3217,8 @@
if (!ShouldInlineSimd()) {
return false;
}
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
switch (kind) {
@@ -3318,9 +3298,8 @@
if (!CanUnboxDouble()) {
return false;
}
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Instruction* cursor = *entry;
@@ -3681,9 +3660,8 @@
return InlineMathCFunction(flow_graph, call, kind, entry, last);
case MethodRecognizer::kObjectConstructor: {
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
ASSERT(!call->HasUses());
*last = NULL; // Empty body.
@@ -3698,11 +3676,10 @@
if (length >= 0 && length <= Array::kMaxElements) {
Value* type = new (Z) Value(call->ArgumentAt(0));
*entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(),
- Thread::kNoDeoptId);
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
- *last = new (Z) CreateArrayInstr(call->token_pos(), type,
- num_elements, Thread::kNoDeoptId);
+ *last =
+ new (Z) CreateArrayInstr(call->token_pos(), type, num_elements);
flow_graph->AppendTo(
*entry, *last,
call->deopt_id() != Thread::kNoDeoptId ? call->env() : NULL,
@@ -3730,9 +3707,8 @@
}
if (!type.IsNull()) {
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
*last = new (Z) ConstantInstr(type);
flow_graph->AppendTo(
@@ -3747,9 +3723,8 @@
case MethodRecognizer::kOneByteStringSetAt: {
// This is an internal method, no need to check argument types nor
// range.
- *entry = new (Z)
- TargetEntryInstr(flow_graph->allocate_block_id(),
- call->GetBlock()->try_index(), Thread::kNoDeoptId);
+ *entry = new (Z) TargetEntryInstr(flow_graph->allocate_block_id(),
+ call->GetBlock()->try_index());
(*entry)->InheritDeoptTarget(Z, call);
Definition* str = call->ArgumentAt(0);
Definition* index = call->ArgumentAt(1);
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 358f299..fe521da 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -604,9 +604,7 @@
GraphEntryInstr::GraphEntryInstr(const ParsedFunction& parsed_function,
TargetEntryInstr* normal_entry,
intptr_t osr_id)
- : BlockEntryInstr(0,
- CatchClauseNode::kInvalidTryIndex,
- Thread::Current()->GetNextDeoptId()),
+ : BlockEntryInstr(0, CatchClauseNode::kInvalidTryIndex),
parsed_function_(parsed_function),
normal_entry_(normal_entry),
catch_entries_(),
@@ -1111,8 +1109,7 @@
// we can simply jump to the beginning of the block.
ASSERT(instr->previous() == this);
- GotoInstr* goto_join =
- new GotoInstr(AsJoinEntry(), Thread::Current()->GetNextDeoptId());
+ GotoInstr* goto_join = new GotoInstr(AsJoinEntry());
goto_join->CopyDeoptIdFrom(*parent);
graph_entry->normal_entry()->LinkTo(goto_join);
return true;
@@ -1339,7 +1336,7 @@
void Instruction::Goto(JoinEntryInstr* entry) {
- LinkTo(new GotoInstr(entry, Thread::Current()->GetNextDeoptId()));
+ LinkTo(new GotoInstr(entry));
}
@@ -3225,9 +3222,8 @@
Token::Kind kind,
Value* left,
Value* right,
- bool needs_number_check,
- intptr_t deopt_id)
- : TemplateComparison(token_pos, kind, deopt_id),
+ bool needs_number_check)
+ : TemplateComparison(token_pos, kind, Thread::Current()->GetNextDeoptId()),
needs_number_check_(needs_number_check) {
ASSERT((kind == Token::kEQ_STRICT) || (kind == Token::kNE_STRICT));
SetInputAt(0, left);
@@ -3838,7 +3834,7 @@
ComparisonInstr* StrictCompareInstr::CopyWithNewOperands(Value* new_left,
Value* new_right) {
return new StrictCompareInstr(token_pos(), kind(), new_left, new_right,
- needs_number_check(), Thread::kNoDeoptId);
+ needs_number_check());
}
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index fdcca2f..e017cf7 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -1262,8 +1262,8 @@
DEFINE_INSTRUCTION_TYPE_CHECK(BlockEntry)
protected:
- BlockEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
- : Instruction(deopt_id),
+ BlockEntryInstr(intptr_t block_id, intptr_t try_index)
+ : Instruction(Thread::Current()->GetNextDeoptId()),
block_id_(block_id),
try_index_(try_index),
preorder_number_(-1),
@@ -1442,8 +1442,8 @@
class JoinEntryInstr : public BlockEntryInstr {
public:
- JoinEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
- : BlockEntryInstr(block_id, try_index, deopt_id),
+ JoinEntryInstr(intptr_t block_id, intptr_t try_index)
+ : BlockEntryInstr(block_id, try_index),
predecessors_(2), // Two is the assumed to be the common case.
phis_(NULL) {}
@@ -1512,8 +1512,8 @@
class TargetEntryInstr : public BlockEntryInstr {
public:
- TargetEntryInstr(intptr_t block_id, intptr_t try_index, intptr_t deopt_id)
- : BlockEntryInstr(block_id, try_index, deopt_id),
+ TargetEntryInstr(intptr_t block_id, intptr_t try_index)
+ : BlockEntryInstr(block_id, try_index),
predecessor_(NULL),
edge_weight_(0.0) {}
@@ -1553,10 +1553,8 @@
public:
IndirectEntryInstr(intptr_t block_id,
intptr_t indirect_id,
- intptr_t try_index,
- intptr_t deopt_id)
- : JoinEntryInstr(block_id, try_index, deopt_id),
- indirect_id_(indirect_id) {}
+ intptr_t try_index)
+ : JoinEntryInstr(block_id, try_index), indirect_id_(indirect_id) {}
DECLARE_INSTRUCTION(IndirectEntry)
@@ -1583,7 +1581,7 @@
bool needs_stacktrace,
intptr_t deopt_id,
bool should_restore_closure_context = false)
- : BlockEntryInstr(block_id, try_index, deopt_id),
+ : BlockEntryInstr(block_id, try_index),
graph_entry_(graph_entry),
predecessor_(NULL),
catch_handler_types_(Array::ZoneHandle(handler_types.raw())),
@@ -1593,7 +1591,9 @@
needs_stacktrace_(needs_stacktrace),
should_restore_closure_context_(should_restore_closure_context),
handler_token_pos_(handler_token_pos),
- is_generated_(is_generated) {}
+ is_generated_(is_generated) {
+ deopt_id_ = deopt_id;
+ }
DECLARE_INSTRUCTION(CatchBlockEntry)
@@ -2108,8 +2108,9 @@
class ReturnInstr : public TemplateInstruction<1, NoThrow> {
public:
- ReturnInstr(TokenPosition token_pos, Value* value, intptr_t deopt_id)
- : TemplateInstruction(deopt_id), token_pos_(token_pos) {
+ ReturnInstr(TokenPosition token_pos, Value* value)
+ : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
+ token_pos_(token_pos) {
SetInputAt(0, value);
}
@@ -2137,8 +2138,9 @@
class ThrowInstr : public TemplateInstruction<0, Throws> {
public:
- explicit ThrowInstr(TokenPosition token_pos, intptr_t deopt_id)
- : TemplateInstruction(deopt_id), token_pos_(token_pos) {}
+ explicit ThrowInstr(TokenPosition token_pos)
+ : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
+ token_pos_(token_pos) {}
DECLARE_INSTRUCTION(Throw)
@@ -2161,10 +2163,8 @@
public:
// 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the
// rethrow has been artificially generated by the parser.
- ReThrowInstr(TokenPosition token_pos,
- intptr_t catch_try_index,
- intptr_t deopt_id)
- : TemplateInstruction(deopt_id),
+ ReThrowInstr(TokenPosition token_pos, intptr_t catch_try_index)
+ : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos),
catch_try_index_(catch_try_index) {}
@@ -2214,8 +2214,8 @@
class GotoInstr : public TemplateInstruction<0, NoThrow> {
public:
- explicit GotoInstr(JoinEntryInstr* entry, intptr_t deopt_id)
- : TemplateInstruction(deopt_id),
+ explicit GotoInstr(JoinEntryInstr* entry)
+ : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
block_(NULL),
successor_(entry),
edge_weight_(0.0),
@@ -2428,8 +2428,10 @@
class BranchInstr : public Instruction {
public:
- explicit BranchInstr(ComparisonInstr* comparison, intptr_t deopt_id)
- : Instruction(deopt_id), comparison_(comparison), constant_target_(NULL) {
+ explicit BranchInstr(ComparisonInstr* comparison)
+ : Instruction(Thread::Current()->GetNextDeoptId()),
+ comparison_(comparison),
+ constant_target_(NULL) {
ASSERT(comparison->env() == NULL);
for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) {
comparison->InputAt(i)->set_instruction(this);
@@ -2708,8 +2710,9 @@
class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
public:
- AssertBooleanInstr(TokenPosition token_pos, Value* value, intptr_t deopt_id)
- : TemplateDefinition(deopt_id), token_pos_(token_pos) {
+ AssertBooleanInstr(TokenPosition token_pos, Value* value)
+ : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
+ token_pos_(token_pos) {
SetInputAt(0, value);
}
@@ -2738,8 +2741,8 @@
// a computation, not a value, because it's mutable.
class CurrentContextInstr : public TemplateDefinition<0, NoThrow> {
public:
- explicit CurrentContextInstr(intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {}
+ CurrentContextInstr()
+ : TemplateDefinition(Thread::Current()->GetNextDeoptId()) {}
DECLARE_INSTRUCTION(CurrentContext)
virtual CompileType ComputeType() const;
@@ -2822,9 +2825,8 @@
public:
ClosureCallInstr(Value* function,
ClosureCallNode* node,
- ZoneGrowableArray<PushArgumentInstr*>* arguments,
- intptr_t deopt_id)
- : TemplateDartCall(deopt_id,
+ ZoneGrowableArray<PushArgumentInstr*>* arguments)
+ : TemplateDartCall(Thread::Current()->GetNextDeoptId(),
node->arguments()->type_args_len(),
node->arguments()->names(),
arguments,
@@ -2837,9 +2839,8 @@
ZoneGrowableArray<PushArgumentInstr*>* arguments,
intptr_t type_args_len,
const Array& argument_names,
- TokenPosition token_pos,
- intptr_t deopt_id)
- : TemplateDartCall(deopt_id,
+ TokenPosition token_pos)
+ : TemplateDartCall(Thread::Current()->GetNextDeoptId(),
type_args_len,
argument_names,
arguments,
@@ -2873,9 +2874,8 @@
intptr_t type_args_len,
const Array& argument_names,
intptr_t checked_argument_count,
- const ZoneGrowableArray<const ICData*>& ic_data_array,
- intptr_t deopt_id)
- : TemplateDartCall(deopt_id,
+ const ZoneGrowableArray<const ICData*>& ic_data_array)
+ : TemplateDartCall(Thread::Current()->GetNextDeoptId(),
type_args_len,
argument_names,
arguments,
@@ -3033,8 +3033,7 @@
Token::Kind kind,
Value* left,
Value* right,
- bool needs_number_check,
- intptr_t deopt_id);
+ bool needs_number_check);
DECLARE_INSTRUCTION(StrictCompare)
@@ -3246,11 +3245,8 @@
// materialization of true and false constants.
class IfThenElseInstr : public Definition {
public:
- IfThenElseInstr(ComparisonInstr* comparison,
- Value* if_true,
- Value* if_false,
- intptr_t deopt_id)
- : Definition(deopt_id),
+ IfThenElseInstr(ComparisonInstr* comparison, Value* if_true, Value* if_false)
+ : Definition(Thread::Current()->GetNextDeoptId()),
comparison_(comparison),
if_true_(Smi::Cast(if_true->BoundConstant()).Value()),
if_false_(Smi::Cast(if_false->BoundConstant()).Value()) {
@@ -3332,9 +3328,8 @@
intptr_t type_args_len,
const Array& argument_names,
ZoneGrowableArray<PushArgumentInstr*>* arguments,
- const ZoneGrowableArray<const ICData*>& ic_data_array,
- intptr_t deopt_id)
- : TemplateDartCall(deopt_id,
+ const ZoneGrowableArray<const ICData*>& ic_data_array)
+ : TemplateDartCall(Thread::Current()->GetNextDeoptId(),
type_args_len,
argument_names,
arguments,
@@ -4054,10 +4049,8 @@
class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
public:
- StringInterpolateInstr(Value* value,
- TokenPosition token_pos,
- intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ StringInterpolateInstr(Value* value, TokenPosition token_pos)
+ : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos),
function_(Function::ZoneHandle()) {
SetInputAt(0, value);
@@ -4392,9 +4385,8 @@
public:
CreateArrayInstr(TokenPosition token_pos,
Value* element_type,
- Value* num_elements,
- intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ Value* num_elements)
+ : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos),
identity_(AliasIdentity::Unknown()) {
SetInputAt(kElementTypePos, element_type);
@@ -4602,9 +4594,10 @@
InstantiateTypeInstr(TokenPosition token_pos,
const AbstractType& type,
Value* instantiator_type_arguments,
- Value* function_type_arguments,
- intptr_t deopt_id)
- : TemplateDefinition(deopt_id), token_pos_(token_pos), type_(type) {
+ Value* function_type_arguments)
+ : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
+ token_pos_(token_pos),
+ type_(type) {
ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle());
SetInputAt(0, instantiator_type_arguments);
SetInputAt(1, function_type_arguments);
@@ -4637,9 +4630,8 @@
const TypeArguments& type_arguments,
const Class& instantiator_class,
Value* instantiator_type_arguments,
- Value* function_type_arguments,
- intptr_t deopt_id)
- : TemplateDefinition(deopt_id),
+ Value* function_type_arguments)
+ : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos),
type_arguments_(type_arguments),
instantiator_class_(instantiator_class) {
@@ -4700,8 +4692,9 @@
class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
public:
- InitStaticFieldInstr(Value* input, const Field& field, intptr_t deopt_id)
- : TemplateInstruction(deopt_id), field_(field) {
+ InitStaticFieldInstr(Value* input, const Field& field)
+ : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
+ field_(field) {
SetInputAt(0, input);
CheckField(field);
}
@@ -4724,10 +4717,9 @@
class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
public:
- CloneContextInstr(TokenPosition token_pos,
- Value* context_value,
- intptr_t deopt_id)
- : TemplateDefinition(deopt_id), token_pos_(token_pos) {
+ CloneContextInstr(TokenPosition token_pos, Value* context_value)
+ : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
+ token_pos_(token_pos) {
SetInputAt(0, context_value);
}
@@ -7262,10 +7254,8 @@
class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
public:
- CheckStackOverflowInstr(TokenPosition token_pos,
- intptr_t loop_depth,
- intptr_t deopt_id)
- : TemplateInstruction(deopt_id),
+ CheckStackOverflowInstr(TokenPosition token_pos, intptr_t loop_depth)
+ : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
token_pos_(token_pos),
loop_depth_(loop_depth) {}
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index ad21c9f8..0e35034 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -2485,15 +2485,9 @@
const Code& stub = Code::ZoneHandle(compiler->zone(),
StubCode::AllocateArray_entry()->code());
compiler->AddStubCallTarget(stub);
- if (deopt_id() == Thread::kNoDeoptId) {
- ASSERT(compiler->is_optimizing());
- compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- } else {
- compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
- *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- }
+ compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
+ *StubCode::AllocateArray_entry(),
+ RawPcDescriptors::kOther, locs());
ASSERT(locs()->out(0).reg() == kResultReg);
}
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index abe7a07..5ed8699 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -2214,15 +2214,9 @@
const Code& stub = Code::ZoneHandle(compiler->zone(),
StubCode::AllocateArray_entry()->code());
compiler->AddStubCallTarget(stub);
- if (deopt_id() == Thread::kNoDeoptId) {
- ASSERT(compiler->is_optimizing());
- compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- } else {
- compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
- *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- }
+ compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
+ *StubCode::AllocateArray_entry(),
+ RawPcDescriptors::kOther, locs());
ASSERT(locs()->out(0).reg() == kResultReg);
}
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 46b2802..187e071 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -2124,15 +2124,9 @@
const Code& stub = Code::ZoneHandle(compiler->zone(),
StubCode::AllocateArray_entry()->code());
compiler->AddStubCallTarget(stub);
- if (deopt_id() == Thread::kNoDeoptId) {
- ASSERT(compiler->is_optimizing());
- compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- } else {
- compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
- *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- }
+ compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
+ *StubCode::AllocateArray_entry(),
+ RawPcDescriptors::kOther, locs());
__ Bind(&done);
ASSERT(locs()->out(0).reg() == kResultReg);
}
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 8d001b2..a4fcff5 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -2359,15 +2359,9 @@
const Code& stub = Code::ZoneHandle(compiler->zone(),
StubCode::AllocateArray_entry()->code());
compiler->AddStubCallTarget(stub);
- if (deopt_id() == Thread::kNoDeoptId) {
- ASSERT(compiler->is_optimizing());
- compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- } else {
- compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
- *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- }
+ compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
+ *StubCode::AllocateArray_entry(),
+ RawPcDescriptors::kOther, locs());
__ Bind(&done);
ASSERT(locs()->out(0).reg() == kResultReg);
}
diff --git a/runtime/vm/intermediate_language_test.cc b/runtime/vm/intermediate_language_test.cc
index 46b916f..61b9e05 100644
--- a/runtime/vm/intermediate_language_test.cc
+++ b/runtime/vm/intermediate_language_test.cc
@@ -8,19 +8,19 @@
namespace dart {
TEST_CASE(InstructionTests) {
- TargetEntryInstr* target_instr = new TargetEntryInstr(
- 1, CatchClauseNode::kInvalidTryIndex, Thread::kNoDeoptId);
+ TargetEntryInstr* target_instr =
+ new TargetEntryInstr(1, CatchClauseNode::kInvalidTryIndex);
EXPECT(target_instr->IsBlockEntry());
EXPECT(!target_instr->IsDefinition());
- CurrentContextInstr* context = new CurrentContextInstr(Thread::kNoDeoptId);
+ CurrentContextInstr* context = new CurrentContextInstr();
EXPECT(context->IsDefinition());
EXPECT(!context->IsBlockEntry());
}
TEST_CASE(OptimizationTests) {
- JoinEntryInstr* join = new JoinEntryInstr(
- 1, CatchClauseNode::kInvalidTryIndex, Thread::kNoDeoptId);
+ JoinEntryInstr* join =
+ new JoinEntryInstr(1, CatchClauseNode::kInvalidTryIndex);
Definition* def1 = new PhiInstr(join, 0);
Definition* def2 = new PhiInstr(join, 0);
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 0bd8990..8f22f33 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -2158,15 +2158,9 @@
const Code& stub = Code::ZoneHandle(compiler->zone(),
StubCode::AllocateArray_entry()->code());
compiler->AddStubCallTarget(stub);
- if (deopt_id() == Thread::kNoDeoptId) {
- ASSERT(compiler->is_optimizing());
- compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- } else {
- compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
- *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther, locs());
- }
+ compiler->GenerateCallWithDeopt(token_pos(), deopt_id(),
+ *StubCode::AllocateArray_entry(),
+ RawPcDescriptors::kOther, locs());
__ Bind(&done);
ASSERT(locs()->out(0).reg() == kResultReg);
}
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc
index de5ccd2..0ef00b2 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -170,8 +170,7 @@
intptr_t block_id = builder.AllocateBlockId();
TargetEntryInstr* normal_entry =
- new TargetEntryInstr(block_id, CatchClauseNode::kInvalidTryIndex,
- Thread::Current()->GetNextDeoptId());
+ new TargetEntryInstr(block_id, CatchClauseNode::kInvalidTryIndex);
GraphEntryInstr* graph_entry = new GraphEntryInstr(
parsed_function, normal_entry, Compiler::kNoOSRDeoptId);
FlowGraph* graph = new FlowGraph(parsed_function, graph_entry, block_id);
@@ -319,8 +318,7 @@
}
void AddIntrinsicReturn(Value* value) {
- ReturnInstr* instr =
- new ReturnInstr(TokenPos(), value, Thread::Current()->GetNextDeoptId());
+ ReturnInstr* instr = new ReturnInstr(TokenPos(), value);
AddInstruction(instr);
entry_->set_last_instruction(instr);
}
diff --git a/runtime/vm/jit_optimizer.cc b/runtime/vm/jit_optimizer.cc
index ed05244..151e187 100644
--- a/runtime/vm/jit_optimizer.cc
+++ b/runtime/vm/jit_optimizer.cc
@@ -602,7 +602,7 @@
StrictCompareInstr* comp = new (Z)
StrictCompareInstr(call->token_pos(), Token::kEQ_STRICT,
new (Z) Value(left), new (Z) Value(right),
- /* number_check = */ false, Thread::kNoDeoptId);
+ false); // No number check.
ReplaceCall(call, comp);
return true;
}
@@ -1356,9 +1356,10 @@
ConstantInstr* cid =
flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(type_cid)));
- StrictCompareInstr* check_cid = new (Z) StrictCompareInstr(
- call->token_pos(), Token::kEQ_STRICT, new (Z) Value(left_cid),
- new (Z) Value(cid), /* number_check = */ false, Thread::kNoDeoptId);
+ StrictCompareInstr* check_cid =
+ new (Z) StrictCompareInstr(call->token_pos(), Token::kEQ_STRICT,
+ new (Z) Value(left_cid), new (Z) Value(cid),
+ false); // No number check.
ReplaceCall(call, check_cid);
return;
}
diff --git a/runtime/vm/kernel_binary_flowgraph.cc b/runtime/vm/kernel_binary_flowgraph.cc
index 9e39c23..e6a41fc 100644
--- a/runtime/vm/kernel_binary_flowgraph.cc
+++ b/runtime/vm/kernel_binary_flowgraph.cc
@@ -3554,7 +3554,7 @@
Fragment loop(join);
loop += CheckStackOverflow();
loop += condition;
- entry = new (Z) GotoInstr(join, Thread::Current()->GetNextDeoptId());
+ entry = new (Z) GotoInstr(join);
} else {
entry = condition.entry;
}
@@ -3588,8 +3588,7 @@
repeat += Goto(join);
loop_depth_dec();
- return Fragment(new (Z) GotoInstr(join, Thread::Current()->GetNextDeoptId()),
- loop_exit);
+ return Fragment(new (Z) GotoInstr(join), loop_exit);
}
Fragment StreamingFlowGraphBuilder::BuildForStatement() {
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index f28bad7..e55dc92 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -2017,7 +2017,6 @@
intptr_t osr_id,
intptr_t first_block_id)
: translation_helper_(Thread::Current()),
- thread_(translation_helper_.thread()),
zone_(translation_helper_.zone()),
node_(node),
parsed_function_(parsed_function),
@@ -2249,9 +2248,9 @@
Fragment FlowGraphBuilder::InstantiateType(const AbstractType& type) {
Value* function_type_args = Pop();
Value* instantiator_type_args = Pop();
- InstantiateTypeInstr* instr = new (Z) InstantiateTypeInstr(
- TokenPosition::kNoSource, type, instantiator_type_args,
- function_type_args, GetNextDeoptId());
+ InstantiateTypeInstr* instr =
+ new (Z) InstantiateTypeInstr(TokenPosition::kNoSource, type,
+ instantiator_type_args, function_type_args);
Push(instr);
return Fragment(instr);
}
@@ -2263,7 +2262,7 @@
Value* instantiator_type_args = Pop();
InstantiateTypeArgumentsInstr* instr = new (Z) InstantiateTypeArgumentsInstr(
TokenPosition::kNoSource, type_arguments, *active_class_.klass,
- instantiator_type_args, function_type_args, GetNextDeoptId());
+ instantiator_type_args, function_type_args);
Push(instr);
return Fragment(instr);
}
@@ -2353,9 +2352,8 @@
bool number_check /* = false */) {
Value* right = Pop();
Value* left = Pop();
- StrictCompareInstr* compare =
- new (Z) StrictCompareInstr(TokenPosition::kNoSource, kind, left, right,
- number_check, GetNextDeoptId());
+ StrictCompareInstr* compare = new (Z) StrictCompareInstr(
+ TokenPosition::kNoSource, kind, left, right, number_check);
Push(compare);
return Fragment(compare);
}
@@ -2383,8 +2381,8 @@
Value* left_value = Pop();
StrictCompareInstr* compare = new (Z) StrictCompareInstr(
TokenPosition::kNoSource, negate ? Token::kNE_STRICT : Token::kEQ_STRICT,
- left_value, right_value, false, GetNextDeoptId());
- BranchInstr* branch = new (Z) BranchInstr(compare, GetNextDeoptId());
+ left_value, right_value, false);
+ BranchInstr* branch = new (Z) BranchInstr(compare);
*then_entry = *branch->true_successor_address() = BuildTargetEntry();
*otherwise_entry = *branch->false_successor_address() = BuildTargetEntry();
return Fragment(branch).closed();
@@ -2396,10 +2394,9 @@
TargetEntryInstr** otherwise_entry) {
Value* rhs = Pop();
Value* lhs = Pop();
- StrictCompareInstr* compare =
- new (Z) StrictCompareInstr(TokenPosition::kNoSource, Token::kEQ_STRICT,
- lhs, rhs, false, GetNextDeoptId());
- BranchInstr* branch = new (Z) BranchInstr(compare, GetNextDeoptId());
+ StrictCompareInstr* compare = new (Z) StrictCompareInstr(
+ TokenPosition::kNoSource, Token::kEQ_STRICT, lhs, rhs, false);
+ BranchInstr* branch = new (Z) BranchInstr(compare);
*then_entry = *branch->true_successor_address() = BuildTargetEntry();
*otherwise_entry = *branch->false_successor_address() = BuildTargetEntry();
return Fragment(branch).closed();
@@ -2449,8 +2446,8 @@
// => We therefore create a block for the body (fresh try index) and another
// join block (with current try index).
Fragment body;
- JoinEntryInstr* entry = new (Z)
- JoinEntryInstr(AllocateBlockId(), try_handler_index, GetNextDeoptId());
+ JoinEntryInstr* entry =
+ new (Z) JoinEntryInstr(AllocateBlockId(), try_handler_index);
body += LoadLocal(parsed_function_->current_context_var());
body += StoreLocal(TokenPosition::kNoSource, CurrentCatchContext());
body += Drop();
@@ -2471,8 +2468,8 @@
Fragment FlowGraphBuilder::CheckStackOverflow() {
- return Fragment(new (Z) CheckStackOverflowInstr(
- TokenPosition::kNoSource, loop_depth_, GetNextDeoptId()));
+ return Fragment(
+ new (Z) CheckStackOverflowInstr(TokenPosition::kNoSource, loop_depth_));
}
@@ -2481,8 +2478,8 @@
Fragment instructions = LoadLocal(context_variable);
- CloneContextInstr* clone_instruction = new (Z)
- CloneContextInstr(TokenPosition::kNoSource, Pop(), GetNextDeoptId());
+ CloneContextInstr* clone_instruction =
+ new (Z) CloneContextInstr(TokenPosition::kNoSource, Pop());
instructions <<= clone_instruction;
Push(clone_instruction);
@@ -2502,17 +2499,16 @@
Fragment FlowGraphBuilder::CreateArray() {
Value* element_count = Pop();
- CreateArrayInstr* array =
- new (Z) CreateArrayInstr(TokenPosition::kNoSource,
- Pop(), // Element type.
- element_count, GetNextDeoptId());
+ CreateArrayInstr* array = new (Z) CreateArrayInstr(TokenPosition::kNoSource,
+ Pop(), // Element type.
+ element_count);
Push(array);
return Fragment(array);
}
Fragment FlowGraphBuilder::Goto(JoinEntryInstr* destination) {
- return Fragment(new (Z) GotoInstr(destination, GetNextDeoptId())).closed();
+ return Fragment(new (Z) GotoInstr(destination)).closed();
}
@@ -2540,9 +2536,9 @@
intptr_t num_args_checked) {
ArgumentArray arguments = GetArguments(argument_count);
const intptr_t kTypeArgsLen = 0; // Generic instance calls not yet supported.
- InstanceCallInstr* call = new (Z) InstanceCallInstr(
- position, name, kind, arguments, kTypeArgsLen, argument_names,
- num_args_checked, ic_data_array_, GetNextDeoptId());
+ InstanceCallInstr* call = new (Z)
+ InstanceCallInstr(position, name, kind, arguments, kTypeArgsLen,
+ argument_names, num_args_checked, ic_data_array_);
Push(call);
return Fragment(call);
}
@@ -2553,9 +2549,9 @@
Value* function = Pop();
ArgumentArray arguments = GetArguments(argument_count);
const intptr_t kTypeArgsLen = 0; // Generic closures not yet supported.
- ClosureCallInstr* call = new (Z)
- ClosureCallInstr(function, arguments, kTypeArgsLen, argument_names,
- TokenPosition::kNoSource, GetNextDeoptId());
+ ClosureCallInstr* call =
+ new (Z) ClosureCallInstr(function, arguments, kTypeArgsLen,
+ argument_names, TokenPosition::kNoSource);
Push(call);
return Fragment(call);
}
@@ -2564,8 +2560,7 @@
Fragment FlowGraphBuilder::ThrowException(TokenPosition position) {
Fragment instructions;
instructions += Drop();
- instructions +=
- Fragment(new (Z) ThrowInstr(position, GetNextDeoptId())).closed();
+ instructions += Fragment(new (Z) ThrowInstr(position)).closed();
// Use it's side effect of leaving a constant on the stack (does not change
// the graph).
NullConstant();
@@ -2581,9 +2576,8 @@
Fragment instructions;
instructions += Drop();
instructions += Drop();
- instructions += Fragment(new (Z) ReThrowInstr(position, catch_try_index,
- GetNextDeoptId()))
- .closed();
+ instructions +=
+ Fragment(new (Z) ReThrowInstr(position, catch_try_index)).closed();
// Use it's side effect of leaving a constant on the stack (does not change
// the graph).
NullConstant();
@@ -2663,8 +2657,8 @@
Fragment FlowGraphBuilder::InitStaticField(const dart::Field& field) {
- InitStaticFieldInstr* init = new (Z)
- InitStaticFieldInstr(Pop(), MayCloneField(Z, field), GetNextDeoptId());
+ InitStaticFieldInstr* init =
+ new (Z) InitStaticFieldInstr(Pop(), MayCloneField(Z, field));
return Fragment(init);
}
@@ -2727,8 +2721,7 @@
instructions += Drop();
}
- ReturnInstr* return_instr =
- new (Z) ReturnInstr(position, value, GetNextDeoptId());
+ ReturnInstr* return_instr = new (Z) ReturnInstr(position, value);
if (exit_collector_ != NULL) exit_collector_->AddExit(return_instr);
instructions <<= return_instr;
@@ -2774,7 +2767,7 @@
const intptr_t kTypeArgsLen = 0; // Generic static calls not yet supported.
StaticCallInstr* call =
new (Z) StaticCallInstr(position, target, kTypeArgsLen, argument_names,
- arguments, ic_data_array_, GetNextDeoptId());
+ arguments, ic_data_array_);
const intptr_t list_cid =
GetResultCidOfListFactory(Z, target, argument_count);
if (list_cid != kDynamicCid) {
@@ -2888,7 +2881,7 @@
Fragment FlowGraphBuilder::StringInterpolate(TokenPosition position) {
Value* array = Pop();
StringInterpolateInstr* interpolate =
- new (Z) StringInterpolateInstr(array, position, GetNextDeoptId());
+ new (Z) StringInterpolateInstr(array, position);
Push(interpolate);
return Fragment(interpolate);
}
@@ -3938,8 +3931,8 @@
Fragment FlowGraphBuilder::AssertBool() {
Value* value = Pop();
- AssertBooleanInstr* instr = new (Z)
- AssertBooleanInstr(TokenPosition::kNoSource, value, GetNextDeoptId());
+ AssertBooleanInstr* instr =
+ new (Z) AssertBooleanInstr(TokenPosition::kNoSource, value);
Push(instr);
return Fragment(instr);
}
@@ -4278,19 +4271,17 @@
TargetEntryInstr* FlowGraphBuilder::BuildTargetEntry() {
- return new (Z)
- TargetEntryInstr(AllocateBlockId(), CurrentTryIndex(), GetNextDeoptId());
+ return new (Z) TargetEntryInstr(AllocateBlockId(), CurrentTryIndex());
}
JoinEntryInstr* FlowGraphBuilder::BuildJoinEntry(intptr_t try_index) {
- return new (Z) JoinEntryInstr(AllocateBlockId(), try_index, GetNextDeoptId());
+ return new (Z) JoinEntryInstr(AllocateBlockId(), try_index);
}
JoinEntryInstr* FlowGraphBuilder::BuildJoinEntry() {
- return new (Z)
- JoinEntryInstr(AllocateBlockId(), CurrentTryIndex(), GetNextDeoptId());
+ return new (Z) JoinEntryInstr(AllocateBlockId(), CurrentTryIndex());
}
@@ -5878,7 +5869,7 @@
Fragment loop(join);
loop += CheckStackOverflow();
loop += condition;
- entry = new (Z) GotoInstr(join, GetNextDeoptId());
+ entry = new (Z) GotoInstr(join);
} else {
entry = condition.entry;
}
@@ -5914,7 +5905,7 @@
Fragment repeat(loop_repeat);
repeat += Goto(join);
- fragment_ = Fragment(new (Z) GotoInstr(join, GetNextDeoptId()), loop_exit);
+ fragment_ = Fragment(new (Z) GotoInstr(join), loop_exit);
--loop_depth_;
}
diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h
index cc3f006..ae0db18 100644
--- a/runtime/vm/kernel_to_il.h
+++ b/runtime/vm/kernel_to_il.h
@@ -1042,7 +1042,6 @@
void InlineBailout(const char* reason);
TranslationHelper translation_helper_;
- Thread* thread_;
Zone* zone_;
// The node we are currently compiling (e.g. FunctionNode, Constructor,
@@ -1057,11 +1056,6 @@
intptr_t next_block_id_;
intptr_t AllocateBlockId() { return next_block_id_++; }
- intptr_t GetNextDeoptId() {
- // TODO(rmacnak): Record current scope / context level.
- return thread_->GetNextDeoptId();
- }
-
intptr_t next_function_id_;
intptr_t AllocateFunctionId() { return next_function_id_++; }
diff --git a/runtime/vm/regexp_assembler.cc b/runtime/vm/regexp_assembler.cc
index 588fa87..df8a650 100644
--- a/runtime/vm/regexp_assembler.cc
+++ b/runtime/vm/regexp_assembler.cc
@@ -13,7 +13,7 @@
: block_(NULL), is_bound_(false), is_linked_(false), pos_(-1) {
if (!FLAG_interpret_irregexp) {
// Only needed by the compiled IR backend.
- block_ = new JoinEntryInstr(-1, -1, Thread::Current()->GetNextDeoptId());
+ block_ = new JoinEntryInstr(-1, -1);
}
}
diff --git a/runtime/vm/regexp_assembler_ir.cc b/runtime/vm/regexp_assembler_ir.cc
index 2bdc701..23aa523 100644
--- a/runtime/vm/regexp_assembler_ir.cc
+++ b/runtime/vm/regexp_assembler_ir.cc
@@ -80,7 +80,6 @@
const ZoneGrowableArray<const ICData*>& ic_data_array,
Zone* zone)
: RegExpMacroAssembler(zone),
- thread_(Thread::Current()),
specialization_cid_(specialization_cid),
parsed_function_(parsed_function),
ic_data_array_(ic_data_array),
@@ -123,17 +122,14 @@
// Create and generate all preset blocks.
entry_block_ = new (zone) GraphEntryInstr(
*parsed_function_,
- new (zone) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex,
- GetNextDeoptId()),
+ new (zone) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex),
Compiler::kNoOSRDeoptId);
- start_block_ = new (zone)
- JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
- success_block_ = new (zone)
- JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
- backtrack_block_ = new (zone)
- JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
- exit_block_ = new (zone)
- JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
+ start_block_ = new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+ success_block_ =
+ new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+ backtrack_block_ =
+ new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
+ exit_block_ = new (zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
GenerateEntryBlock();
GenerateSuccessBlock();
@@ -256,8 +252,8 @@
Value* type = Bind(new (Z) ConstantInstr(
TypeArguments::ZoneHandle(Z, TypeArguments::null())));
Value* length = Bind(Uint64Constant(saved_registers_count_));
- Value* array = Bind(new (Z) CreateArrayInstr(TokenPosition::kNoSource, type,
- length, GetNextDeoptId()));
+ Value* array =
+ Bind(new (Z) CreateArrayInstr(TokenPosition::kNoSource, type, length));
StoreLocal(result_, array);
// Store captured offsets in the `matches` parameter.
@@ -280,8 +276,8 @@
PRINT(PushLocal(result_));
// Return true on success.
- AppendInstruction(new (Z) ReturnInstr(
- TokenPosition::kNoSource, Bind(LoadLocal(result_)), GetNextDeoptId()));
+ AppendInstruction(
+ new (Z) ReturnInstr(TokenPosition::kNoSource, Bind(LoadLocal(result_))));
}
@@ -290,8 +286,8 @@
TAG();
// Return false on failure.
- AppendInstruction(new (Z) ReturnInstr(
- TokenPosition::kNoSource, Bind(LoadLocal(result_)), GetNextDeoptId()));
+ AppendInstruction(
+ new (Z) ReturnInstr(TokenPosition::kNoSource, Bind(LoadLocal(result_))));
}
@@ -493,9 +489,8 @@
InstanceCallDescriptor::FromToken(intermediate_operator), lhs, rhs));
Value* rhs_value = Bind(BoolConstant(true));
- return new (Z)
- StrictCompareInstr(TokenPosition::kNoSource, strict_comparison, lhs_value,
- rhs_value, true, GetNextDeoptId());
+ return new (Z) StrictCompareInstr(TokenPosition::kNoSource, strict_comparison,
+ lhs_value, rhs_value, true);
}
ComparisonInstr* IRRegExpMacroAssembler::Comparison(ComparisonKind kind,
@@ -543,9 +538,9 @@
const Function& function,
ZoneGrowableArray<PushArgumentInstr*>* arguments) const {
const intptr_t kTypeArgsLen = 0;
- return new (Z) StaticCallInstr(TokenPosition::kNoSource, function,
- kTypeArgsLen, Object::null_array(), arguments,
- ic_data_array_, GetNextDeoptId());
+ return new (Z)
+ StaticCallInstr(TokenPosition::kNoSource, function, kTypeArgsLen,
+ Object::null_array(), arguments, ic_data_array_);
}
@@ -592,10 +587,10 @@
const InstanceCallDescriptor& desc,
ZoneGrowableArray<PushArgumentInstr*>* arguments) const {
const intptr_t kTypeArgsLen = 0;
- return new (Z) InstanceCallInstr(
- TokenPosition::kNoSource, desc.name, desc.token_kind, arguments,
- kTypeArgsLen, Object::null_array(), desc.checked_argument_count,
- ic_data_array_, GetNextDeoptId());
+ return new (Z)
+ InstanceCallInstr(TokenPosition::kNoSource, desc.name, desc.token_kind,
+ arguments, kTypeArgsLen, Object::null_array(),
+ desc.checked_argument_count, ic_data_array_);
}
@@ -1576,8 +1571,8 @@
PushArgumentInstr* capacity_push = PushArgument(Bind(Sub(
length_push, PushArgument(Bind(Uint64Constant(stack_limit_slack()))))));
PushArgumentInstr* stack_pointer_push = PushLocal(stack_pointer_);
- BranchInstr* branch = new (Z) BranchInstr(
- Comparison(kGT, capacity_push, stack_pointer_push), GetNextDeoptId());
+ BranchInstr* branch =
+ new (Z) BranchInstr(Comparison(kGT, capacity_push, stack_pointer_push));
CloseBlockWith(branch);
BlockLabel grow_stack;
@@ -1733,7 +1728,7 @@
// If the condition is not true, fall through to a new block.
BlockLabel fallthrough;
- BranchInstr* branch = new (Z) BranchInstr(comparison, GetNextDeoptId());
+ BranchInstr* branch = new (Z) BranchInstr(comparison);
*branch->true_successor_address() = TargetWithJoinGoto(true_successor_block);
*branch->false_successor_address() = TargetWithJoinGoto(fallthrough.block());
@@ -1744,11 +1739,11 @@
TargetEntryInstr* IRRegExpMacroAssembler::TargetWithJoinGoto(
JoinEntryInstr* dst) {
- TargetEntryInstr* target = new (Z)
- TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex, GetNextDeoptId());
+ TargetEntryInstr* target =
+ new (Z) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
blocks_.Add(target);
- target->AppendInstruction(new (Z) GotoInstr(dst, GetNextDeoptId()));
+ target->AppendInstruction(new (Z) GotoInstr(dst));
return target;
}
@@ -1756,12 +1751,11 @@
IndirectEntryInstr* IRRegExpMacroAssembler::IndirectWithJoinGoto(
JoinEntryInstr* dst) {
- IndirectEntryInstr* target =
- new (Z) IndirectEntryInstr(block_id_.Alloc(), indirect_id_.Alloc(),
- kInvalidTryIndex, GetNextDeoptId());
+ IndirectEntryInstr* target = new (Z) IndirectEntryInstr(
+ block_id_.Alloc(), indirect_id_.Alloc(), kInvalidTryIndex);
blocks_.Add(target);
- target->AppendInstruction(new (Z) GotoInstr(dst, GetNextDeoptId()));
+ target->AppendInstruction(new (Z) GotoInstr(dst));
return target;
}
@@ -1769,8 +1763,8 @@
void IRRegExpMacroAssembler::CheckPreemption() {
TAG();
- AppendInstruction(new (Z) CheckStackOverflowInstr(TokenPosition::kNoSource, 0,
- GetNextDeoptId()));
+ AppendInstruction(new (Z)
+ CheckStackOverflowInstr(TokenPosition::kNoSource, 0));
}
diff --git a/runtime/vm/regexp_assembler_ir.h b/runtime/vm/regexp_assembler_ir.h
index 8dbb4ab..ae70952 100644
--- a/runtime/vm/regexp_assembler_ir.h
+++ b/runtime/vm/regexp_assembler_ir.h
@@ -132,8 +132,6 @@
void FinalizeRegistersArray();
private:
- intptr_t GetNextDeoptId() const { return thread_->GetNextDeoptId(); }
-
// Generate the contents of preset blocks. The entry block is the entry point
// of the generated code.
void GenerateEntryBlock();
@@ -361,8 +359,6 @@
intptr_t next_id;
};
- Thread* thread_;
-
// Which mode to generate code for (ASCII or UC16).
Mode mode_;
diff --git a/tools/VERSION b/tools/VERSION
index 617fe7a..a107d71 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -28,4 +28,4 @@
MINOR 24
PATCH 0
PRERELEASE 6
-PRERELEASE_PATCH 3
+PRERELEASE_PATCH 4