From c7383b5cafdc290db5e0ff95b31f5ed8efbbd524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Crelier?= Date: Wed, 26 Sep 2018 00:28:29 +0000 Subject: [PATCH] Revert "[VM runtime] Store Smi instance type in type test cache when using the interpreter." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4cf2d3990bac1f1df2f524899e1560a3683f3133. Reason for revert: 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 > Commit-Queue: Régis Crelier 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 Commit-Queue: Régis Crelier --- runtime/vm/runtime_entry.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc index e5db6fa2d0d86..95542e03019f8 100644 --- a/runtime/vm/runtime_entry.cc +++ b/runtime/vm/runtime_entry.cc @@ -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);