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

Unified Diff: runtime/vm/intermediate_language.h

Issue 18801007: Support type parameters and classes as expression in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 24832)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -554,6 +554,7 @@
M(StoreVMField) \
M(LoadUntagged) \
M(LoadClassId) \
+ M(InstantiateType) \
M(InstantiateTypeArguments) \
M(ExtractConstructorTypeArguments) \
M(ExtractConstructorInstantiator) \
@@ -4063,6 +4064,44 @@
};
+class InstantiateTypeInstr : public TemplateDefinition<1> {
+ public:
+ InstantiateTypeInstr(intptr_t token_pos,
+ const AbstractType& type,
+ const Class& instantiator_class,
+ Value* instantiator)
+ : token_pos_(token_pos),
+ type_(type),
+ instantiator_class_(instantiator_class) {
+ ASSERT(type.IsZoneHandle());
+ SetInputAt(0, instantiator);
+ }
+
+ DECLARE_INSTRUCTION(InstantiateType)
+
+ Value* instantiator() const { return inputs_[0]; }
+ const AbstractType& type() const { return type_;
+ }
+ const Class& instantiator_class() const { return instantiator_class_; }
+ intptr_t token_pos() const { return token_pos_; }
+
+ virtual void PrintOperandsTo(BufferFormatter* f) const;
+
+ virtual bool CanDeoptimize() const { return true; }
+
+ virtual EffectSet Effects() const { return EffectSet::None(); }
+
+ virtual bool MayThrow() const { return true; }
+
+ private:
+ const intptr_t token_pos_;
+ const AbstractType& type_;
+ const Class& instantiator_class_;
+
+ DISALLOW_COPY_AND_ASSIGN(InstantiateTypeInstr);
+};
+
+
class InstantiateTypeArgumentsInstr : public TemplateDefinition<1> {
public:
InstantiateTypeArgumentsInstr(intptr_t token_pos,
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698