Use Function::ZoneHandle for StaticCallInstr targets

R=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2897643002 .
This commit is contained in:
Aske Simon Christensen 2017-05-19 15:56:26 +02:00
parent 3b5874a332
commit c8f9e0f3f9
2 changed files with 5 additions and 3 deletions

View file

@ -2023,7 +2023,7 @@ void AotOptimizer::VisitPolymorphicInstanceCall(
if (receiver_cid != kDynamicCid) {
const Class& receiver_class =
Class::Handle(Z, isolate()->class_table()->At(receiver_cid));
const Function& function = Function::Handle(
const Function& function = Function::ZoneHandle(
Z, call->instance_call()->ResolveForReceiverClass(receiver_class));
if (!function.IsNull()) {
// Only one target. Replace by static call.

View file

@ -1489,7 +1489,8 @@ void JitOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
}
if (has_one_target) {
const Function& target = Function::Handle(Z, unary_checks.GetTargetAt(0));
const Function& target =
Function::ZoneHandle(Z, unary_checks.GetTargetAt(0));
const RawFunction::Kind function_kind = target.kind();
if (!flow_graph()->InstanceCallNeedsClassCheck(instr, function_kind)) {
StaticCallInstr* call = StaticCallInstr::FromCall(Z, instr, target);
@ -1516,7 +1517,8 @@ void JitOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
// array, not the IC array.
AddReceiverCheck(instr);
// Call can still deoptimize, do not detach environment from instr.
const Function& target = Function::Handle(Z, unary_checks.GetTargetAt(0));
const Function& target =
Function::ZoneHandle(Z, unary_checks.GetTargetAt(0));
StaticCallInstr* call = StaticCallInstr::FromCall(Z, instr, target);
instr->ReplaceWith(call, current_iterator());
} else {