| Index: vm/intermediate_language.h
|
| ===================================================================
|
| --- vm/intermediate_language.h (revision 9340)
|
| +++ vm/intermediate_language.h (working copy)
|
| @@ -1713,6 +1713,7 @@
|
| // Forward declarations for Instruction classes.
|
| class BlockEntryInstr;
|
| class FlowGraphBuilder;
|
| +class Environment;
|
|
|
| #define FORWARD_DECLARATION(type) class type##Instr;
|
| FOR_EACH_INSTRUCTION(FORWARD_DECLARATION)
|
| @@ -1734,7 +1735,12 @@
|
|
|
| class Instruction : public ZoneAllocated {
|
| public:
|
| - Instruction() : cid_(-1), ic_data_(NULL), successor_(NULL), previous_(NULL) {
|
| + Instruction()
|
| + : cid_(-1),
|
| + ic_data_(NULL),
|
| + successor_(NULL),
|
| + previous_(NULL),
|
| + env_(NULL) {
|
| Isolate* isolate = Isolate::Current();
|
| cid_ = Computation::GetNextCid(isolate);
|
| ic_data_ = Computation::GetICDataForCid(cid_, isolate);
|
| @@ -1849,11 +1855,15 @@
|
| UNIMPLEMENTED();
|
| }
|
|
|
| + Environment* env() const { return env_; }
|
| + void set_env(Environment* env) { env_ = env; }
|
| +
|
| private:
|
| intptr_t cid_;
|
| ICData* ic_data_;
|
| Instruction* successor_;
|
| Instruction* previous_;
|
| + Environment* env_;
|
| DISALLOW_COPY_AND_ASSIGN(Instruction);
|
| };
|
|
|
| @@ -2360,6 +2370,26 @@
|
| #undef DECLARE_INSTRUCTION
|
|
|
|
|
| +class Environment : public ZoneAllocated {
|
| + public:
|
| + // Construct an environment by copying from an array of values.
|
| + explicit Environment(ZoneGrowableArray<Value*>* values)
|
| + : values_(values->length()) {
|
| + values_.AddArray(*values);
|
| + }
|
| +
|
| + const ZoneGrowableArray<Value*>& values() const {
|
| + return values_;
|
| + }
|
| +
|
| + void PrintTo(BufferFormatter* f) const;
|
| +
|
| + private:
|
| + ZoneGrowableArray<Value*> values_;
|
| + DISALLOW_COPY_AND_ASSIGN(Environment);
|
| +};
|
| +
|
| +
|
| // Visitor base class to visit each instruction and computation in a flow
|
| // graph as defined by a reversed list of basic blocks.
|
| class FlowGraphVisitor : public ValueObject {
|
|
|