| Index: runtime/vm/intermediate_language.h
|
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
|
| index edd92bbaf56d7c49a322af6d263ebc57f23178df..f50e868b684ee84f0c4205ed518fe92404ded09c 100644
|
| --- a/runtime/vm/intermediate_language.h
|
| +++ b/runtime/vm/intermediate_language.h
|
| @@ -13,6 +13,8 @@
|
| namespace dart {
|
|
|
| class LocalVariable;
|
| +class ConstantValue;
|
| +class TempValue;
|
|
|
| // Computations and values.
|
| //
|
| @@ -42,6 +44,12 @@ class Value : public Computation {
|
| public:
|
| Value() { }
|
|
|
| + virtual TempValue* AsTemp() { return NULL; }
|
| + virtual ConstantValue* AsConstant() { return NULL; }
|
| +
|
| + bool IsTemp() { return AsTemp() != NULL; }
|
| + bool IsConstant() { return AsConstant() != NULL; }
|
| +
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(Value);
|
| };
|
| @@ -126,6 +134,7 @@ class TempValue : public Value {
|
| public:
|
| explicit TempValue(intptr_t index) : index_(index) { }
|
|
|
| + virtual TempValue* AsTemp() { return this; }
|
| virtual void Print() const;
|
|
|
| private:
|
| @@ -139,8 +148,11 @@ class ConstantValue: public Value {
|
| public:
|
| explicit ConstantValue(const Instance& instance) : instance_(instance) { }
|
|
|
| + virtual ConstantValue* AsConstant() { return this; }
|
| virtual void Print() const;
|
|
|
| + const Instance& instance() const { return instance_; }
|
| +
|
| private:
|
| const Instance& instance_;
|
|
|
| @@ -380,7 +392,7 @@ class InstructionVisitor {
|
|
|
| // Visit each block in the array list in reverse, and for each block its
|
| // instructions in order from the block entry to exit.
|
| - void VisitBlocks(const GrowableArray<BlockEntryInstr*>& block_order);
|
| + virtual void VisitBlocks(const GrowableArray<BlockEntryInstr*>& block_order);
|
|
|
| #define DECLARE_VISIT(type) \
|
| virtual void Visit##type(type##Instr* instr) { }
|
|
|