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

Unified Diff: vm/intermediate_language.h

Issue 10696090: Add deoptimization environments to instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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
« no previous file with comments | « vm/il_printer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « vm/il_printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698