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

Unified Diff: runtime/vm/parser.cc

Issue 678763004: Make CTX allocatable by the register allocator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 41279)
+++ runtime/vm/parser.cc (working copy)
@@ -127,6 +127,19 @@
}
+LocalVariable* ParsedFunction::EnsureSavedCurrentContext() {
+ if (!has_saved_current_context_var()) {
+ LocalVariable* temp = new(I) LocalVariable(
+ function().token_pos(),
+ Symbols::SavedCurrentContextVar(),
+ Type::ZoneHandle(I, Type::DynamicType()));
+ ASSERT(temp != NULL);
+ set_saved_current_context_var(temp);
+ }
+ return saved_current_context_var();
+}
+
+
void ParsedFunction::EnsureFinallyReturnTemp() {
if (!has_finally_return_temp_var()) {
LocalVariable* temp = new(I) LocalVariable(
@@ -345,6 +358,7 @@
if (FLAG_enable_type_checks) {
EnsureExpressionTemp();
}
+ EnsureSavedCurrentContext();
}
@@ -1387,7 +1401,6 @@
ASSERT(!owner.IsNull());
AstNode* result = NULL;
if (owner.IsSignatureClass() && name.Equals(Symbols::Call())) {
- EnsureSavedCurrentContext();
result = new ClosureCallNode(token_pos, getter_call, args);
} else {
result = BuildClosureCall(token_pos, getter_call, args);
@@ -8549,15 +8562,7 @@
void Parser::EnsureSavedCurrentContext() {
- // Used later by the flow_graph_builder to save current context.
- if (!parsed_function()->has_saved_current_context_var()) {
- LocalVariable* temp = new(I) LocalVariable(
- current_function().token_pos(),
- Symbols::SavedCurrentContextVar(),
- Type::ZoneHandle(I, Type::DynamicType()));
- ASSERT(temp != NULL);
- parsed_function()->set_saved_current_context_var(temp);
- }
+ parsed_function()->EnsureSavedCurrentContext();
}

Powered by Google App Engine
This is Rietveld 408576698