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

Unified Diff: runtime/vm/flow_graph_builder.h

Issue 17233003: Reapply "Initial implementation of on-stack replacement (OSR)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.h
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 3a1c685086d832679beec65c2f7ac467612388ad..2ae1401abc08ec4d64ad838db0b2845bdfd06555 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -100,10 +100,12 @@ class InlineExitCollector: public ZoneAllocated {
// Build a flow graph from a parsed function's AST.
class FlowGraphBuilder: public ValueObject {
public:
- // The inlining context is NULL if not inlining.
+ // The inlining context is NULL if not inlining. The osr_id is the deopt
+ // id of the OSR entry or Isolate::kNoDeoptId if not compiling for OSR.
FlowGraphBuilder(ParsedFunction* parsed_function,
const Array& ic_data_array,
- InlineExitCollector* exit_collector);
+ InlineExitCollector* exit_collector,
+ intptr_t osr_id);
FlowGraph* BuildGraph();
@@ -143,6 +145,10 @@ class FlowGraphBuilder: public ValueObject {
intptr_t args_pushed() const { return args_pushed_; }
void add_args_pushed(intptr_t n) { args_pushed_ += n; }
+ // When compiling for OSR, remove blocks that are not reachable from the
+ // OSR entry point.
+ void PruneUnreachable();
+
private:
intptr_t parameter_count() const {
return num_copied_params_ + num_non_copied_params_;
@@ -168,6 +174,10 @@ class FlowGraphBuilder: public ValueObject {
// Outgoing argument stack height.
intptr_t args_pushed_;
+ // The deopt id of the OSR entry or Isolate::kNoDeoptId if not compiling
+ // for OSR.
+ const intptr_t osr_id_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder);
};
@@ -229,7 +239,8 @@ class EffectGraphVisitor : public AstNodeVisitor {
// Append a 'while loop' test and back edge to this graph, depending on
// which parts are reachable. Afterward, the graph exit is the false
// successor of the loop condition.
- void TieLoop(const TestGraphVisitor& test_fragment,
+ void TieLoop(intptr_t token_pos,
+ const TestGraphVisitor& test_fragment,
const EffectGraphVisitor& body_fragment);
// Wraps a value in a push-argument instruction and adds the result to the
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698