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

Unified Diff: runtime/vm/flow_graph_builder.h

Issue 14942010: Eliminate temporary locals for some expressions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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.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
===================================================================
--- runtime/vm/flow_graph_builder.h (revision 23243)
+++ runtime/vm/flow_graph_builder.h (working copy)
@@ -140,6 +140,9 @@
bool IsInlining() const { return (exit_collector_ != NULL); }
InlineExitCollector* exit_collector() const { return exit_collector_; }
+ intptr_t args_pushed() const { return args_pushed_; }
+ void add_args_pushed(intptr_t n) { args_pushed_ += n; }
+
private:
intptr_t parameter_count() const {
return num_copied_params_ + num_non_copied_params_;
@@ -162,6 +165,9 @@
intptr_t try_index_;
GraphEntryInstr* graph_entry_;
+ // Outgoing argument stack height.
+ intptr_t args_pushed_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder);
};
@@ -318,6 +324,10 @@
temp_index_ -= n;
}
+ // Returns a local variable index for a temporary local that is
+ // on top of the current expression stack.
+ intptr_t GetCurrentTempLocalIndex() const;
+
Value* BuildObjectAllocation(ConstructorCallNode* node);
void BuildConstructorCall(ConstructorCallNode* node,
PushArgumentInstr* alloc_value);
@@ -346,21 +356,23 @@
Value* BuildNullValue();
+ // Returns true if the run-time type check can be eliminated.
+ bool CanSkipTypeCheck(intptr_t token_pos,
+ Value* value,
+ const AbstractType& dst_type,
+ const String& dst_name);
+
+ void BuildLetTempExpressions(LetNode* node);
+
private:
+ friend class TempLocalScope; // For ReturnDefinition.
+
// Specify a definition of the final result. Adds the definition to
// the graph, but normally overridden in subclasses.
virtual void ReturnDefinition(Definition* definition) {
Do(definition);
}
- protected:
- // Returns true if the run-time type check can be eliminated.
- bool CanSkipTypeCheck(intptr_t token_pos,
- Value* value,
- const AbstractType& dst_type,
- const String& dst_name);
-
- private:
// Shared global state.
FlowGraphBuilder* owner_;
@@ -401,6 +413,7 @@
virtual void VisitStoreStaticFieldNode(StoreStaticFieldNode* node);
virtual void VisitTypeNode(TypeNode* node);
virtual void VisitCommaNode(CommaNode* node);
+ virtual void VisitLetNode(LetNode* node);
Value* value() const { return value_; }
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698