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

Unified Diff: runtime/vm/kernel_to_il.h

Issue 2571393002: VM: [Kernel] don't crash when encountering generic methods in Kernel. (Closed)
Patch Set: Created 4 years 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/vm/kernel_to_il.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.h
diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h
index 3f9db3e994e2d13ff2dd6c96f0b8ce48088c2085..b3cc17473a94948c57ac99d0eb0d367bb83e451d 100644
--- a/runtime/vm/kernel_to_il.h
+++ b/runtime/vm/kernel_to_il.h
@@ -284,6 +284,7 @@ class DartTypeTranslator : public DartTypeVisitor {
bool finalize = false)
: translation_helper_(*helper),
active_class_(active_class),
+ type_parameter_scope_(NULL),
zone_(helper->zone()),
result_(AbstractType::Handle(helper->zone())),
finalize_(finalize) {}
@@ -327,11 +328,31 @@ class DartTypeTranslator : public DartTypeVisitor {
const Type& ReceiverType(const dart::Class& klass);
private:
+ class TypeParameterScope {
+ public:
+ TypeParameterScope(DartTypeTranslator* translator,
+ List<TypeParameter>* parameters)
+ : parameters_(parameters),
+ outer_(translator->type_parameter_scope_),
+ translator_(translator) {
+ translator_->type_parameter_scope_ = this;
+ }
+ ~TypeParameterScope() { translator_->type_parameter_scope_ = outer_; }
+
+ TypeParameterScope* outer() const { return outer_; }
+ List<TypeParameter>* parameters() const { return parameters_; }
+
+ private:
+ List<TypeParameter>* parameters_;
+ TypeParameterScope* outer_;
+ DartTypeTranslator* translator_;
+ };
+
TranslationHelper& translation_helper_;
ActiveClass* active_class_;
+ TypeParameterScope* type_parameter_scope_;
Zone* zone_;
AbstractType& result_;
-
bool finalize_;
};
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698