mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 03:41:29 +00:00
Stop attaching try_index to individual instructions put it at block entry instead.
This simplifies code motion and insertion of instructions that make calls after graph is constructed. R=srdjan@google.com BUG= Review URL: https://chromiumcodereview.appspot.com//10892037 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11528 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
2812392ccf
commit
855629ccae
|
@ -144,11 +144,11 @@ void EffectGraphVisitor::Join(const TestGraphVisitor& test_fragment,
|
|||
|
||||
// 2. Connect the true and false bodies to the test and record their exits
|
||||
// (if any).
|
||||
TargetEntryInstr* true_entry = new TargetEntryInstr();
|
||||
TargetEntryInstr* true_entry = new TargetEntryInstr(owner()->try_index());
|
||||
*test_fragment.true_successor_address() = true_entry;
|
||||
Instruction* true_exit = AppendFragment(true_entry, true_fragment);
|
||||
|
||||
TargetEntryInstr* false_entry = new TargetEntryInstr();
|
||||
TargetEntryInstr* false_entry = new TargetEntryInstr(owner()->try_index());
|
||||
*test_fragment.false_successor_address() = false_entry;
|
||||
Instruction* false_exit = AppendFragment(false_entry, false_fragment);
|
||||
|
||||
|
@ -160,7 +160,7 @@ void EffectGraphVisitor::Join(const TestGraphVisitor& test_fragment,
|
|||
exit_ = true_exit;
|
||||
temp_index_ = true_fragment.temp_index();
|
||||
} else {
|
||||
JoinEntryInstr* join = new JoinEntryInstr();
|
||||
JoinEntryInstr* join = new JoinEntryInstr(owner()->try_index());
|
||||
true_exit->Goto(join);
|
||||
false_exit->Goto(join);
|
||||
exit_ = join;
|
||||
|
@ -180,7 +180,7 @@ void EffectGraphVisitor::TieLoop(const TestGraphVisitor& test_fragment,
|
|||
|
||||
// 1. Connect the body to the test if it is reachable, and if so record
|
||||
// its exit (if any).
|
||||
TargetEntryInstr* body_entry = new TargetEntryInstr();
|
||||
TargetEntryInstr* body_entry = new TargetEntryInstr(owner()->try_index());
|
||||
*test_fragment.true_successor_address() = body_entry;
|
||||
Instruction* body_exit = AppendFragment(body_entry, body_fragment);
|
||||
|
||||
|
@ -189,7 +189,7 @@ void EffectGraphVisitor::TieLoop(const TestGraphVisitor& test_fragment,
|
|||
if (body_exit == NULL) {
|
||||
Append(test_fragment);
|
||||
} else {
|
||||
JoinEntryInstr* join = new JoinEntryInstr();
|
||||
JoinEntryInstr* join = new JoinEntryInstr(owner()->try_index());
|
||||
join->set_next(test_fragment.entry());
|
||||
Goto(join);
|
||||
body_exit->Goto(join);
|
||||
|
@ -197,7 +197,8 @@ void EffectGraphVisitor::TieLoop(const TestGraphVisitor& test_fragment,
|
|||
|
||||
// 3. Set the exit to the graph to be the false successor of the test, a
|
||||
// fresh target node
|
||||
exit_ = *test_fragment.false_successor_address() = new TargetEntryInstr();
|
||||
exit_ = *test_fragment.false_successor_address() =
|
||||
new TargetEntryInstr(owner()->try_index());
|
||||
}
|
||||
|
||||
|
||||
|
@ -265,9 +266,7 @@ void EffectGraphVisitor::BuildLoadContext(const LocalVariable& variable) {
|
|||
|
||||
void TestGraphVisitor::ReturnValue(Value* value) {
|
||||
if (FLAG_enable_type_checks) {
|
||||
value = Bind(new AssertBooleanComp(condition_token_pos(),
|
||||
owner()->try_index(),
|
||||
value));
|
||||
value = Bind(new AssertBooleanComp(condition_token_pos(), value));
|
||||
}
|
||||
const Bool& bool_true = Bool::ZoneHandle(Bool::True());
|
||||
Value* constant_true = Bind(new ConstantComp(bool_true));
|
||||
|
@ -518,7 +517,6 @@ void EffectGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) {
|
|||
arguments->Add(push_right);
|
||||
const String& name = String::ZoneHandle(Symbols::New(node->Name()));
|
||||
InstanceCallComp* call = new InstanceCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
name,
|
||||
node->kind(),
|
||||
arguments,
|
||||
|
@ -551,7 +549,6 @@ void ValueGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) {
|
|||
if (FLAG_enable_type_checks) {
|
||||
right_value =
|
||||
for_right.Bind(new AssertBooleanComp(node->right()->token_pos(),
|
||||
owner()->try_index(),
|
||||
right_value));
|
||||
}
|
||||
Value* constant_true = for_right.Bind(new ConstantComp(bool_true));
|
||||
|
@ -640,7 +637,6 @@ AssertAssignableComp* EffectGraphVisitor::BuildAssertAssignable(
|
|||
&instantiator_type_arguments);
|
||||
}
|
||||
return new AssertAssignableComp(token_pos,
|
||||
owner()->try_index(),
|
||||
value,
|
||||
instantiator,
|
||||
instantiator_type_arguments,
|
||||
|
@ -742,7 +738,6 @@ void ValueGraphVisitor::BuildTypeTest(ComparisonNode* node) {
|
|||
}
|
||||
InstanceOfComp* instance_of =
|
||||
new InstanceOfComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
for_left_value.value(),
|
||||
instantiator,
|
||||
instantiator_type_arguments,
|
||||
|
@ -804,21 +799,23 @@ void EffectGraphVisitor::VisitComparisonNode(ComparisonNode* node) {
|
|||
Append(for_right_value);
|
||||
if (FLAG_enable_type_checks) {
|
||||
EqualityCompareComp* comp = new EqualityCompareComp(
|
||||
node->token_pos(), owner()->try_index(),
|
||||
Token::kEQ, for_left_value.value(), for_right_value.value());
|
||||
node->token_pos(),
|
||||
Token::kEQ,
|
||||
for_left_value.value(),
|
||||
for_right_value.value());
|
||||
if (node->kind() == Token::kEQ) {
|
||||
ReturnComputation(comp);
|
||||
} else {
|
||||
Value* eq_result = Bind(comp);
|
||||
eq_result = Bind(new AssertBooleanComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
eq_result));
|
||||
eq_result = Bind(new AssertBooleanComp(node->token_pos(), eq_result));
|
||||
ReturnComputation(new BooleanNegateComp(eq_result));
|
||||
}
|
||||
} else {
|
||||
EqualityCompareComp* comp = new EqualityCompareComp(
|
||||
node->token_pos(), owner()->try_index(),
|
||||
node->kind(), for_left_value.value(), for_right_value.value());
|
||||
node->token_pos(),
|
||||
node->kind(),
|
||||
for_left_value.value(),
|
||||
for_right_value.value());
|
||||
ReturnComputation(comp);
|
||||
}
|
||||
return;
|
||||
|
@ -831,7 +828,6 @@ void EffectGraphVisitor::VisitComparisonNode(ComparisonNode* node) {
|
|||
node->right()->Visit(&for_right_value);
|
||||
Append(for_right_value);
|
||||
RelationalOpComp* comp = new RelationalOpComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
node->kind(),
|
||||
for_left_value.value(),
|
||||
for_right_value.value());
|
||||
|
@ -848,9 +844,7 @@ void EffectGraphVisitor::VisitUnaryOpNode(UnaryOpNode* node) {
|
|||
Value* value = for_value.value();
|
||||
if (FLAG_enable_type_checks) {
|
||||
value =
|
||||
Bind(new AssertBooleanComp(node->operand()->token_pos(),
|
||||
owner()->try_index(),
|
||||
value));
|
||||
Bind(new AssertBooleanComp(node->operand()->token_pos(), value));
|
||||
}
|
||||
BooleanNegateComp* negate = new BooleanNegateComp(value);
|
||||
ReturnComputation(negate);
|
||||
|
@ -870,7 +864,7 @@ void EffectGraphVisitor::VisitUnaryOpNode(UnaryOpNode* node) {
|
|||
name = Symbols::New(Token::Str(node->kind()));
|
||||
}
|
||||
InstanceCallComp* call = new InstanceCallComp(
|
||||
node->token_pos(), owner()->try_index(), name, node->kind(),
|
||||
node->token_pos(), name, node->kind(),
|
||||
arguments, Array::ZoneHandle(), 1);
|
||||
ReturnComputation(call);
|
||||
}
|
||||
|
@ -982,11 +976,11 @@ void EffectGraphVisitor::VisitCaseNode(CaseNode* node) {
|
|||
// allocate JoinNode here and use it as statement start.
|
||||
statement_start = node->label()->join_for_continue();
|
||||
if (statement_start == NULL) {
|
||||
statement_start = new JoinEntryInstr();
|
||||
statement_start = new JoinEntryInstr(owner()->try_index());
|
||||
node->label()->set_join_for_continue(statement_start);
|
||||
}
|
||||
} else {
|
||||
statement_start = new JoinEntryInstr();
|
||||
statement_start = new JoinEntryInstr(owner()->try_index());
|
||||
}
|
||||
node->statements()->Visit(&for_case_statements);
|
||||
Instruction* statement_exit =
|
||||
|
@ -1011,11 +1005,13 @@ void EffectGraphVisitor::VisitCaseNode(CaseNode* node) {
|
|||
// Append only the first one, everything else is connected from it.
|
||||
Append(for_case_expression);
|
||||
} else {
|
||||
TargetEntryInstr* case_entry_target = new TargetEntryInstr();
|
||||
TargetEntryInstr* case_entry_target =
|
||||
new TargetEntryInstr(owner()->try_index());
|
||||
AppendFragment(case_entry_target, for_case_expression);
|
||||
*previous_false_address = case_entry_target;
|
||||
}
|
||||
TargetEntryInstr* true_target = new TargetEntryInstr();
|
||||
TargetEntryInstr* true_target =
|
||||
new TargetEntryInstr(owner()->try_index());
|
||||
*for_case_expression.true_successor_address() = true_target;
|
||||
true_target->Goto(statement_start);
|
||||
previous_false_address = for_case_expression.false_successor_address();
|
||||
|
@ -1028,7 +1024,8 @@ void EffectGraphVisitor::VisitCaseNode(CaseNode* node) {
|
|||
// Handle last (or only) case: false goes to exit or to statement if this
|
||||
// node contains default.
|
||||
if (len > 0) {
|
||||
TargetEntryInstr* false_target = new TargetEntryInstr();
|
||||
TargetEntryInstr* false_target =
|
||||
new TargetEntryInstr(owner()->try_index());
|
||||
*previous_false_address = false_target;
|
||||
if (node->contains_default()) {
|
||||
// True and false go to statement start.
|
||||
|
@ -1036,7 +1033,7 @@ void EffectGraphVisitor::VisitCaseNode(CaseNode* node) {
|
|||
exit_instruction = statement_exit;
|
||||
} else {
|
||||
if (statement_exit != NULL) {
|
||||
JoinEntryInstr* join = new JoinEntryInstr();
|
||||
JoinEntryInstr* join = new JoinEntryInstr(owner()->try_index());
|
||||
statement_exit->Goto(join);
|
||||
false_target->Goto(join);
|
||||
exit_instruction = join;
|
||||
|
@ -1076,7 +1073,7 @@ void EffectGraphVisitor::VisitWhileNode(WhileNode* node) {
|
|||
|
||||
EffectGraphVisitor for_body(owner(), temp_index());
|
||||
for_body.Do(
|
||||
new CheckStackOverflowComp(node->token_pos(), owner()->try_index()));
|
||||
new CheckStackOverflowComp(node->token_pos()));
|
||||
node->body()->Visit(&for_body);
|
||||
|
||||
// Labels are set after body traversal.
|
||||
|
@ -1108,7 +1105,7 @@ void EffectGraphVisitor::VisitDoWhileNode(DoWhileNode* node) {
|
|||
// Traverse body first in order to generate continue and break labels.
|
||||
EffectGraphVisitor for_body(owner(), temp_index());
|
||||
for_body.Do(
|
||||
new CheckStackOverflowComp(node->token_pos(), owner()->try_index()));
|
||||
new CheckStackOverflowComp(node->token_pos()));
|
||||
node->body()->Visit(&for_body);
|
||||
|
||||
TestGraphVisitor for_test(owner(),
|
||||
|
@ -1118,23 +1115,25 @@ void EffectGraphVisitor::VisitDoWhileNode(DoWhileNode* node) {
|
|||
ASSERT(is_open());
|
||||
|
||||
// Tie do-while loop (test is after the body).
|
||||
JoinEntryInstr* body_entry_join = new JoinEntryInstr();
|
||||
JoinEntryInstr* body_entry_join = new JoinEntryInstr(owner()->try_index());
|
||||
Goto(body_entry_join);
|
||||
Instruction* body_exit = AppendFragment(body_entry_join, for_body);
|
||||
|
||||
JoinEntryInstr* join = node->label()->join_for_continue();
|
||||
if ((body_exit != NULL) || (join != NULL)) {
|
||||
if (join == NULL) join = new JoinEntryInstr();
|
||||
if (join == NULL) join = new JoinEntryInstr(owner()->try_index());
|
||||
join->set_next(for_test.entry());
|
||||
if (body_exit != NULL) {
|
||||
body_exit->Goto(join);
|
||||
}
|
||||
}
|
||||
|
||||
TargetEntryInstr* back_target_entry = new TargetEntryInstr();
|
||||
TargetEntryInstr* back_target_entry =
|
||||
new TargetEntryInstr(owner()->try_index());
|
||||
*for_test.true_successor_address() = back_target_entry;
|
||||
back_target_entry->Goto(body_entry_join);
|
||||
TargetEntryInstr* loop_exit_target = new TargetEntryInstr();
|
||||
TargetEntryInstr* loop_exit_target =
|
||||
new TargetEntryInstr(owner()->try_index());
|
||||
*for_test.false_successor_address() = loop_exit_target;
|
||||
if (node->label()->join_for_break() == NULL) {
|
||||
exit_ = loop_exit_target;
|
||||
|
@ -1166,7 +1165,7 @@ void EffectGraphVisitor::VisitForNode(ForNode* node) {
|
|||
// Compose body to set any jump labels.
|
||||
EffectGraphVisitor for_body(owner(), temp_index());
|
||||
for_body.Do(
|
||||
new CheckStackOverflowComp(node->token_pos(), owner()->try_index()));
|
||||
new CheckStackOverflowComp(node->token_pos()));
|
||||
node->body()->Visit(&for_body);
|
||||
|
||||
// Join loop body, increment and compute their end instruction.
|
||||
|
@ -1193,7 +1192,7 @@ void EffectGraphVisitor::VisitForNode(ForNode* node) {
|
|||
// 'loop_increment_end' is NULL only if there is no join for continue and the
|
||||
// body is not open, i.e., no backward branch exists.
|
||||
if (loop_increment_end != NULL) {
|
||||
JoinEntryInstr* loop_start = new JoinEntryInstr();
|
||||
JoinEntryInstr* loop_start = new JoinEntryInstr(owner()->try_index());
|
||||
Goto(loop_start);
|
||||
loop_increment_end->Goto(loop_start);
|
||||
exit_ = loop_start;
|
||||
|
@ -1201,7 +1200,7 @@ void EffectGraphVisitor::VisitForNode(ForNode* node) {
|
|||
|
||||
if (node->condition() == NULL) {
|
||||
// Endless loop, no test.
|
||||
JoinEntryInstr* body_entry = new JoinEntryInstr();
|
||||
JoinEntryInstr* body_entry = new JoinEntryInstr(owner()->try_index());
|
||||
AppendFragment(body_entry, for_body);
|
||||
Goto(body_entry);
|
||||
if (node->label()->join_for_break() != NULL) {
|
||||
|
@ -1209,13 +1208,13 @@ void EffectGraphVisitor::VisitForNode(ForNode* node) {
|
|||
exit_ = node->label()->join_for_break();
|
||||
}
|
||||
} else {
|
||||
TargetEntryInstr* loop_exit = new TargetEntryInstr();
|
||||
TargetEntryInstr* loop_exit = new TargetEntryInstr(owner()->try_index());
|
||||
TestGraphVisitor for_test(owner(),
|
||||
temp_index(),
|
||||
node->condition()->token_pos());
|
||||
node->condition()->Visit(&for_test);
|
||||
Append(for_test);
|
||||
TargetEntryInstr* body_entry = new TargetEntryInstr();
|
||||
TargetEntryInstr* body_entry = new TargetEntryInstr(owner()->try_index());
|
||||
AppendFragment(body_entry, for_body);
|
||||
*for_test.true_successor_address() = body_entry;
|
||||
*for_test.false_successor_address() = loop_exit;
|
||||
|
@ -1268,12 +1267,14 @@ void EffectGraphVisitor::VisitJumpNode(JumpNode* node) {
|
|||
JoinEntryInstr* jump_target = NULL;
|
||||
if (node->kind() == Token::kBREAK) {
|
||||
if (node->label()->join_for_break() == NULL) {
|
||||
node->label()->set_join_for_break(new JoinEntryInstr());
|
||||
node->label()->set_join_for_break(
|
||||
new JoinEntryInstr(owner()->try_index()));
|
||||
}
|
||||
jump_target = node->label()->join_for_break();
|
||||
} else {
|
||||
if (node->label()->join_for_continue() == NULL) {
|
||||
node->label()->set_join_for_continue(new JoinEntryInstr());
|
||||
node->label()->set_join_for_continue(
|
||||
new JoinEntryInstr(owner()->try_index()));
|
||||
}
|
||||
jump_target = node->label()->join_for_continue();
|
||||
}
|
||||
|
@ -1301,7 +1302,6 @@ void EffectGraphVisitor::VisitArrayNode(ArrayNode* node) {
|
|||
Value* element_type = BuildInstantiatedTypeArguments(node->token_pos(),
|
||||
type_args);
|
||||
CreateArrayComp* create = new CreateArrayComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
arguments,
|
||||
node->type(),
|
||||
element_type);
|
||||
|
@ -1352,8 +1352,7 @@ void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) {
|
|||
}
|
||||
PushArgumentInstr* push_type_arguments = PushArgument(type_arguments);
|
||||
arguments->Add(push_type_arguments);
|
||||
ReturnComputation(
|
||||
new CreateClosureComp(node, owner()->try_index(), arguments));
|
||||
ReturnComputation(new CreateClosureComp(node, arguments));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1394,7 +1393,7 @@ void EffectGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) {
|
|||
|
||||
BuildPushArguments(*node->arguments(), arguments);
|
||||
InstanceCallComp* call = new InstanceCallComp(
|
||||
node->token_pos(), owner()->try_index(),
|
||||
node->token_pos(),
|
||||
node->function_name(), Token::kILLEGAL, arguments,
|
||||
node->arguments()->names(), 1);
|
||||
ReturnComputation(call);
|
||||
|
@ -1409,7 +1408,6 @@ void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) {
|
|||
BuildPushArguments(*node->arguments(), arguments);
|
||||
StaticCallComp* call =
|
||||
new StaticCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
node->function(),
|
||||
node->arguments()->names(),
|
||||
arguments);
|
||||
|
@ -1431,7 +1429,7 @@ ClosureCallComp* EffectGraphVisitor::BuildClosureCall(
|
|||
|
||||
// Save context around the call.
|
||||
BuildStoreContext(*owner()->parsed_function().expression_temp_var());
|
||||
return new ClosureCallComp(node, owner()->try_index(), arguments);
|
||||
return new ClosureCallComp(node, arguments);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1452,9 +1450,7 @@ void ValueGraphVisitor::VisitClosureCallNode(ClosureCallNode* node) {
|
|||
|
||||
void EffectGraphVisitor::VisitCloneContextNode(CloneContextNode* node) {
|
||||
Value* context = Bind(new CurrentContextComp());
|
||||
Value* clone = Bind(new CloneContextComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
context));
|
||||
Value* clone = Bind(new CloneContextComp(node->token_pos(), context));
|
||||
ReturnComputation(new StoreContextComp(clone));
|
||||
}
|
||||
|
||||
|
@ -1484,7 +1480,6 @@ Value* EffectGraphVisitor::BuildObjectAllocation(
|
|||
// may represent the identity vector and may be replaced by the instantiated
|
||||
// type arguments of the instantiator at run time.
|
||||
allocate_comp = new AllocateObjectWithBoundsCheckComp(node,
|
||||
owner()->try_index(),
|
||||
type_arguments,
|
||||
instantiator);
|
||||
} else {
|
||||
|
@ -1495,9 +1490,7 @@ Value* EffectGraphVisitor::BuildObjectAllocation(
|
|||
BuildConstructorTypeArguments(node, NULL, NULL, allocate_arguments);
|
||||
}
|
||||
|
||||
allocate_comp = new AllocateObjectComp(node,
|
||||
owner()->try_index(),
|
||||
allocate_arguments);
|
||||
allocate_comp = new AllocateObjectComp(node, allocate_arguments);
|
||||
}
|
||||
return Bind(allocate_comp);
|
||||
}
|
||||
|
@ -1517,7 +1510,6 @@ void EffectGraphVisitor::BuildConstructorCall(
|
|||
|
||||
BuildPushArguments(*node->arguments(), arguments);
|
||||
Do(new StaticCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
node->constructor(),
|
||||
node->arguments()->names(),
|
||||
arguments));
|
||||
|
@ -1536,7 +1528,6 @@ void EffectGraphVisitor::VisitConstructorCallNode(ConstructorCallNode* node) {
|
|||
BuildPushArguments(*node->arguments(), arguments);
|
||||
StaticCallComp* call =
|
||||
new StaticCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
node->constructor(),
|
||||
node->arguments()->names(),
|
||||
arguments);
|
||||
|
@ -1639,7 +1630,6 @@ Value* EffectGraphVisitor::BuildInstantiatedTypeArguments(
|
|||
Value* instantiator_value =
|
||||
BuildInstantiatorTypeArguments(token_pos, NULL);
|
||||
return Bind(new InstantiateTypeArgumentsComp(token_pos,
|
||||
owner()->try_index(),
|
||||
type_arguments,
|
||||
instantiator_value));
|
||||
}
|
||||
|
@ -1696,7 +1686,6 @@ void EffectGraphVisitor::BuildConstructorTypeArguments(
|
|||
Value* extract_type_arguments = Bind(
|
||||
new ExtractConstructorTypeArgumentsComp(
|
||||
node->token_pos(),
|
||||
owner()->try_index(),
|
||||
node->type_arguments(),
|
||||
stored_instantiator));
|
||||
|
||||
|
@ -1768,7 +1757,7 @@ void EffectGraphVisitor::VisitInstanceGetterNode(InstanceGetterNode* node) {
|
|||
const String& name =
|
||||
String::ZoneHandle(Field::GetterSymbol(node->field_name()));
|
||||
InstanceCallComp* call = new InstanceCallComp(
|
||||
node->token_pos(), owner()->try_index(), name, Token::kGET,
|
||||
node->token_pos(), name, Token::kGET,
|
||||
arguments, Array::ZoneHandle(), 1);
|
||||
ReturnComputation(call);
|
||||
}
|
||||
|
@ -1806,7 +1795,6 @@ void EffectGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
|
|||
const String& name =
|
||||
String::ZoneHandle(Field::SetterSymbol(node->field_name()));
|
||||
InstanceCallComp* call = new InstanceCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
name,
|
||||
Token::kSET,
|
||||
arguments,
|
||||
|
@ -1823,7 +1811,6 @@ void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) {
|
|||
const String& name =
|
||||
String::ZoneHandle(Field::SetterSymbol(node->field_name()));
|
||||
Do(new InstanceCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
name,
|
||||
Token::kSET,
|
||||
arguments,
|
||||
|
@ -1855,7 +1842,6 @@ void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) {
|
|||
ASSERT(!getter_function.IsNull());
|
||||
}
|
||||
StaticCallComp* call = new StaticCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
getter_function,
|
||||
Array::ZoneHandle(), // No names.
|
||||
arguments);
|
||||
|
@ -1900,7 +1886,6 @@ void EffectGraphVisitor::BuildStaticSetter(StaticSetterNode* node,
|
|||
arguments->Add(PushArgument(value));
|
||||
|
||||
StaticCallComp* call = new StaticCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
setter_function,
|
||||
Array::ZoneHandle(), // No names.
|
||||
arguments);
|
||||
|
@ -1925,8 +1910,7 @@ void ValueGraphVisitor::VisitStaticSetterNode(StaticSetterNode* node) {
|
|||
|
||||
|
||||
void EffectGraphVisitor::VisitNativeBodyNode(NativeBodyNode* node) {
|
||||
NativeCallComp* native_call =
|
||||
new NativeCallComp(node, owner()->try_index());
|
||||
NativeCallComp* native_call = new NativeCallComp(node);
|
||||
ReturnComputation(native_call);
|
||||
}
|
||||
|
||||
|
@ -2055,7 +2039,6 @@ void EffectGraphVisitor::VisitLoadIndexedNode(LoadIndexedNode* node) {
|
|||
const String& name =
|
||||
String::ZoneHandle(Symbols::New(Token::Str(Token::kINDEX)));
|
||||
InstanceCallComp* load = new InstanceCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
name,
|
||||
Token::kINDEX,
|
||||
arguments,
|
||||
|
@ -2097,7 +2080,6 @@ Computation* EffectGraphVisitor::BuildStoreIndexedValues(
|
|||
const String& name =
|
||||
String::ZoneHandle(Symbols::New(Token::Str(Token::kASSIGN_INDEX)));
|
||||
InstanceCallComp* store = new InstanceCallComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
name,
|
||||
Token::kASSIGN_INDEX,
|
||||
arguments,
|
||||
|
@ -2153,9 +2135,7 @@ void EffectGraphVisitor::VisitSequenceNode(SequenceNode* node) {
|
|||
// Allocate and chain a new context.
|
||||
// Allocate context computation (uses current CTX)
|
||||
Value* allocated_context =
|
||||
Bind(new AllocateContextComp(node->token_pos(),
|
||||
owner()->try_index(),
|
||||
num_context_variables));
|
||||
Bind(new AllocateContextComp(node->token_pos(), num_context_variables));
|
||||
|
||||
// If this node_sequence is the body of the function being compiled, and if
|
||||
// this function is not a closure, do not link the current context as the
|
||||
|
@ -2304,7 +2284,18 @@ void EffectGraphVisitor::VisitTryCatchNode(TryCatchNode* node) {
|
|||
|
||||
EffectGraphVisitor for_try_block(owner(), temp_index());
|
||||
node->try_block()->Visit(&for_try_block);
|
||||
Append(for_try_block);
|
||||
|
||||
if (for_try_block.is_open()) {
|
||||
JoinEntryInstr* after_try = new JoinEntryInstr(old_try_index);
|
||||
for_try_block.Goto(after_try);
|
||||
for_try_block.exit_ = after_try;
|
||||
}
|
||||
|
||||
JoinEntryInstr* try_entry = new JoinEntryInstr(try_index);
|
||||
|
||||
Goto(try_entry);
|
||||
AppendFragment(try_entry, for_try_block);
|
||||
exit_ = for_try_block.exit_;
|
||||
|
||||
// We are done generating code for the try block.
|
||||
owner()->set_try_index(old_try_index);
|
||||
|
@ -2317,7 +2308,8 @@ void EffectGraphVisitor::VisitTryCatchNode(TryCatchNode* node) {
|
|||
catch_block->set_try_index(try_index);
|
||||
EffectGraphVisitor for_catch_block(owner(), temp_index());
|
||||
catch_block->Visit(&for_catch_block);
|
||||
TargetEntryInstr* catch_entry = new TargetEntryInstr(try_index);
|
||||
TargetEntryInstr* catch_entry = new TargetEntryInstr(old_try_index,
|
||||
try_index);
|
||||
owner()->AddCatchEntry(catch_entry);
|
||||
ASSERT(!for_catch_block.is_open());
|
||||
AppendFragment(catch_entry, for_catch_block);
|
||||
|
@ -2346,13 +2338,13 @@ void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) {
|
|||
PushArgument(for_exception.value());
|
||||
Instruction* instr = NULL;
|
||||
if (node->stacktrace() == NULL) {
|
||||
instr = new ThrowInstr(node->token_pos(), owner()->try_index());
|
||||
instr = new ThrowInstr(node->token_pos());
|
||||
} else {
|
||||
ValueGraphVisitor for_stack_trace(owner(), temp_index());
|
||||
node->stacktrace()->Visit(&for_stack_trace);
|
||||
Append(for_stack_trace);
|
||||
PushArgument(for_stack_trace.value());
|
||||
instr = new ReThrowInstr(node->token_pos(), owner()->try_index());
|
||||
instr = new ReThrowInstr(node->token_pos());
|
||||
}
|
||||
AddInstruction(instr);
|
||||
}
|
||||
|
@ -2382,12 +2374,24 @@ void EffectGraphVisitor::VisitInlinedFinallyNode(InlinedFinallyNode* node) {
|
|||
owner()->set_try_index((try_index - 1));
|
||||
}
|
||||
BuildLoadContext(node->context_var());
|
||||
|
||||
JoinEntryInstr* finally_entry = new JoinEntryInstr(owner()->try_index());
|
||||
EffectGraphVisitor for_finally_block(owner(), temp_index());
|
||||
node->finally_block()->Visit(&for_finally_block);
|
||||
Append(for_finally_block);
|
||||
|
||||
if (try_index >= 0) {
|
||||
owner()->set_try_index(try_index);
|
||||
}
|
||||
|
||||
if (for_finally_block.is_open()) {
|
||||
JoinEntryInstr* after_finally = new JoinEntryInstr(owner()->try_index());
|
||||
for_finally_block.Goto(after_finally);
|
||||
for_finally_block.exit_ = after_finally;
|
||||
}
|
||||
|
||||
Goto(finally_entry);
|
||||
AppendFragment(finally_entry, for_finally_block);
|
||||
exit_ = for_finally_block.exit_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2398,13 +2402,13 @@ FlowGraph* FlowGraphBuilder::BuildGraph() {
|
|||
}
|
||||
// Compilation can be nested, preserve the computation-id.
|
||||
const Function& function = parsed_function().function();
|
||||
TargetEntryInstr* normal_entry = new TargetEntryInstr();
|
||||
TargetEntryInstr* normal_entry = new TargetEntryInstr(
|
||||
CatchClauseNode::kInvalidTryIndex);
|
||||
graph_entry_ = new GraphEntryInstr(normal_entry);
|
||||
EffectGraphVisitor for_effect(this, 0);
|
||||
// TODO(kmillikin): We can eliminate stack checks in some cases (e.g., the
|
||||
// stack check on entry for leaf routines).
|
||||
for_effect.Do(new CheckStackOverflowComp(function.token_pos(),
|
||||
CatchClauseNode::kInvalidTryIndex));
|
||||
for_effect.Do(new CheckStackOverflowComp(function.token_pos()));
|
||||
parsed_function().node_sequence()->Visit(&for_effect);
|
||||
AppendFragment(normal_entry, for_effect);
|
||||
// Check that the graph is properly terminated.
|
||||
|
|
|
@ -159,6 +159,7 @@ void FlowGraphCompiler::VisitBlocks() {
|
|||
}
|
||||
}
|
||||
}
|
||||
set_current_block(NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -222,13 +223,12 @@ void FlowGraphCompiler::AddExceptionHandler(intptr_t try_index,
|
|||
// Uses current pc position and try-index.
|
||||
void FlowGraphCompiler::AddCurrentDescriptor(PcDescriptors::Kind kind,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index) {
|
||||
intptr_t token_pos) {
|
||||
pc_descriptors_list()->AddDescriptor(kind,
|
||||
assembler()->CodeSize(),
|
||||
deopt_id,
|
||||
token_pos,
|
||||
try_index);
|
||||
CurrentTryIndex());
|
||||
}
|
||||
|
||||
|
||||
|
@ -369,7 +369,6 @@ bool FlowGraphCompiler::TryIntrinsify() {
|
|||
void FlowGraphCompiler::GenerateInstanceCall(
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const String& function_name,
|
||||
intptr_t argument_count,
|
||||
const Array& argument_names,
|
||||
|
@ -397,13 +396,12 @@ void FlowGraphCompiler::GenerateInstanceCall(
|
|||
ExternalLabel target_label("InlineCache", label_address);
|
||||
|
||||
EmitInstanceCall(&target_label, ic_data, arguments_descriptor, argument_count,
|
||||
deopt_id, token_pos, try_index, locs);
|
||||
deopt_id, token_pos, locs);
|
||||
}
|
||||
|
||||
|
||||
void FlowGraphCompiler::GenerateStaticCall(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const Function& function,
|
||||
intptr_t argument_count,
|
||||
const Array& argument_names,
|
||||
|
@ -411,7 +409,7 @@ void FlowGraphCompiler::GenerateStaticCall(intptr_t deopt_id,
|
|||
const Array& arguments_descriptor =
|
||||
DartEntry::ArgumentsDescriptor(argument_count, argument_names);
|
||||
EmitStaticCall(function, arguments_descriptor, argument_count,
|
||||
deopt_id, token_pos, try_index, locs);
|
||||
deopt_id, token_pos, locs);
|
||||
}
|
||||
|
||||
|
||||
|
@ -475,7 +473,6 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
|
|||
Label* deopt,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_index,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!ic_data.IsNull() && (ic_data.NumberOfChecks() > 0));
|
||||
Label match_found;
|
||||
|
@ -491,7 +488,6 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
|
|||
const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i));
|
||||
GenerateStaticCall(deopt_id,
|
||||
token_index,
|
||||
try_index,
|
||||
target,
|
||||
arg_count,
|
||||
arg_names,
|
||||
|
|
|
@ -449,7 +449,6 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof(
|
|||
// - true or false in EAX.
|
||||
void FlowGraphCompiler::GenerateInstanceOf(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractType& type,
|
||||
bool negate_result,
|
||||
LocationSummary* locs) {
|
||||
|
@ -492,8 +491,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t deopt_id,
|
|||
__ pushl(EDX); // Instantiator type arguments.
|
||||
__ LoadObject(EAX, test_cache);
|
||||
__ pushl(EAX);
|
||||
GenerateCallRuntime(deopt_id, token_pos, try_index,
|
||||
kInstanceofRuntimeEntry, locs);
|
||||
GenerateCallRuntime(deopt_id, token_pos, kInstanceofRuntimeEntry, locs);
|
||||
// Pop the parameters supplied to the runtime entry. The result of the
|
||||
// instanceof runtime call will be left as the result of the operation.
|
||||
__ Drop(5);
|
||||
|
@ -534,7 +532,6 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t deopt_id,
|
|||
// as they throw an exception.
|
||||
void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractType& dst_type,
|
||||
const String& dst_name,
|
||||
LocationSummary* locs) {
|
||||
|
@ -564,7 +561,6 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
|
|||
__ PushObject(error_message);
|
||||
GenerateCallRuntime(deopt_id,
|
||||
token_pos,
|
||||
try_index,
|
||||
kMalformedTypeErrorRuntimeEntry,
|
||||
locs);
|
||||
// We should never return here.
|
||||
|
@ -592,11 +588,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
|
|||
__ PushObject(dst_name); // Push the name of the destination.
|
||||
__ LoadObject(EAX, test_cache);
|
||||
__ pushl(EAX);
|
||||
GenerateCallRuntime(deopt_id,
|
||||
token_pos,
|
||||
try_index,
|
||||
kTypeCheckRuntimeEntry,
|
||||
locs);
|
||||
GenerateCallRuntime(deopt_id, token_pos, kTypeCheckRuntimeEntry, locs);
|
||||
// Pop the parameters supplied to the runtime entry. The result of the
|
||||
// type check runtime call is the checked value.
|
||||
__ Drop(6);
|
||||
|
@ -775,8 +767,7 @@ void FlowGraphCompiler::CopyParameters() {
|
|||
__ CallRuntime(kClosureArgumentMismatchRuntimeEntry);
|
||||
AddCurrentDescriptor(PcDescriptors::kOther,
|
||||
Isolate::kNoDeoptId,
|
||||
0, // No token position.
|
||||
CatchClauseNode::kInvalidTryIndex);
|
||||
0); // No token position.
|
||||
} else {
|
||||
ASSERT(!IsLeaf());
|
||||
// Invoke noSuchMethod function.
|
||||
|
@ -810,8 +801,7 @@ void FlowGraphCompiler::CopyParameters() {
|
|||
__ CallRuntime(kTraceFunctionExitRuntimeEntry);
|
||||
AddCurrentDescriptor(PcDescriptors::kOther,
|
||||
Isolate::kNoDeoptId,
|
||||
0, // No token position.
|
||||
CatchClauseNode::kInvalidTryIndex);
|
||||
0); // No token position.
|
||||
if (is_optimizing()) {
|
||||
stackmap_table_builder_->AddEntry(assembler()->CodeSize(),
|
||||
empty_stack_bitmap);
|
||||
|
@ -948,7 +938,6 @@ void FlowGraphCompiler::CompileGraph() {
|
|||
if (function.IsClosureFunction()) {
|
||||
GenerateCallRuntime(Isolate::kNoDeoptId,
|
||||
function.token_pos(),
|
||||
CatchClauseNode::kInvalidTryIndex,
|
||||
kClosureArgumentMismatchRuntimeEntry,
|
||||
prologue_locs);
|
||||
} else {
|
||||
|
@ -992,32 +981,29 @@ void FlowGraphCompiler::CompileGraph() {
|
|||
// at entry point.
|
||||
AddCurrentDescriptor(PcDescriptors::kPatchCode,
|
||||
Isolate::kNoDeoptId,
|
||||
0, // No token position.
|
||||
CatchClauseNode::kInvalidTryIndex);
|
||||
0); // No token position.
|
||||
__ jmp(&StubCode::FixCallersTargetLabel());
|
||||
}
|
||||
|
||||
|
||||
void FlowGraphCompiler::GenerateCall(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const ExternalLabel* label,
|
||||
PcDescriptors::Kind kind,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!IsLeaf());
|
||||
__ call(label);
|
||||
AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos, try_index);
|
||||
AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
|
||||
RecordSafepoint(locs);
|
||||
}
|
||||
|
||||
|
||||
void FlowGraphCompiler::GenerateCallRuntime(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const RuntimeEntry& entry,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!IsLeaf());
|
||||
__ CallRuntime(entry);
|
||||
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos, try_index);
|
||||
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
|
||||
RecordSafepoint(locs);
|
||||
}
|
||||
|
||||
|
@ -1028,14 +1014,13 @@ void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
|
|||
intptr_t argument_count,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!IsLeaf());
|
||||
__ LoadObject(ECX, ic_data);
|
||||
__ LoadObject(EDX, arguments_descriptor);
|
||||
|
||||
__ call(target_label);
|
||||
AddCurrentDescriptor(PcDescriptors::kIcCall, deopt_id, token_pos, try_index);
|
||||
AddCurrentDescriptor(PcDescriptors::kIcCall, deopt_id, token_pos);
|
||||
RecordSafepoint(locs);
|
||||
|
||||
__ Drop(argument_count);
|
||||
|
@ -1047,14 +1032,12 @@ void FlowGraphCompiler::EmitStaticCall(const Function& function,
|
|||
intptr_t argument_count,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!IsLeaf());
|
||||
__ LoadObject(ECX, function);
|
||||
__ LoadObject(EDX, arguments_descriptor);
|
||||
__ call(&StubCode::CallStaticFunctionLabel());
|
||||
AddCurrentDescriptor(PcDescriptors::kFuncCall, deopt_id, token_pos,
|
||||
try_index);
|
||||
AddCurrentDescriptor(PcDescriptors::kFuncCall, deopt_id, token_pos);
|
||||
RecordSafepoint(locs);
|
||||
if (is_optimizing()) {
|
||||
AddDeoptIndexAtCall(deopt_id, token_pos);
|
||||
|
|
|
@ -79,33 +79,28 @@ class FlowGraphCompiler : public ValueObject {
|
|||
|
||||
void GenerateCallRuntime(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const RuntimeEntry& entry,
|
||||
LocationSummary* locs);
|
||||
|
||||
void GenerateCall(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const ExternalLabel* label,
|
||||
PcDescriptors::Kind kind,
|
||||
LocationSummary* locs);
|
||||
|
||||
void GenerateAssertAssignable(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractType& dst_type,
|
||||
const String& dst_name,
|
||||
LocationSummary* locs);
|
||||
|
||||
void GenerateInstanceOf(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractType& type,
|
||||
bool negate_result,
|
||||
LocationSummary* locs);
|
||||
|
||||
void GenerateInstanceCall(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const String& function_name,
|
||||
intptr_t argument_count,
|
||||
const Array& argument_names,
|
||||
|
@ -114,7 +109,6 @@ class FlowGraphCompiler : public ValueObject {
|
|||
|
||||
void GenerateStaticCall(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const Function& function,
|
||||
intptr_t argument_count,
|
||||
const Array& argument_names,
|
||||
|
@ -145,7 +139,6 @@ class FlowGraphCompiler : public ValueObject {
|
|||
intptr_t argument_count,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs);
|
||||
|
||||
void EmitLoadIndexedGeneric(LoadIndexedComp* comp);
|
||||
|
@ -156,7 +149,6 @@ class FlowGraphCompiler : public ValueObject {
|
|||
Label* deopt,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_index,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs);
|
||||
|
||||
void EmitDoubleCompareBranch(Condition true_condition,
|
||||
|
@ -180,8 +172,7 @@ class FlowGraphCompiler : public ValueObject {
|
|||
void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset);
|
||||
void AddCurrentDescriptor(PcDescriptors::Kind kind,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index);
|
||||
intptr_t token_pos);
|
||||
|
||||
void RecordSafepoint(LocationSummary* locs);
|
||||
|
||||
|
@ -208,6 +199,13 @@ class FlowGraphCompiler : public ValueObject {
|
|||
// Returns true if the compiled function has a finally clause.
|
||||
bool HasFinally() const;
|
||||
|
||||
intptr_t CurrentTryIndex() const {
|
||||
if (current_block_ == NULL) {
|
||||
return CatchClauseNode::kInvalidTryIndex;
|
||||
}
|
||||
return current_block_->try_index();
|
||||
}
|
||||
|
||||
static const int kLocalsOffsetFromFP = (-1 * kWordSize);
|
||||
|
||||
private:
|
||||
|
@ -225,7 +223,6 @@ class FlowGraphCompiler : public ValueObject {
|
|||
intptr_t argument_count,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs);
|
||||
|
||||
// Type checking helper methods.
|
||||
|
|
|
@ -453,7 +453,6 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof(
|
|||
// - true or false in RAX.
|
||||
void FlowGraphCompiler::GenerateInstanceOf(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractType& type,
|
||||
bool negate_result,
|
||||
LocationSummary* locs) {
|
||||
|
@ -496,8 +495,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t deopt_id,
|
|||
__ pushq(RDX); // Instantiator type arguments.
|
||||
__ LoadObject(RAX, test_cache);
|
||||
__ pushq(RAX);
|
||||
GenerateCallRuntime(deopt_id, token_pos, try_index,
|
||||
kInstanceofRuntimeEntry, locs);
|
||||
GenerateCallRuntime(deopt_id, token_pos, kInstanceofRuntimeEntry, locs);
|
||||
// Pop the parameters supplied to the runtime entry. The result of the
|
||||
// instanceof runtime call will be left as the result of the operation.
|
||||
__ Drop(5);
|
||||
|
@ -538,7 +536,6 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t deopt_id,
|
|||
// as they throw an exception.
|
||||
void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractType& dst_type,
|
||||
const String& dst_name,
|
||||
LocationSummary* locs) {
|
||||
|
@ -568,7 +565,6 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
|
|||
__ PushObject(error_message);
|
||||
GenerateCallRuntime(deopt_id,
|
||||
token_pos,
|
||||
try_index,
|
||||
kMalformedTypeErrorRuntimeEntry,
|
||||
locs);
|
||||
// We should never return here.
|
||||
|
@ -598,7 +594,6 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t deopt_id,
|
|||
__ pushq(RAX);
|
||||
GenerateCallRuntime(deopt_id,
|
||||
token_pos,
|
||||
try_index,
|
||||
kTypeCheckRuntimeEntry,
|
||||
locs);
|
||||
// Pop the parameters supplied to the runtime entry. The result of the
|
||||
|
@ -781,8 +776,7 @@ void FlowGraphCompiler::CopyParameters() {
|
|||
__ CallRuntime(kClosureArgumentMismatchRuntimeEntry);
|
||||
AddCurrentDescriptor(PcDescriptors::kOther,
|
||||
Isolate::kNoDeoptId,
|
||||
0, // No token position.
|
||||
CatchClauseNode::kInvalidTryIndex);
|
||||
0); // No token position.
|
||||
} else {
|
||||
ASSERT(!IsLeaf());
|
||||
// Invoke noSuchMethod function.
|
||||
|
@ -815,8 +809,7 @@ void FlowGraphCompiler::CopyParameters() {
|
|||
__ CallRuntime(kTraceFunctionExitRuntimeEntry);
|
||||
AddCurrentDescriptor(PcDescriptors::kOther,
|
||||
Isolate::kNoDeoptId,
|
||||
0, // No token position.
|
||||
CatchClauseNode::kInvalidTryIndex);
|
||||
0); // No token position.
|
||||
if (is_optimizing()) {
|
||||
stackmap_table_builder_->AddEntry(assembler()->CodeSize(),
|
||||
empty_stack_bitmap);
|
||||
|
@ -954,7 +947,6 @@ void FlowGraphCompiler::CompileGraph() {
|
|||
if (function.IsClosureFunction()) {
|
||||
GenerateCallRuntime(Isolate::kNoDeoptId,
|
||||
function.token_pos(),
|
||||
CatchClauseNode::kInvalidTryIndex,
|
||||
kClosureArgumentMismatchRuntimeEntry,
|
||||
prologue_locs);
|
||||
} else {
|
||||
|
@ -1007,25 +999,23 @@ void FlowGraphCompiler::CompileGraph() {
|
|||
|
||||
|
||||
void FlowGraphCompiler::GenerateCall(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const ExternalLabel* label,
|
||||
PcDescriptors::Kind kind,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!IsLeaf());
|
||||
__ call(label);
|
||||
AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos, try_index);
|
||||
AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
|
||||
RecordSafepoint(locs);
|
||||
}
|
||||
|
||||
|
||||
void FlowGraphCompiler::GenerateCallRuntime(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const RuntimeEntry& entry,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!IsLeaf());
|
||||
__ CallRuntime(entry);
|
||||
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos, try_index);
|
||||
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
|
||||
RecordSafepoint(locs);
|
||||
}
|
||||
|
||||
|
@ -1036,14 +1026,13 @@ void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
|
|||
intptr_t argument_count,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!IsLeaf());
|
||||
__ LoadObject(RBX, ic_data);
|
||||
__ LoadObject(R10, arguments_descriptor);
|
||||
|
||||
__ call(target_label);
|
||||
AddCurrentDescriptor(PcDescriptors::kIcCall, deopt_id, token_pos, try_index);
|
||||
AddCurrentDescriptor(PcDescriptors::kIcCall, deopt_id, token_pos);
|
||||
RecordSafepoint(locs);
|
||||
|
||||
__ Drop(argument_count);
|
||||
|
@ -1055,14 +1044,12 @@ void FlowGraphCompiler::EmitStaticCall(const Function& function,
|
|||
intptr_t argument_count,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs) {
|
||||
ASSERT(!IsLeaf());
|
||||
__ LoadObject(RBX, function);
|
||||
__ LoadObject(R10, arguments_descriptor);
|
||||
__ call(&StubCode::CallStaticFunctionLabel());
|
||||
AddCurrentDescriptor(PcDescriptors::kFuncCall, deopt_id, token_pos,
|
||||
try_index);
|
||||
AddCurrentDescriptor(PcDescriptors::kFuncCall, deopt_id, token_pos);
|
||||
RecordSafepoint(locs);
|
||||
if (is_optimizing()) {
|
||||
AddDeoptIndexAtCall(deopt_id, token_pos);
|
||||
|
|
|
@ -79,33 +79,28 @@ class FlowGraphCompiler : public ValueObject {
|
|||
|
||||
void GenerateCallRuntime(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const RuntimeEntry& entry,
|
||||
LocationSummary* locs);
|
||||
|
||||
void GenerateCall(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const ExternalLabel* label,
|
||||
PcDescriptors::Kind kind,
|
||||
LocationSummary* locs);
|
||||
|
||||
void GenerateAssertAssignable(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractType& dst_type,
|
||||
const String& dst_name,
|
||||
LocationSummary* locs);
|
||||
|
||||
void GenerateInstanceOf(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractType& type,
|
||||
bool negate_result,
|
||||
LocationSummary* locs);
|
||||
|
||||
void GenerateInstanceCall(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const String& function_name,
|
||||
intptr_t argument_count,
|
||||
const Array& argument_names,
|
||||
|
@ -114,7 +109,6 @@ class FlowGraphCompiler : public ValueObject {
|
|||
|
||||
void GenerateStaticCall(intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const Function& function,
|
||||
intptr_t argument_count,
|
||||
const Array& argument_names,
|
||||
|
@ -145,7 +139,6 @@ class FlowGraphCompiler : public ValueObject {
|
|||
intptr_t argument_count,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs);
|
||||
|
||||
void EmitTestAndCall(const ICData& ic_data,
|
||||
|
@ -155,7 +148,6 @@ class FlowGraphCompiler : public ValueObject {
|
|||
Label* deopt,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_index,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs);
|
||||
|
||||
void EmitDoubleCompareBranch(Condition true_condition,
|
||||
|
@ -179,8 +171,7 @@ class FlowGraphCompiler : public ValueObject {
|
|||
void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset);
|
||||
void AddCurrentDescriptor(PcDescriptors::Kind kind,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index);
|
||||
intptr_t token_pos);
|
||||
|
||||
void RecordSafepoint(LocationSummary* locs);
|
||||
|
||||
|
@ -209,6 +200,13 @@ class FlowGraphCompiler : public ValueObject {
|
|||
void SaveLiveRegisters(LocationSummary* locs);
|
||||
void RestoreLiveRegisters(LocationSummary* locs);
|
||||
|
||||
intptr_t CurrentTryIndex() const {
|
||||
if (current_block_ == NULL) {
|
||||
return CatchClauseNode::kInvalidTryIndex;
|
||||
}
|
||||
return current_block_->try_index();
|
||||
}
|
||||
|
||||
private:
|
||||
friend class DeoptimizationStub;
|
||||
|
||||
|
@ -224,7 +222,6 @@ class FlowGraphCompiler : public ValueObject {
|
|||
intptr_t argument_count,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
LocationSummary* locs);
|
||||
|
||||
// Type checking helper methods.
|
||||
|
|
|
@ -493,8 +493,8 @@ void ParameterInstr::PrintTo(BufferFormatter* f) const {
|
|||
|
||||
void TargetEntryInstr::PrintTo(BufferFormatter* f) const {
|
||||
f->Print("%2d: [target", block_id());
|
||||
if (HasTryIndex()) {
|
||||
f->Print(" catch %d]", try_index());
|
||||
if (IsCatchEntry()) {
|
||||
f->Print(" catch %d]", catch_try_index());
|
||||
} else {
|
||||
f->Print("]");
|
||||
}
|
||||
|
@ -740,8 +740,8 @@ void ParameterInstr::PrintToVisualizer(BufferFormatter* f) const {
|
|||
|
||||
void TargetEntryInstr::PrintToVisualizer(BufferFormatter* f) const {
|
||||
f->Print("_ [target");
|
||||
if (HasTryIndex()) {
|
||||
f->Print(" catch %d]", try_index());
|
||||
if (IsCatchEntry()) {
|
||||
f->Print(" catch %d]", catch_try_index());
|
||||
} else {
|
||||
f->Print("]");
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ bool ConstantComp::AttributesEqual(Computation* other) const {
|
|||
|
||||
|
||||
GraphEntryInstr::GraphEntryInstr(TargetEntryInstr* normal_entry)
|
||||
: BlockEntryInstr(),
|
||||
: BlockEntryInstr(CatchClauseNode::kInvalidTryIndex),
|
||||
normal_entry_(normal_entry),
|
||||
catch_entries_(),
|
||||
start_env_(NULL),
|
||||
|
@ -1160,8 +1160,8 @@ void JoinEntryInstr::PrepareEntry(FlowGraphCompiler* compiler) {
|
|||
|
||||
void TargetEntryInstr::PrepareEntry(FlowGraphCompiler* compiler) {
|
||||
__ Bind(compiler->GetBlockLabel(this));
|
||||
if (HasTryIndex()) {
|
||||
compiler->AddExceptionHandler(try_index(),
|
||||
if (IsCatchEntry()) {
|
||||
compiler->AddExceptionHandler(catch_try_index(),
|
||||
compiler->assembler()->CodeSize());
|
||||
}
|
||||
if (HasParallelMove()) {
|
||||
|
@ -1179,7 +1179,6 @@ LocationSummary* ThrowInstr::MakeLocationSummary() const {
|
|||
void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kThrowRuntimeEntry,
|
||||
locs());
|
||||
__ int3();
|
||||
|
@ -1194,7 +1193,6 @@ LocationSummary* ReThrowInstr::MakeLocationSummary() const {
|
|||
void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kReThrowRuntimeEntry,
|
||||
locs());
|
||||
__ int3();
|
||||
|
@ -1331,7 +1329,6 @@ void ClosureCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ LoadObject(temp_reg, arguments_descriptor);
|
||||
|
||||
compiler->GenerateCall(token_pos(),
|
||||
try_index(),
|
||||
&StubCode::CallClosureFunctionLabel(),
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1347,11 +1344,9 @@ LocationSummary* InstanceCallComp::MakeLocationSummary() const {
|
|||
void InstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
||||
compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index());
|
||||
token_pos());
|
||||
compiler->GenerateInstanceCall(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
function_name(),
|
||||
ArgumentCount(),
|
||||
argument_names(),
|
||||
|
@ -1373,7 +1368,6 @@ void StaticCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
}
|
||||
compiler->GenerateStaticCall(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
function(),
|
||||
ArgumentCount(),
|
||||
argument_names(),
|
||||
|
@ -1386,7 +1380,6 @@ void AssertAssignableComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
if (!is_eliminated()) {
|
||||
compiler->GenerateAssertAssignable(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
dst_type(),
|
||||
dst_name(),
|
||||
locs());
|
||||
|
@ -1466,7 +1459,6 @@ void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls));
|
||||
const ExternalLabel label(cls.ToCString(), stub.EntryPoint());
|
||||
compiler->GenerateCall(token_pos(),
|
||||
try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1484,7 +1476,8 @@ void CreateClosureComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
const Code& stub = Code::Handle(
|
||||
StubCode::GetAllocationStubForClosure(closure_function));
|
||||
const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
|
||||
compiler->GenerateCall(token_pos(), try_index(), &label,
|
||||
compiler->GenerateCall(token_pos(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
__ Drop(2); // Discard type arguments and receiver.
|
||||
|
|
|
@ -502,14 +502,12 @@ class ConstantComp : public TemplateComputation<0> {
|
|||
class AssertAssignableComp : public TemplateComputation<3> {
|
||||
public:
|
||||
AssertAssignableComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
Value* value,
|
||||
Value* instantiator,
|
||||
Value* instantiator_type_arguments,
|
||||
const AbstractType& dst_type,
|
||||
const String& dst_name)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
dst_type_(dst_type),
|
||||
dst_name_(dst_name),
|
||||
is_eliminated_(false) {
|
||||
|
@ -530,7 +528,6 @@ class AssertAssignableComp : public TemplateComputation<3> {
|
|||
Value* instantiator_type_arguments() const { return inputs_[2]; }
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
const AbstractType& dst_type() const { return dst_type_; }
|
||||
const String& dst_name() const { return dst_name_; }
|
||||
|
||||
|
@ -549,7 +546,6 @@ class AssertAssignableComp : public TemplateComputation<3> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
const AbstractType& dst_type_;
|
||||
const String& dst_name_;
|
||||
bool is_eliminated_;
|
||||
|
@ -561,10 +557,8 @@ class AssertAssignableComp : public TemplateComputation<3> {
|
|||
class AssertBooleanComp : public TemplateComputation<1> {
|
||||
public:
|
||||
AssertBooleanComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
Value* value)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
is_eliminated_(false) {
|
||||
ASSERT(value != NULL);
|
||||
inputs_[0] = value;
|
||||
|
@ -573,7 +567,6 @@ class AssertBooleanComp : public TemplateComputation<1> {
|
|||
DECLARE_COMPUTATION(AssertBoolean)
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
Value* value() const { return inputs_[0]; }
|
||||
|
||||
bool is_eliminated() const {
|
||||
|
@ -591,7 +584,6 @@ class AssertBooleanComp : public TemplateComputation<1> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
bool is_eliminated_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AssertBooleanComp);
|
||||
|
@ -636,17 +628,14 @@ class StoreContextComp : public TemplateComputation<1> {
|
|||
class ClosureCallComp : public TemplateComputation<0> {
|
||||
public:
|
||||
ClosureCallComp(ClosureCallNode* node,
|
||||
intptr_t try_index,
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments)
|
||||
: ast_node_(*node),
|
||||
try_index_(try_index),
|
||||
arguments_(arguments) { }
|
||||
|
||||
DECLARE_CALL_COMPUTATION(ClosureCall)
|
||||
|
||||
const Array& argument_names() const { return ast_node_.arguments()->names(); }
|
||||
intptr_t token_pos() const { return ast_node_.token_pos(); }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual intptr_t ArgumentCount() const { return arguments_->length(); }
|
||||
PushArgumentInstr* ArgumentAt(intptr_t index) const {
|
||||
|
@ -660,7 +649,6 @@ class ClosureCallComp : public TemplateComputation<0> {
|
|||
|
||||
private:
|
||||
const ClosureCallNode& ast_node_;
|
||||
const intptr_t try_index_;
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ClosureCallComp);
|
||||
|
@ -670,14 +658,12 @@ class ClosureCallComp : public TemplateComputation<0> {
|
|||
class InstanceCallComp : public TemplateComputation<0> {
|
||||
public:
|
||||
InstanceCallComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const String& function_name,
|
||||
Token::Kind token_kind,
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments,
|
||||
const Array& argument_names,
|
||||
intptr_t checked_argument_count)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
function_name_(function_name),
|
||||
token_kind_(token_kind),
|
||||
arguments_(arguments),
|
||||
|
@ -697,7 +683,6 @@ class InstanceCallComp : public TemplateComputation<0> {
|
|||
DECLARE_CALL_COMPUTATION(InstanceCall)
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
const String& function_name() const { return function_name_; }
|
||||
Token::Kind token_kind() const { return token_kind_; }
|
||||
virtual intptr_t ArgumentCount() const { return arguments_->length(); }
|
||||
|
@ -714,7 +699,6 @@ class InstanceCallComp : public TemplateComputation<0> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
const String& function_name_;
|
||||
const Token::Kind token_kind_; // Binary op, unary op, kGET or kILLEGAL.
|
||||
ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
|
||||
|
@ -803,13 +787,11 @@ class StrictCompareComp : public ComparisonComp {
|
|||
class EqualityCompareComp : public ComparisonComp {
|
||||
public:
|
||||
EqualityCompareComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
Token::Kind kind,
|
||||
Value* left,
|
||||
Value* right)
|
||||
: ComparisonComp(kind, left, right),
|
||||
token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
receiver_class_id_(kIllegalCid) {
|
||||
ASSERT((kind == Token::kEQ) || (kind == Token::kNE));
|
||||
}
|
||||
|
@ -817,7 +799,6 @@ class EqualityCompareComp : public ComparisonComp {
|
|||
DECLARE_COMPUTATION(EqualityCompare)
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
// Receiver class id is computed from collected ICData.
|
||||
void set_receiver_class_id(intptr_t value) { receiver_class_id_ = value; }
|
||||
|
@ -833,7 +814,6 @@ class EqualityCompareComp : public ComparisonComp {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
intptr_t receiver_class_id_; // Set by optimizer.
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(EqualityCompareComp);
|
||||
|
@ -843,13 +823,11 @@ class EqualityCompareComp : public ComparisonComp {
|
|||
class RelationalOpComp : public ComparisonComp {
|
||||
public:
|
||||
RelationalOpComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
Token::Kind kind,
|
||||
Value* left,
|
||||
Value* right)
|
||||
: ComparisonComp(kind, left, right),
|
||||
token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
operands_class_id_(kIllegalCid) {
|
||||
ASSERT(Token::IsRelationalOperator(kind));
|
||||
}
|
||||
|
@ -857,7 +835,6 @@ class RelationalOpComp : public ComparisonComp {
|
|||
DECLARE_COMPUTATION(RelationalOp)
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
// TODO(srdjan): instead of class-id pass an enum that can differentiate
|
||||
// between boxed and unboxed doubles and integers.
|
||||
|
@ -877,7 +854,6 @@ class RelationalOpComp : public ComparisonComp {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
intptr_t operands_class_id_; // class id of both operands.
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(RelationalOpComp);
|
||||
|
@ -887,12 +863,10 @@ class RelationalOpComp : public ComparisonComp {
|
|||
class StaticCallComp : public TemplateComputation<0> {
|
||||
public:
|
||||
StaticCallComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const Function& function,
|
||||
const Array& argument_names,
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
function_(function),
|
||||
argument_names_(argument_names),
|
||||
arguments_(arguments),
|
||||
|
@ -907,7 +881,6 @@ class StaticCallComp : public TemplateComputation<0> {
|
|||
const Function& function() const { return function_; }
|
||||
const Array& argument_names() const { return argument_names_; }
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual intptr_t ArgumentCount() const { return arguments_->length(); }
|
||||
PushArgumentInstr* ArgumentAt(intptr_t index) const {
|
||||
|
@ -924,7 +897,6 @@ class StaticCallComp : public TemplateComputation<0> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
const Function& function_;
|
||||
const Array& argument_names_;
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments_;
|
||||
|
@ -993,13 +965,12 @@ class StoreLocalComp : public TemplateComputation<1> {
|
|||
|
||||
class NativeCallComp : public TemplateComputation<0> {
|
||||
public:
|
||||
NativeCallComp(NativeBodyNode* node, intptr_t try_index)
|
||||
: ast_node_(*node), try_index_(try_index) {}
|
||||
explicit NativeCallComp(NativeBodyNode* node)
|
||||
: ast_node_(*node) {}
|
||||
|
||||
DECLARE_COMPUTATION(NativeCall)
|
||||
|
||||
intptr_t token_pos() const { return ast_node_.token_pos(); }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
const String& native_name() const {
|
||||
return ast_node_.native_c_function_name();
|
||||
|
@ -1026,7 +997,6 @@ class NativeCallComp : public TemplateComputation<0> {
|
|||
|
||||
private:
|
||||
const NativeBodyNode& ast_node_;
|
||||
const intptr_t try_index_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NativeCallComp);
|
||||
};
|
||||
|
@ -1218,14 +1188,12 @@ class BooleanNegateComp : public TemplateComputation<1> {
|
|||
class InstanceOfComp : public TemplateComputation<3> {
|
||||
public:
|
||||
InstanceOfComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
Value* value,
|
||||
Value* instantiator,
|
||||
Value* instantiator_type_arguments,
|
||||
const AbstractType& type,
|
||||
bool negate_result)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
type_(type),
|
||||
negate_result_(negate_result) {
|
||||
ASSERT(value != NULL);
|
||||
|
@ -1246,7 +1214,6 @@ class InstanceOfComp : public TemplateComputation<3> {
|
|||
bool negate_result() const { return negate_result_; }
|
||||
const AbstractType& type() const { return type_; }
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual void PrintOperandsTo(BufferFormatter* f) const;
|
||||
|
||||
|
@ -1255,7 +1222,6 @@ class InstanceOfComp : public TemplateComputation<3> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
Value* value_;
|
||||
Value* instantiator_;
|
||||
Value* type_arguments_;
|
||||
|
@ -1269,9 +1235,8 @@ class InstanceOfComp : public TemplateComputation<3> {
|
|||
class AllocateObjectComp : public TemplateComputation<0> {
|
||||
public:
|
||||
AllocateObjectComp(ConstructorCallNode* node,
|
||||
intptr_t try_index,
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments)
|
||||
: ast_node_(*node), try_index_(try_index), arguments_(arguments) {
|
||||
: ast_node_(*node), arguments_(arguments) {
|
||||
// Either no arguments or one type-argument and one instantiator.
|
||||
ASSERT(arguments->is_empty() || (arguments->length() == 2));
|
||||
}
|
||||
|
@ -1285,7 +1250,6 @@ class AllocateObjectComp : public TemplateComputation<0> {
|
|||
|
||||
const Function& constructor() const { return ast_node_.constructor(); }
|
||||
intptr_t token_pos() const { return ast_node_.token_pos(); }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual void PrintOperandsTo(BufferFormatter* f) const;
|
||||
|
||||
|
@ -1294,7 +1258,6 @@ class AllocateObjectComp : public TemplateComputation<0> {
|
|||
|
||||
private:
|
||||
const ConstructorCallNode& ast_node_;
|
||||
const intptr_t try_index_;
|
||||
ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AllocateObjectComp);
|
||||
|
@ -1304,10 +1267,9 @@ class AllocateObjectComp : public TemplateComputation<0> {
|
|||
class AllocateObjectWithBoundsCheckComp : public TemplateComputation<2> {
|
||||
public:
|
||||
AllocateObjectWithBoundsCheckComp(ConstructorCallNode* node,
|
||||
intptr_t try_index,
|
||||
Value* type_arguments,
|
||||
Value* instantiator)
|
||||
: ast_node_(*node), try_index_(try_index) {
|
||||
: ast_node_(*node) {
|
||||
ASSERT(type_arguments != NULL);
|
||||
ASSERT(instantiator != NULL);
|
||||
inputs_[0] = type_arguments;
|
||||
|
@ -1318,7 +1280,6 @@ class AllocateObjectWithBoundsCheckComp : public TemplateComputation<2> {
|
|||
|
||||
const Function& constructor() const { return ast_node_.constructor(); }
|
||||
intptr_t token_pos() const { return ast_node_.token_pos(); }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual void PrintOperandsTo(BufferFormatter* f) const;
|
||||
|
||||
|
@ -1327,7 +1288,6 @@ class AllocateObjectWithBoundsCheckComp : public TemplateComputation<2> {
|
|||
|
||||
private:
|
||||
const ConstructorCallNode& ast_node_;
|
||||
const intptr_t try_index_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AllocateObjectWithBoundsCheckComp);
|
||||
};
|
||||
|
@ -1336,12 +1296,10 @@ class AllocateObjectWithBoundsCheckComp : public TemplateComputation<2> {
|
|||
class CreateArrayComp : public TemplateComputation<1> {
|
||||
public:
|
||||
CreateArrayComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments,
|
||||
const AbstractType& type,
|
||||
Value* element_type)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
arguments_(arguments),
|
||||
type_(type) {
|
||||
#if defined(DEBUG)
|
||||
|
@ -1361,7 +1319,6 @@ class CreateArrayComp : public TemplateComputation<1> {
|
|||
virtual intptr_t ArgumentCount() const { return arguments_->length(); }
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
PushArgumentInstr* ArgumentAt(intptr_t i) const { return (*arguments_)[i]; }
|
||||
const AbstractType& type() const { return type_; }
|
||||
Value* element_type() const { return inputs_[0]; }
|
||||
|
@ -1373,7 +1330,6 @@ class CreateArrayComp : public TemplateComputation<1> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
ZoneGrowableArray<PushArgumentInstr*>* const arguments_;
|
||||
const AbstractType& type_;
|
||||
|
||||
|
@ -1384,16 +1340,13 @@ class CreateArrayComp : public TemplateComputation<1> {
|
|||
class CreateClosureComp : public TemplateComputation<0> {
|
||||
public:
|
||||
CreateClosureComp(ClosureNode* node,
|
||||
intptr_t try_index,
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments)
|
||||
: ast_node_(*node),
|
||||
try_index_(try_index),
|
||||
arguments_(arguments) { }
|
||||
|
||||
DECLARE_CALL_COMPUTATION(CreateClosure)
|
||||
|
||||
intptr_t token_pos() const { return ast_node_.token_pos(); }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
const Function& function() const { return ast_node_.function(); }
|
||||
|
||||
virtual intptr_t ArgumentCount() const { return arguments_->length(); }
|
||||
|
@ -1408,7 +1361,6 @@ class CreateClosureComp : public TemplateComputation<0> {
|
|||
|
||||
private:
|
||||
const ClosureNode& ast_node_;
|
||||
const intptr_t try_index_;
|
||||
ZoneGrowableArray<PushArgumentInstr*>* arguments_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CreateClosureComp);
|
||||
|
@ -1491,11 +1443,9 @@ class StoreVMFieldComp : public TemplateComputation<2> {
|
|||
class InstantiateTypeArgumentsComp : public TemplateComputation<1> {
|
||||
public:
|
||||
InstantiateTypeArgumentsComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractTypeArguments& type_arguments,
|
||||
Value* instantiator)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
type_arguments_(type_arguments) {
|
||||
ASSERT(type_arguments.IsZoneHandle());
|
||||
ASSERT(instantiator != NULL);
|
||||
|
@ -1509,7 +1459,6 @@ class InstantiateTypeArgumentsComp : public TemplateComputation<1> {
|
|||
return type_arguments_;
|
||||
}
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual void PrintOperandsTo(BufferFormatter* f) const;
|
||||
|
||||
|
@ -1518,7 +1467,6 @@ class InstantiateTypeArgumentsComp : public TemplateComputation<1> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
const AbstractTypeArguments& type_arguments_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(InstantiateTypeArgumentsComp);
|
||||
|
@ -1529,11 +1477,9 @@ class ExtractConstructorTypeArgumentsComp : public TemplateComputation<1> {
|
|||
public:
|
||||
ExtractConstructorTypeArgumentsComp(
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
const AbstractTypeArguments& type_arguments,
|
||||
Value* instantiator)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
type_arguments_(type_arguments) {
|
||||
ASSERT(instantiator != NULL);
|
||||
inputs_[0] = instantiator;
|
||||
|
@ -1546,7 +1492,6 @@ class ExtractConstructorTypeArgumentsComp : public TemplateComputation<1> {
|
|||
return type_arguments_;
|
||||
}
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual void PrintOperandsTo(BufferFormatter* f) const;
|
||||
|
||||
|
@ -1555,7 +1500,6 @@ class ExtractConstructorTypeArgumentsComp : public TemplateComputation<1> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
const AbstractTypeArguments& type_arguments_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ExtractConstructorTypeArgumentsComp);
|
||||
|
@ -1593,16 +1537,13 @@ class ExtractConstructorInstantiatorComp : public TemplateComputation<1> {
|
|||
class AllocateContextComp : public TemplateComputation<0> {
|
||||
public:
|
||||
AllocateContextComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
intptr_t num_context_variables)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index),
|
||||
num_context_variables_(num_context_variables) {}
|
||||
|
||||
DECLARE_COMPUTATION(AllocateContext);
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
intptr_t num_context_variables() const { return num_context_variables_; }
|
||||
|
||||
virtual void PrintOperandsTo(BufferFormatter* f) const;
|
||||
|
@ -1612,7 +1553,6 @@ class AllocateContextComp : public TemplateComputation<0> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
const intptr_t num_context_variables_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AllocateContextComp);
|
||||
|
@ -1641,16 +1581,13 @@ class ChainContextComp : public TemplateComputation<1> {
|
|||
class CloneContextComp : public TemplateComputation<1> {
|
||||
public:
|
||||
CloneContextComp(intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
Value* context_value)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index) {
|
||||
: token_pos_(token_pos) {
|
||||
ASSERT(context_value != NULL);
|
||||
inputs_[0] = context_value;
|
||||
}
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
Value* context_value() const { return inputs_[0]; }
|
||||
|
||||
DECLARE_COMPUTATION(CloneContext)
|
||||
|
@ -1660,7 +1597,6 @@ class CloneContextComp : public TemplateComputation<1> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CloneContextComp);
|
||||
};
|
||||
|
@ -1972,12 +1908,10 @@ class NumberNegateComp : public TemplateComputation<1> {
|
|||
|
||||
class CheckStackOverflowComp : public TemplateComputation<0> {
|
||||
public:
|
||||
CheckStackOverflowComp(intptr_t token_pos, intptr_t try_index)
|
||||
: token_pos_(token_pos),
|
||||
try_index_(try_index) {}
|
||||
explicit CheckStackOverflowComp(intptr_t token_pos)
|
||||
: token_pos_(token_pos) {}
|
||||
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
DECLARE_COMPUTATION(CheckStackOverflow)
|
||||
|
||||
|
@ -1986,7 +1920,6 @@ class CheckStackOverflowComp : public TemplateComputation<0> {
|
|||
|
||||
private:
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CheckStackOverflowComp);
|
||||
};
|
||||
|
@ -2057,7 +1990,6 @@ class CheckClassComp : public TemplateComputation<1> {
|
|||
Value* value() const { return inputs_[0]; }
|
||||
|
||||
intptr_t deopt_id() const { return original_->deopt_id(); }
|
||||
intptr_t try_index() const { return original_->try_index(); }
|
||||
|
||||
virtual Definition* TryReplace(BindInstr* instr) const;
|
||||
|
||||
|
@ -2092,7 +2024,6 @@ class CheckSmiComp : public TemplateComputation<1> {
|
|||
Value* value() const { return inputs_[0]; }
|
||||
|
||||
intptr_t deopt_id() const { return original_->deopt_id(); }
|
||||
intptr_t try_index() const { return original_->try_index(); }
|
||||
|
||||
private:
|
||||
InstanceCallComp* original_;
|
||||
|
@ -2129,7 +2060,6 @@ class CheckArrayBoundComp : public TemplateComputation<2> {
|
|||
intptr_t array_type() const { return array_type_; }
|
||||
|
||||
intptr_t deopt_id() const { return original_->deopt_id(); }
|
||||
intptr_t try_index() const { return original_->try_index(); }
|
||||
|
||||
private:
|
||||
intptr_t array_type_;
|
||||
|
@ -2546,9 +2476,12 @@ class BlockEntryInstr : public Instruction {
|
|||
|
||||
virtual bool CanDeoptimize() const { return false; }
|
||||
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
protected:
|
||||
BlockEntryInstr()
|
||||
: preorder_number_(-1),
|
||||
explicit BlockEntryInstr(intptr_t try_index)
|
||||
: try_index_(try_index),
|
||||
preorder_number_(-1),
|
||||
postorder_number_(-1),
|
||||
block_id_(-1),
|
||||
dominator_(NULL),
|
||||
|
@ -2557,6 +2490,7 @@ class BlockEntryInstr : public Instruction {
|
|||
parallel_move_(NULL) { }
|
||||
|
||||
private:
|
||||
const intptr_t try_index_;
|
||||
intptr_t preorder_number_;
|
||||
intptr_t postorder_number_;
|
||||
// Starting and ending lifetime positions for this block. Used by
|
||||
|
@ -2678,8 +2612,8 @@ class GraphEntryInstr : public BlockEntryInstr {
|
|||
|
||||
class JoinEntryInstr : public BlockEntryInstr {
|
||||
public:
|
||||
JoinEntryInstr()
|
||||
: BlockEntryInstr(),
|
||||
explicit JoinEntryInstr(intptr_t try_index)
|
||||
: BlockEntryInstr(try_index),
|
||||
predecessors_(2), // Two is the assumed to be the common case.
|
||||
phis_(NULL),
|
||||
phi_count_(0) { }
|
||||
|
@ -2717,16 +2651,16 @@ class JoinEntryInstr : public BlockEntryInstr {
|
|||
|
||||
class TargetEntryInstr : public BlockEntryInstr {
|
||||
public:
|
||||
TargetEntryInstr()
|
||||
: BlockEntryInstr(),
|
||||
explicit TargetEntryInstr(intptr_t try_index)
|
||||
: BlockEntryInstr(try_index),
|
||||
predecessor_(NULL),
|
||||
try_index_(CatchClauseNode::kInvalidTryIndex) { }
|
||||
catch_try_index_(CatchClauseNode::kInvalidTryIndex) { }
|
||||
|
||||
// Used for exception catch entries.
|
||||
explicit TargetEntryInstr(intptr_t try_index)
|
||||
: BlockEntryInstr(),
|
||||
explicit TargetEntryInstr(intptr_t try_index, intptr_t catch_try_index)
|
||||
: BlockEntryInstr(try_index),
|
||||
predecessor_(NULL),
|
||||
try_index_(try_index) { }
|
||||
catch_try_index_(catch_try_index) { }
|
||||
|
||||
DECLARE_INSTRUCTION(TargetEntry)
|
||||
|
||||
|
@ -2742,20 +2676,23 @@ class TargetEntryInstr : public BlockEntryInstr {
|
|||
predecessor_ = predecessor;
|
||||
}
|
||||
|
||||
bool HasTryIndex() const {
|
||||
return try_index_ != CatchClauseNode::kInvalidTryIndex;
|
||||
// Returns true if this Block is an entry of a catch handler.
|
||||
bool IsCatchEntry() const {
|
||||
return catch_try_index_ != CatchClauseNode::kInvalidTryIndex;
|
||||
}
|
||||
|
||||
intptr_t try_index() const {
|
||||
ASSERT(HasTryIndex());
|
||||
return try_index_;
|
||||
// Returns try index for the try block to which this catch handler
|
||||
// corresponds.
|
||||
intptr_t catch_try_index() const {
|
||||
ASSERT(IsCatchEntry());
|
||||
return catch_try_index_;
|
||||
}
|
||||
|
||||
virtual void PrepareEntry(FlowGraphCompiler* compiler);
|
||||
|
||||
private:
|
||||
BlockEntryInstr* predecessor_;
|
||||
const intptr_t try_index_;
|
||||
const intptr_t catch_try_index_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TargetEntryInstr);
|
||||
};
|
||||
|
@ -3058,10 +2995,9 @@ class ReturnInstr : public TemplateInstruction<1> {
|
|||
|
||||
class ThrowInstr : public TemplateInstruction<0> {
|
||||
public:
|
||||
ThrowInstr(intptr_t token_pos, intptr_t try_index)
|
||||
explicit ThrowInstr(intptr_t token_pos)
|
||||
: deopt_id_(Isolate::Current()->GetNextDeoptId()),
|
||||
token_pos_(token_pos),
|
||||
try_index_(try_index) { }
|
||||
token_pos_(token_pos) { }
|
||||
|
||||
DECLARE_INSTRUCTION(Throw)
|
||||
|
||||
|
@ -3069,7 +3005,6 @@ class ThrowInstr : public TemplateInstruction<0> {
|
|||
|
||||
intptr_t deopt_id() const { return deopt_id_; }
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual LocationSummary* MakeLocationSummary() const;
|
||||
|
||||
|
@ -3080,7 +3015,6 @@ class ThrowInstr : public TemplateInstruction<0> {
|
|||
private:
|
||||
const intptr_t deopt_id_;
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ThrowInstr);
|
||||
};
|
||||
|
@ -3088,11 +3022,9 @@ class ThrowInstr : public TemplateInstruction<0> {
|
|||
|
||||
class ReThrowInstr : public TemplateInstruction<0> {
|
||||
public:
|
||||
ReThrowInstr(intptr_t token_pos,
|
||||
intptr_t try_index)
|
||||
explicit ReThrowInstr(intptr_t token_pos)
|
||||
: deopt_id_(Isolate::Current()->GetNextDeoptId()),
|
||||
token_pos_(token_pos),
|
||||
try_index_(try_index) { }
|
||||
token_pos_(token_pos) { }
|
||||
|
||||
DECLARE_INSTRUCTION(ReThrow)
|
||||
|
||||
|
@ -3100,7 +3032,6 @@ class ReThrowInstr : public TemplateInstruction<0> {
|
|||
|
||||
intptr_t deopt_id() const { return deopt_id_; }
|
||||
intptr_t token_pos() const { return token_pos_; }
|
||||
intptr_t try_index() const { return try_index_; }
|
||||
|
||||
virtual LocationSummary* MakeLocationSummary() const;
|
||||
|
||||
|
@ -3111,7 +3042,6 @@ class ReThrowInstr : public TemplateInstruction<0> {
|
|||
private:
|
||||
const intptr_t deopt_id_;
|
||||
const intptr_t token_pos_;
|
||||
const intptr_t try_index_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ReThrowInstr);
|
||||
};
|
||||
|
|
|
@ -86,7 +86,6 @@ void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ pushl(temp);
|
||||
compiler->GenerateCallRuntime(Isolate::kNoDeoptId,
|
||||
0,
|
||||
CatchClauseNode::kInvalidTryIndex,
|
||||
kTraceFunctionExitRuntimeEntry,
|
||||
locs());
|
||||
__ popl(temp); // Remove argument.
|
||||
|
@ -116,8 +115,7 @@ void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ nop(1);
|
||||
compiler->AddCurrentDescriptor(PcDescriptors::kReturn,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
CatchClauseNode::kInvalidTryIndex);
|
||||
token_pos());
|
||||
}
|
||||
|
||||
|
||||
|
@ -213,7 +211,6 @@ void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ pushl(obj); // Push the source object.
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kConditionTypeErrorRuntimeEntry,
|
||||
locs());
|
||||
// We should never return here.
|
||||
|
@ -278,13 +275,11 @@ LocationSummary* EqualityCompareComp::MakeLocationSummary() const {
|
|||
static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
Token::Kind kind,
|
||||
LocationSummary* locs) {
|
||||
compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
|
||||
deopt_id,
|
||||
token_pos,
|
||||
try_index);
|
||||
token_pos);
|
||||
const String& operator_name = String::ZoneHandle(Symbols::New("=="));
|
||||
const int kNumberOfArguments = 2;
|
||||
const Array& kNoArgumentNames = Array::Handle();
|
||||
|
@ -322,7 +317,6 @@ static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler,
|
|||
__ pushl(right);
|
||||
compiler->GenerateInstanceCall(deopt_id,
|
||||
token_pos,
|
||||
try_index,
|
||||
operator_name,
|
||||
kNumberOfArguments,
|
||||
kNoArgumentNames,
|
||||
|
@ -348,8 +342,7 @@ static void EmitEqualityAsPolymorphicCall(FlowGraphCompiler* compiler,
|
|||
BranchInstr* branch,
|
||||
Token::Kind kind,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index) {
|
||||
intptr_t token_pos) {
|
||||
ASSERT((kind == Token::kEQ) || (kind == Token::kNE));
|
||||
const ICData& ic_data = ICData::Handle(orig_ic_data.AsUnaryClassChecks());
|
||||
ASSERT(ic_data.NumberOfChecks() > 0);
|
||||
|
@ -402,7 +395,6 @@ static void EmitEqualityAsPolymorphicCall(FlowGraphCompiler* compiler,
|
|||
const Array& kNoArgumentNames = Array::Handle();
|
||||
compiler->GenerateStaticCall(deopt_id,
|
||||
token_pos,
|
||||
try_index,
|
||||
target,
|
||||
kNumberOfArguments,
|
||||
kNoArgumentNames,
|
||||
|
@ -494,8 +486,7 @@ static void EmitGenericEqualityCompare(FlowGraphCompiler* compiler,
|
|||
BranchInstr* branch,
|
||||
const ICData& ic_data,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index) {
|
||||
intptr_t token_pos) {
|
||||
ASSERT((kind == Token::kEQ) || (kind == Token::kNE));
|
||||
ASSERT(!ic_data.IsNull() && (ic_data.NumberOfChecks() > 0));
|
||||
Register left = locs->in(0).reg();
|
||||
|
@ -527,7 +518,7 @@ static void EmitGenericEqualityCompare(FlowGraphCompiler* compiler,
|
|||
__ pushl(left);
|
||||
__ pushl(right);
|
||||
EmitEqualityAsPolymorphicCall(compiler, ic_data, locs, branch, kind,
|
||||
deopt_id, token_pos, try_index);
|
||||
deopt_id, token_pos);
|
||||
__ Bind(&done);
|
||||
}
|
||||
|
||||
|
@ -632,19 +623,14 @@ void EqualityCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
}
|
||||
if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
|
||||
EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(),
|
||||
deopt_id(), token_pos(), try_index());
|
||||
deopt_id(), token_pos());
|
||||
return;
|
||||
}
|
||||
Register left = locs()->in(0).reg();
|
||||
Register right = locs()->in(1).reg();
|
||||
__ pushl(left);
|
||||
__ pushl(right);
|
||||
EmitEqualityAsInstanceCall(compiler,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kind(),
|
||||
locs());
|
||||
EmitEqualityAsInstanceCall(compiler, deopt_id(), token_pos(), kind(), locs());
|
||||
ASSERT(locs()->out().reg() == EAX);
|
||||
}
|
||||
|
||||
|
@ -671,7 +657,7 @@ void EqualityCompareComp::EmitBranchCode(FlowGraphCompiler* compiler,
|
|||
}
|
||||
if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
|
||||
EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(),
|
||||
deopt_id(), token_pos(), try_index());
|
||||
deopt_id(), token_pos());
|
||||
return;
|
||||
}
|
||||
Register left = locs()->in(0).reg();
|
||||
|
@ -681,7 +667,6 @@ void EqualityCompareComp::EmitBranchCode(FlowGraphCompiler* compiler,
|
|||
EmitEqualityAsInstanceCall(compiler,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
Token::kEQ, // kNE reverse occurs at branch.
|
||||
locs());
|
||||
Condition branch_condition = (kind() == Token::kNE) ? NOT_EQUAL : EQUAL;
|
||||
|
@ -749,7 +734,6 @@ void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
deopt, // Deoptimize target.
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
locs());
|
||||
return;
|
||||
}
|
||||
|
@ -757,13 +741,11 @@ void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
String::ZoneHandle(Symbols::New(Token::Str(kind())));
|
||||
compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index());
|
||||
token_pos());
|
||||
const intptr_t kNumArguments = 2;
|
||||
const intptr_t kNumArgsChecked = 2; // Type-feedback.
|
||||
compiler->GenerateInstanceCall(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
function_name,
|
||||
kNumArguments,
|
||||
Array::ZoneHandle(), // No optional arguments.
|
||||
|
@ -823,7 +805,6 @@ void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function())));
|
||||
__ movl(EDX, Immediate(arg_count));
|
||||
compiler->GenerateCall(token_pos(),
|
||||
try_index(),
|
||||
&StubCode::CallNativeCFunctionLabel(),
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1040,7 +1021,6 @@ void InstanceOfComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
|
||||
compiler->GenerateInstanceOf(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
type(),
|
||||
negate_result(),
|
||||
locs());
|
||||
|
@ -1064,7 +1044,6 @@ void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
ASSERT(locs()->in(0).reg() == ECX);
|
||||
__ movl(EDX, Immediate(Smi::RawValue(ArgumentCount())));
|
||||
compiler->GenerateCall(token_pos(),
|
||||
try_index(),
|
||||
&StubCode::AllocateArrayLabel(),
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1106,7 +1085,6 @@ void AllocateObjectWithBoundsCheckComp::EmitNativeCode(
|
|||
__ pushl(instantiator_type_arguments);
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kAllocateObjectWithBoundsCheckRuntimeEntry,
|
||||
locs());
|
||||
// Pop instantiator type arguments, type arguments, and class.
|
||||
|
@ -1193,7 +1171,6 @@ void InstantiateTypeArgumentsComp::EmitNativeCode(
|
|||
__ pushl(instantiator_reg); // Push instantiator type arguments.
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kInstantiateTypeArgumentsRuntimeEntry,
|
||||
locs());
|
||||
__ Drop(2); // Drop instantiator and uninstantiated type arguments.
|
||||
|
@ -1349,7 +1326,6 @@ void AllocateContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
const ExternalLabel label("alloc_context",
|
||||
StubCode::AllocateContextEntryPoint());
|
||||
compiler->GenerateCall(token_pos(),
|
||||
try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1375,7 +1351,6 @@ void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ pushl(context_value);
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kCloneContextRuntimeEntry,
|
||||
locs());
|
||||
__ popl(result); // Remove argument.
|
||||
|
@ -1431,7 +1406,6 @@ class CheckStackOverflowSlowPath : public SlowPathCode {
|
|||
compiler->SaveLiveRegisters(computation_->locs());
|
||||
compiler->GenerateCallRuntime(computation_->deopt_id(),
|
||||
computation_->token_pos(),
|
||||
computation_->try_index(),
|
||||
kStackOverflowRuntimeEntry,
|
||||
computation_->locs());
|
||||
compiler->RestoreLiveRegisters(computation_->locs());
|
||||
|
@ -1620,7 +1594,6 @@ void BinarySmiOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
compiler->GenerateStaticCall(
|
||||
instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
target,
|
||||
kArgumentCount,
|
||||
Array::Handle(), // No argument names.
|
||||
|
@ -1727,7 +1700,6 @@ void BinaryMintOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
compiler->GenerateStaticCall(
|
||||
instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
target,
|
||||
instance_call()->ArgumentCount(),
|
||||
instance_call()->argument_names(),
|
||||
|
@ -1749,7 +1721,6 @@ void BinaryMintOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
compiler->GenerateStaticCall(
|
||||
instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
target,
|
||||
instance_call()->ArgumentCount(),
|
||||
instance_call()->argument_names(),
|
||||
|
@ -1777,7 +1748,6 @@ void BinaryDoubleOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
Code::Handle(StubCode::GetAllocationStubForClass(double_class));
|
||||
const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
|
||||
compiler->GenerateCall(instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1870,7 +1840,6 @@ class BoxDoubleSlowPath : public SlowPathCode {
|
|||
|
||||
compiler->SaveLiveRegisters(locs);
|
||||
compiler->GenerateCall(computation_->instance_call()->token_pos(),
|
||||
computation_->instance_call()->try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs);
|
||||
|
@ -2035,7 +2004,6 @@ void NumberNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
|
||||
__ pushl(value);
|
||||
compiler->GenerateCall(instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -2098,7 +2066,6 @@ void SmiToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
|
||||
// TODO(vegorov): allocate box in the driver loop to avoid spilling.
|
||||
compiler->GenerateCall(instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -2134,7 +2101,6 @@ void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
const Function& target = Function::ZoneHandle(ic_data()->GetTargetAt(0));
|
||||
compiler->GenerateStaticCall(instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
target,
|
||||
instance_call()->ArgumentCount(),
|
||||
instance_call()->argument_names(),
|
||||
|
@ -2160,7 +2126,6 @@ void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
deopt,
|
||||
instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
locs());
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
namespace dart {
|
||||
|
||||
TEST_CASE(InstructionTests) {
|
||||
TargetEntryInstr* target_instr = new TargetEntryInstr();
|
||||
TargetEntryInstr* target_instr =
|
||||
new TargetEntryInstr(CatchClauseNode::kInvalidTryIndex);
|
||||
EXPECT(target_instr->IsBlockEntry());
|
||||
EXPECT(!target_instr->IsBind());
|
||||
BindInstr* bind_instr =
|
||||
|
|
|
@ -87,7 +87,6 @@ void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ pushq(temp);
|
||||
compiler->GenerateCallRuntime(Isolate::kNoDeoptId,
|
||||
0,
|
||||
CatchClauseNode::kInvalidTryIndex,
|
||||
kTraceFunctionExitRuntimeEntry,
|
||||
NULL);
|
||||
__ popq(temp); // Remove argument.
|
||||
|
@ -125,8 +124,7 @@ void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ nop(1);
|
||||
compiler->AddCurrentDescriptor(PcDescriptors::kReturn,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
CatchClauseNode::kInvalidTryIndex);
|
||||
token_pos());
|
||||
}
|
||||
|
||||
|
||||
|
@ -222,7 +220,6 @@ void AssertBooleanComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ pushq(obj); // Push the source object.
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kConditionTypeErrorRuntimeEntry,
|
||||
locs());
|
||||
// We should never return here.
|
||||
|
@ -287,13 +284,11 @@ LocationSummary* EqualityCompareComp::MakeLocationSummary() const {
|
|||
static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index,
|
||||
Token::Kind kind,
|
||||
LocationSummary* locs) {
|
||||
compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
|
||||
deopt_id,
|
||||
token_pos,
|
||||
try_index);
|
||||
token_pos);
|
||||
const String& operator_name = String::ZoneHandle(Symbols::New("=="));
|
||||
const int kNumberOfArguments = 2;
|
||||
const Array& kNoArgumentNames = Array::Handle();
|
||||
|
@ -331,7 +326,6 @@ static void EmitEqualityAsInstanceCall(FlowGraphCompiler* compiler,
|
|||
__ pushq(right);
|
||||
compiler->GenerateInstanceCall(deopt_id,
|
||||
token_pos,
|
||||
try_index,
|
||||
operator_name,
|
||||
kNumberOfArguments,
|
||||
kNoArgumentNames,
|
||||
|
@ -357,8 +351,7 @@ static void EmitEqualityAsPolymorphicCall(FlowGraphCompiler* compiler,
|
|||
BranchInstr* branch,
|
||||
Token::Kind kind,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index) {
|
||||
intptr_t token_pos) {
|
||||
ASSERT((kind == Token::kEQ) || (kind == Token::kNE));
|
||||
const ICData& ic_data = ICData::Handle(orig_ic_data.AsUnaryClassChecks());
|
||||
ASSERT(ic_data.NumberOfChecks() > 0);
|
||||
|
@ -412,7 +405,6 @@ static void EmitEqualityAsPolymorphicCall(FlowGraphCompiler* compiler,
|
|||
const Array& kNoArgumentNames = Array::Handle();
|
||||
compiler->GenerateStaticCall(deopt_id,
|
||||
token_pos,
|
||||
try_index,
|
||||
target,
|
||||
kNumberOfArguments,
|
||||
kNoArgumentNames,
|
||||
|
@ -504,8 +496,7 @@ static void EmitGenericEqualityCompare(FlowGraphCompiler* compiler,
|
|||
BranchInstr* branch,
|
||||
const ICData& ic_data,
|
||||
intptr_t deopt_id,
|
||||
intptr_t token_pos,
|
||||
intptr_t try_index) {
|
||||
intptr_t token_pos) {
|
||||
ASSERT((kind == Token::kEQ) || (kind == Token::kNE));
|
||||
ASSERT(!ic_data.IsNull() && (ic_data.NumberOfChecks() > 0));
|
||||
Register left = locs->in(0).reg();
|
||||
|
@ -537,7 +528,7 @@ static void EmitGenericEqualityCompare(FlowGraphCompiler* compiler,
|
|||
__ pushq(left);
|
||||
__ pushq(right);
|
||||
EmitEqualityAsPolymorphicCall(compiler, ic_data, locs, branch, kind,
|
||||
deopt_id, token_pos, try_index);
|
||||
deopt_id, token_pos);
|
||||
__ Bind(&done);
|
||||
}
|
||||
|
||||
|
@ -642,7 +633,7 @@ void EqualityCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
}
|
||||
if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
|
||||
EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(),
|
||||
deopt_id(), token_pos(), try_index());
|
||||
deopt_id(), token_pos());
|
||||
return;
|
||||
}
|
||||
Register left = locs()->in(0).reg();
|
||||
|
@ -652,7 +643,6 @@ void EqualityCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
EmitEqualityAsInstanceCall(compiler,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kind(),
|
||||
locs());
|
||||
ASSERT(locs()->out().reg() == RAX);
|
||||
|
@ -681,7 +671,7 @@ void EqualityCompareComp::EmitBranchCode(FlowGraphCompiler* compiler,
|
|||
}
|
||||
if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
|
||||
EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(),
|
||||
deopt_id(), token_pos(), try_index());
|
||||
deopt_id(), token_pos());
|
||||
return;
|
||||
}
|
||||
Register left = locs()->in(0).reg();
|
||||
|
@ -691,7 +681,6 @@ void EqualityCompareComp::EmitBranchCode(FlowGraphCompiler* compiler,
|
|||
EmitEqualityAsInstanceCall(compiler,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
Token::kEQ, // kNE reverse occurs at branch.
|
||||
locs());
|
||||
Condition branch_condition = (kind() == Token::kNE) ? NOT_EQUAL : EQUAL;
|
||||
|
@ -760,7 +749,6 @@ void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
deopt, // Deoptimize target.
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
locs());
|
||||
return;
|
||||
}
|
||||
|
@ -768,13 +756,11 @@ void RelationalOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
String::ZoneHandle(Symbols::New(Token::Str(kind())));
|
||||
compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
|
||||
deopt_id(),
|
||||
token_pos(),
|
||||
try_index());
|
||||
token_pos());
|
||||
const intptr_t kNumArguments = 2;
|
||||
const intptr_t kNumArgsChecked = 2; // Type-feedback.
|
||||
compiler->GenerateInstanceCall(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
function_name,
|
||||
kNumArguments,
|
||||
Array::ZoneHandle(), // No optional arguments.
|
||||
|
@ -834,7 +820,6 @@ void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ movq(RBX, Immediate(reinterpret_cast<uword>(native_c_function())));
|
||||
__ movq(R10, Immediate(arg_count));
|
||||
compiler->GenerateCall(token_pos(),
|
||||
try_index(),
|
||||
&StubCode::CallNativeCFunctionLabel(),
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1057,7 +1042,6 @@ void InstanceOfComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
|
||||
compiler->GenerateInstanceOf(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
type(),
|
||||
negate_result(),
|
||||
locs());
|
||||
|
@ -1081,7 +1065,6 @@ void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
ASSERT(locs()->in(0).reg() == RBX);
|
||||
__ movq(R10, Immediate(Smi::RawValue(ArgumentCount())));
|
||||
compiler->GenerateCall(token_pos(),
|
||||
try_index(),
|
||||
&StubCode::AllocateArrayLabel(),
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1123,7 +1106,6 @@ void AllocateObjectWithBoundsCheckComp::EmitNativeCode(
|
|||
__ pushq(instantiator_type_arguments);
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kAllocateObjectWithBoundsCheckRuntimeEntry,
|
||||
locs());
|
||||
// Pop instantiator type arguments, type arguments, and class.
|
||||
|
@ -1207,7 +1189,6 @@ void InstantiateTypeArgumentsComp::EmitNativeCode(
|
|||
__ pushq(instantiator_reg); // Push instantiator type arguments.
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kInstantiateTypeArgumentsRuntimeEntry,
|
||||
locs());
|
||||
__ Drop(2); // Drop instantiator and uninstantiated type arguments.
|
||||
|
@ -1359,7 +1340,6 @@ void AllocateContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
const ExternalLabel label("alloc_context",
|
||||
StubCode::AllocateContextEntryPoint());
|
||||
compiler->GenerateCall(token_pos(),
|
||||
try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1385,7 +1365,6 @@ void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
__ pushq(context_value);
|
||||
compiler->GenerateCallRuntime(deopt_id(),
|
||||
token_pos(),
|
||||
try_index(),
|
||||
kCloneContextRuntimeEntry,
|
||||
locs());
|
||||
__ popq(result); // Remove argument.
|
||||
|
@ -1442,7 +1421,6 @@ class CheckStackOverflowSlowPath : public SlowPathCode {
|
|||
compiler->SaveLiveRegisters(computation_->locs());
|
||||
compiler->GenerateCallRuntime(computation_->deopt_id(),
|
||||
computation_->token_pos(),
|
||||
computation_->try_index(),
|
||||
kStackOverflowRuntimeEntry,
|
||||
computation_->locs());
|
||||
compiler->RestoreLiveRegisters(computation_->locs());
|
||||
|
@ -1632,7 +1610,6 @@ void BinarySmiOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
compiler->GenerateStaticCall(
|
||||
instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
target,
|
||||
kArgumentCount,
|
||||
Array::Handle(), // No argument names.
|
||||
|
@ -1737,7 +1714,6 @@ void BinaryMintOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
compiler->GenerateStaticCall(
|
||||
instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
target,
|
||||
instance_call()->ArgumentCount(),
|
||||
instance_call()->argument_names(),
|
||||
|
@ -1759,7 +1735,6 @@ void BinaryMintOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
compiler->GenerateStaticCall(
|
||||
instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
target,
|
||||
instance_call()->ArgumentCount(),
|
||||
instance_call()->argument_names(),
|
||||
|
@ -1787,7 +1762,6 @@ void BinaryDoubleOpComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
Code::Handle(StubCode::GetAllocationStubForClass(double_class));
|
||||
const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
|
||||
compiler->GenerateCall(instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -1880,7 +1854,6 @@ class BoxDoubleSlowPath : public SlowPathCode {
|
|||
|
||||
compiler->SaveLiveRegisters(locs);
|
||||
compiler->GenerateCall(computation_->instance_call()->token_pos(),
|
||||
computation_->instance_call()->try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs);
|
||||
|
@ -2045,7 +2018,6 @@ void NumberNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
const ExternalLabel label(double_class.ToCString(), stub.EntryPoint());
|
||||
__ pushq(value);
|
||||
compiler->GenerateCall(instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
instance_call()->locs());
|
||||
|
@ -2108,7 +2080,6 @@ void SmiToDoubleComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
// TODO(fschneider): Inline new-space allocation and move the call into
|
||||
// deferred code.
|
||||
compiler->GenerateCall(instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
&label,
|
||||
PcDescriptors::kOther,
|
||||
locs());
|
||||
|
@ -2144,7 +2115,6 @@ void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
const Function& target = Function::ZoneHandle(ic_data()->GetTargetAt(0));
|
||||
compiler->GenerateStaticCall(instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
target,
|
||||
instance_call()->ArgumentCount(),
|
||||
instance_call()->argument_names(),
|
||||
|
@ -2168,7 +2138,6 @@ void PolymorphicInstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
|
|||
deopt,
|
||||
instance_call()->deopt_id(),
|
||||
instance_call()->token_pos(),
|
||||
instance_call()->try_index(),
|
||||
locs());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue