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

Unified Diff: runtime/vm/intermediate_language.h

Issue 2894953002: Support inlining of calls where type arguments are passed to generic functions. (Closed)
Patch Set: work in progress Created 3 years, 6 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
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 69164b03d908061e87dcb6423b4d2594a83c2fc3..b958f97dcbf8f160fb7151b1bfce4dc7ce02db3a 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -381,7 +381,7 @@ class EmbeddedArray<T, 0> {
M(Branch) \
M(AssertAssignable) \
M(AssertBoolean) \
- M(CurrentContext) \
+ M(SpecialParameter) \
M(ClosureCall) \
M(InstanceCall) \
M(PolymorphicInstanceCall) \
@@ -2778,14 +2778,16 @@ class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
};
-// Denotes the current context, normally held in a register. This is
-// a computation, not a value, because it's mutable.
-class CurrentContextInstr : public TemplateDefinition<0, NoThrow> {
+// Denotes a special parameter, currently either the context of a closure
+// (normally held in a register) or the type arguments of a generic function.
+// This is a computation, not a value, because it's mutable.
+class SpecialParameterInstr : public TemplateDefinition<0, NoThrow> {
public:
- explicit CurrentContextInstr(intptr_t deopt_id)
- : TemplateDefinition(deopt_id) {}
+ enum SpecialParameterKind { kContext, kTypeArgs };
+ SpecialParameterInstr(SpecialParameterKind kind, intptr_t deopt_id)
+ : TemplateDefinition(deopt_id), kind_(kind) {}
- DECLARE_INSTRUCTION(CurrentContext)
+ DECLARE_INSTRUCTION(SpecialParameter)
virtual CompileType ComputeType() const;
virtual bool ComputeCanDeoptimize() const { return false; }
@@ -2793,9 +2795,11 @@ class CurrentContextInstr : public TemplateDefinition<0, NoThrow> {
virtual EffectSet Effects() const { return EffectSet::None(); }
virtual EffectSet Dependencies() const { return EffectSet::None(); }
virtual bool AttributesEqual(Instruction* other) const { return true; }
+ SpecialParameterKind kind() const { return kind_; }
private:
- DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr);
+ const SpecialParameterKind kind_;
+ DISALLOW_COPY_AND_ASSIGN(SpecialParameterInstr);
};

Powered by Google App Engine
This is Rietveld 408576698