Chromium Code Reviews| 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. |
|
Vyacheslav Egorov (Google)
2017/07/03 16:15:43
"normally held in a register" part of the comment
regis
2017/07/05 18:41:30
Updated comment.
|
| +// This is a computation, not a value, because it's mutable. |
|
Vyacheslav Egorov (Google)
2017/07/03 16:15:43
"This is computation, not a value" is an obsolete
regis
2017/07/05 18:41:29
Removed comment.
|
| +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; } |
|
Vyacheslav Egorov (Google)
2017/07/03 16:15:43
this needs to be:
return kind() == other->AsSpec
regis
2017/07/05 18:41:30
Done.
|
| + SpecialParameterKind kind() const { return kind_; } |
| private: |
| - DISALLOW_COPY_AND_ASSIGN(CurrentContextInstr); |
| + const SpecialParameterKind kind_; |
| + DISALLOW_COPY_AND_ASSIGN(SpecialParameterInstr); |
| }; |