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

Unified Diff: runtime/lib/mirrors.cc

Issue 2799373002: Pass a second type argument vector to all type instantiation calls in the VM. (Closed)
Patch Set: addressed 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 | « no previous file | runtime/lib/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 067df19571c0f2e7997db31ccb3be44ad4e7e72f..b64cda34ae4c088f820bf8cbdd85c096d57300bc 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -754,7 +754,13 @@ static RawAbstractType* InstantiateType(const AbstractType& type,
PROPAGATE_IF_MALFORMED(type);
ASSERT(type.IsCanonical() || type.IsTypeParameter() || type.IsBoundedType());
+ // TODO(regis): Support uninstantiated type referring to function type params.
+ if (!type.IsInstantiated(kFunctions)) {
+ UNIMPLEMENTED();
+ }
+
if (type.IsInstantiated() || instantiator.IsNull()) {
+ // TODO(regis): Shouldn't type parameters be replaced by dynamic?
return type.Canonicalize();
}
@@ -762,11 +768,12 @@ static RawAbstractType* InstantiateType(const AbstractType& type,
ASSERT(instantiator.IsFinalized());
PROPAGATE_IF_MALFORMED(instantiator);
- const TypeArguments& type_args =
+ const TypeArguments& instantiator_type_args =
TypeArguments::Handle(instantiator.arguments());
Error& bound_error = Error::Handle();
- AbstractType& result = AbstractType::Handle(
- type.InstantiateFrom(type_args, &bound_error, NULL, NULL, Heap::kOld));
+ AbstractType& result = AbstractType::Handle(type.InstantiateFrom(
+ instantiator_type_args, Object::null_type_arguments(), &bound_error, NULL,
+ NULL, Heap::kOld));
if (!bound_error.IsNull()) {
Exceptions::PropagateError(bound_error);
UNREACHABLE();
@@ -1703,9 +1710,11 @@ DEFINE_NATIVE_ENTRY(ClassMirror_invokeConstructor, 5) {
if (!redirect_type.IsInstantiated()) {
// The type arguments of the redirection type are instantiated from the
// type arguments of the type reflected by the class mirror.
+ ASSERT(redirect_type.IsInstantiated(kFunctions));
Error& bound_error = Error::Handle();
redirect_type ^= redirect_type.InstantiateFrom(
- type_arguments, &bound_error, NULL, NULL, Heap::kOld);
+ type_arguments, Object::null_type_arguments(), &bound_error, NULL,
+ NULL, Heap::kOld);
if (!bound_error.IsNull()) {
Exceptions::PropagateError(bound_error);
UNREACHABLE();
« no previous file with comments | « no previous file | runtime/lib/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698