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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10857056: Replaced Value by Definition in the renaming environment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Patch title. 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/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 06c6088d33d717e0b1a8c2b8b460d3d45478c16d..20ac7f89f69e30d6eb714619afdcbc90e002ea18 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1439,6 +1439,27 @@ void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+// Helper to either use the constant value of a defintion or the defintion.
+static Value* UseDefinition(Definition* defn) {
+ if (defn->IsBind() && defn->AsBind()->computation()->IsConstant()) {
+ return defn->AsBind()->computation()->AsConstant();
+ } else {
+ return new UseVal(defn);
+ }
+}
+
+
+Environment::Environment(const GrowableArray<Definition*>& definitions,
+ intptr_t fixed_parameter_count)
+ : values_(definitions.length()),
+ locations_(NULL),
+ fixed_parameter_count_(fixed_parameter_count) {
+ for (intptr_t i = 0; i < definitions.length(); ++i) {
+ values_.Add(UseDefinition(definitions[i]));
+ }
+}
+
+
#undef __
} // namespace dart
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698