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

Unified Diff: runtime/vm/flow_graph_compiler.h

Issue 10913031: Split deopt-after and deopt-before handling: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « runtime/vm/deopt_instructions.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.h
===================================================================
--- runtime/vm/flow_graph_compiler.h (revision 11693)
+++ runtime/vm/flow_graph_compiler.h (working copy)
@@ -16,9 +16,8 @@
// Forward declarations.
class FlowGraphCompiler;
-class DeoptimizationStub;
+class DeoptInfoBuilder;
-
class ParallelMoveResolver : public ValueObject {
public:
explicit ParallelMoveResolver(FlowGraphCompiler* compiler);
@@ -58,33 +57,62 @@
};
-class DeoptimizationStub : public ZoneAllocated {
+// Used for describing a deoptimization point after call (lazy deoptimziation).
regis 2012/08/31 20:08:50 typo: deoptimziation
srdjan 2012/08/31 20:18:43 Done.
+// For deoptimization before instruction use class CompilerDeoptInfoWithStub.
+class CompilerDeoptInfo : public ZoneAllocated {
public:
- DeoptimizationStub(intptr_t deopt_id,
- DeoptReasonId reason)
- : deopt_id_(deopt_id),
- reason_(reason),
- deoptimization_env_(NULL),
- entry_label_() {}
+ CompilerDeoptInfo(intptr_t deopt_id, DeoptReasonId reason)
+ : deopt_id_(deopt_id), reason_(reason), deoptimization_env_(NULL) {}
- Label* entry_label() { return &entry_label_; }
-
- // Implementation is in architecture specific file.
- void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix);
-
void set_deoptimization_env(Environment* env) {
deoptimization_env_ = env;
}
RawDeoptInfo* CreateDeoptInfo(FlowGraphCompiler* compiler);
+ // No code needs to be generated.
+ virtual void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix) {}
+
+ // Builds deopt-after continuation point.
+ virtual void BuildReturnAddress(DeoptInfoBuilder* builder,
+ const Function& function,
+ intptr_t slot_ix);
+
+ intptr_t deopt_id() const { return deopt_id_; }
+ DeoptReasonId reason() const { return reason_; }
+ const Environment* deoptimization_env() const { return deoptimization_env_; }
+
private:
const intptr_t deopt_id_;
const DeoptReasonId reason_;
const Environment* deoptimization_env_;
+
+ DISALLOW_COPY_AND_ASSIGN(CompilerDeoptInfo);
+};
+
+
+class CompilerDeoptInfoWithStub : public CompilerDeoptInfo {
+ public:
+ CompilerDeoptInfoWithStub(intptr_t deopt_id,
+ DeoptReasonId reason)
+ : CompilerDeoptInfo(deopt_id, reason), entry_label_() {
+ ASSERT(reason != kDeoptAtCall);
+ }
+
+ Label* entry_label() { return &entry_label_; }
+
+ // Implementation is in architecture specific file.
+ virtual void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix);
+
+ // Builds deopt-before continuation point.
+ virtual void BuildReturnAddress(DeoptInfoBuilder* builder,
+ const Function& function,
+ intptr_t slot_ix);
+
+ private:
Label entry_label_;
- DISALLOW_COPY_AND_ASSIGN(DeoptimizationStub);
+ DISALLOW_COPY_AND_ASSIGN(CompilerDeoptInfoWithStub);
};
« no previous file with comments | « runtime/vm/deopt_instructions.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698