Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: runtime/vm/aot_optimizer.cc

Issue 2799373002: Pass a second type argument vector to all type instantiation calls in the VM. (Closed)
Patch Set: addressed comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/object_patch.dart ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/aot_optimizer.cc
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
index 5dfe8f507c5c258647c1c4d08ef7533b7a01ab75..742794fc07865cc78e88842f3c2c28221242fb84 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -1448,15 +1448,18 @@ static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results,
void AotOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) {
ASSERT(Token::IsTypeTestOperator(call->token_kind()));
Definition* left = call->ArgumentAt(0);
- Definition* type_args = NULL;
+ Definition* instantiator_type_args = NULL;
+ Definition* function_type_args = NULL;
AbstractType& type = AbstractType::ZoneHandle(Z);
if (call->ArgumentCount() == 2) {
- type_args = flow_graph()->constant_null();
+ instantiator_type_args = flow_graph()->constant_null();
+ function_type_args = flow_graph()->constant_null();
ASSERT(call->MatchesCoreName(Symbols::_simpleInstanceOf()));
type = AbstractType::Cast(call->ArgumentAt(1)->AsConstant()->value()).raw();
} else {
- type_args = call->ArgumentAt(1);
- type = AbstractType::Cast(call->ArgumentAt(2)->AsConstant()->value()).raw();
+ instantiator_type_args = call->ArgumentAt(1);
+ function_type_args = call->ArgumentAt(2);
+ type = AbstractType::Cast(call->ArgumentAt(3)->AsConstant()->value()).raw();
}
if (TypeCheckAsClassEquality(type)) {
@@ -1550,8 +1553,8 @@ void AotOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) {
}
InstanceOfInstr* instance_of = new (Z) InstanceOfInstr(
- call->token_pos(), new (Z) Value(left), new (Z) Value(type_args),
- NULL, // TODO(regis): Pass function type args.
+ call->token_pos(), new (Z) Value(left),
+ new (Z) Value(instantiator_type_args), new (Z) Value(function_type_args),
type, call->deopt_id());
ReplaceCall(call, instance_of);
}
@@ -1561,9 +1564,10 @@ void AotOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) {
void AotOptimizer::ReplaceWithTypeCast(InstanceCallInstr* call) {
ASSERT(Token::IsTypeCastOperator(call->token_kind()));
Definition* left = call->ArgumentAt(0);
- Definition* type_args = call->ArgumentAt(1);
+ Definition* instantiator_type_args = call->ArgumentAt(1);
+ Definition* function_type_args = call->ArgumentAt(2);
const AbstractType& type =
- AbstractType::Cast(call->ArgumentAt(2)->AsConstant()->value());
+ AbstractType::Cast(call->ArgumentAt(3)->AsConstant()->value());
ASSERT(!type.IsMalformedOrMalbounded());
const ICData& unary_checks =
ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
@@ -1593,8 +1597,8 @@ void AotOptimizer::ReplaceWithTypeCast(InstanceCallInstr* call) {
}
}
AssertAssignableInstr* assert_as = new (Z) AssertAssignableInstr(
- call->token_pos(), new (Z) Value(left), new (Z) Value(type_args),
- NULL, // TODO(regis): Pass function type arguments.
+ call->token_pos(), new (Z) Value(left),
+ new (Z) Value(instantiator_type_args), new (Z) Value(function_type_args),
type, Symbols::InTypeCast(), call->deopt_id());
ReplaceCall(call, assert_as);
}
« no previous file with comments | « runtime/lib/object_patch.dart ('k') | runtime/vm/assembler_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698