Skip to content

Commit

Permalink
Revert "[VM runtime] Store Smi instance type in type test cache when …
Browse files Browse the repository at this point in the history
…using the interpreter."

This reverts commit 4cf2d39.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [VM runtime] Store Smi instance type in type test cache when using the interpreter.
> 
> Instances of type Smi are handled in generated code and not looked up in
> type test cache. The interpreter does not implement this special handling and
> relies on the cache for Smi instances as well.
> 
> Change-Id: I3a8501efcbadfcbe848871ad0f6ada444414be43
> Reviewed-on: https://dart-review.googlesource.com/76305
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Régis Crelier <regis@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,zra@google.com,regis@google.com

Change-Id: I3cb0ced7520a62295e75ee92e4de2b5d41770676
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/76583
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
  • Loading branch information
crelier authored and commit-bot@chromium.org committed Sep 26, 2018
1 parent d1a3eaa commit c7383b5
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions runtime/vm/runtime_entry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -637,24 +637,18 @@ static void UpdateTypeTestCache(
}
return;
}
Class& instance_class = Class::Handle(zone);
if (instance.IsSmi()) {
if (FLAG_enable_interpreter) {
instance_class = Smi::Class();
} else {
if (FLAG_trace_type_checks) {
OS::PrintErr("UpdateTypeTestCache: instance is Smi, not updating\n");
}
return;
if (FLAG_trace_type_checks) {
OS::PrintErr("UpdateTypeTestCache: instance is Smi\n");
}
} else {
instance_class = instance.clazz();
return;
}
// If the type is uninstantiated and refers to parent function type
// parameters, the function_type_arguments have been canonicalized
// when concatenated.
ASSERT(function_type_arguments.IsNull() ||
function_type_arguments.IsCanonical());
const Class& instance_class = Class::Handle(zone, instance.clazz());
auto& instance_class_id_or_function = Object::Handle(zone);
auto& instance_type_arguments = TypeArguments::Handle(zone);
auto& instance_parent_function_type_arguments = TypeArguments::Handle(zone);
Expand Down

0 comments on commit c7383b5

Please sign in to comment.