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

Unified Diff: runtime/vm/intermediate_language.h

Issue 2894953002: Support inlining of calls where type arguments are passed to generic functions. (Closed)
Patch Set: address review comments Created 3 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
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 69164b03d908061e87dcb6423b4d2594a83c2fc3..405b7480fb13d1e87f7506fd5f8d6f4bf631f9a5 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,24 +2778,29 @@ 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
+// or the type arguments of a generic function.
+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; }
virtual EffectSet Effects() const { return EffectSet::None(); }
virtual EffectSet Dependencies() const { return EffectSet::None(); }
- virtual bool AttributesEqual(Instruction* other) const { return true; }
+ virtual bool AttributesEqual(Instruction* other) const {
+ return kind() == other->AsSpecialParameter()->kind();
+ }
+ 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