Index: runtime/vm/jit_optimizer.cc |
diff --git a/runtime/vm/jit_optimizer.cc b/runtime/vm/jit_optimizer.cc |
index d44da83d89a2415e3e01cf19e6b5b906d7537868..3617103b343cf6c1b702e9633405c6bd490a30b8 100644 |
--- a/runtime/vm/jit_optimizer.cc |
+++ b/runtime/vm/jit_optimizer.cc |
@@ -1335,15 +1335,18 @@ static bool TryExpandTestCidsResult(ZoneGrowableArray<intptr_t>* results, |
void JitOptimizer::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(); |
} |
const ICData& unary_checks = |
ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks()); |
@@ -1397,8 +1400,8 @@ void JitOptimizer::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); |
} |
@@ -1408,9 +1411,10 @@ void JitOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) { |
void JitOptimizer::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()); |
@@ -1437,8 +1441,8 @@ void JitOptimizer::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); |
} |