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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2818273002: Remove parent_level field of function type parameters. (Closed)
Patch Set: address 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/vm/raw_object_snapshot.cc ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_dbc.cc
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc
index 2326d9ebb4e2a3e119d927ab9f14f65e58fb792f..e99f3bf4cb43666fe952a5c9227b46b647792ae3 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -3015,7 +3015,11 @@ RawObject* Simulator::Call(const Code& code,
RawObject* instance_cid_or_function;
if (cid == kClosureCid) {
RawClosure* closure = static_cast<RawClosure*>(instance);
- instance_type_arguments = closure->ptr()->instantiator_;
+ if (closure->ptr()->function_type_arguments_ != TypeArguments::null()) {
+ // Cache cannot be used for generic closures.
+ goto InstanceOfCallRuntime;
+ }
+ instance_type_arguments = closure->ptr()->instantiator_type_arguments_;
instance_cid_or_function = closure->ptr()->function_;
} else {
instance_cid_or_function = Smi::New(cid);
@@ -3108,7 +3112,13 @@ RawObject* Simulator::Call(const Code& code,
RawObject* instance_cid_or_function;
if (cid == kClosureCid) {
RawClosure* closure = static_cast<RawClosure*>(instance);
- instance_type_arguments = closure->ptr()->instantiator_;
+ if (closure->ptr()->function_type_arguments_ !=
+ TypeArguments::null()) {
+ // Cache cannot be used for generic closures.
+ goto AssertAssignableCallRuntime;
+ }
+ instance_type_arguments =
+ closure->ptr()->instantiator_type_arguments_;
instance_cid_or_function = closure->ptr()->function_;
} else {
instance_cid_or_function = Smi::New(cid);
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698