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

Unified Diff: runtime/vm/compiler.cc

Issue 11228022: Cache parsed functions when inlining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: virtual Created 8 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
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 8f0b6e3b302e6ae24cbccb5217acbd719b4a8759..7bdd054b34ec7914537ae1f73eb454d1079253b8 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -422,18 +422,18 @@ static RawError* CompileFunctionHelper(const Function& function,
}
if (setjmp(*jump.Set()) == 0) {
TIMERSCOPE(time_compilation);
- ParsedFunction parsed_function(function);
+ ParsedFunction* parsed_function = new ParsedFunction(function);
if (FLAG_trace_compiler) {
OS::Print("Compiling %sfunction: '%s' @ token %"Pd"\n",
(optimized ? "optimized " : ""),
function.ToFullyQualifiedCString(),
function.token_pos());
}
- Parser::ParseFunction(&parsed_function);
- parsed_function.AllocateVariables();
+ Parser::ParseFunction(parsed_function);
+ parsed_function->AllocateVariables();
const bool success =
- CompileParsedFunctionHelper(parsed_function, optimized);
+ CompileParsedFunctionHelper(*parsed_function, optimized);
if (optimized && !success) {
// Optimizer bailed out. Disable optimizations and to never try again.
if (FLAG_trace_compiler) {
@@ -565,16 +565,16 @@ RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) {
// We compile the function here, even though InvokeStatic() below
// would compile func automatically. We are checking fewer invariants
// here.
- ParsedFunction parsed_function(func);
- parsed_function.SetNodeSequence(fragment);
- parsed_function.set_default_parameter_values(Array::Handle());
- parsed_function.set_expression_temp_var(
+ ParsedFunction* parsed_function = new ParsedFunction(func);
+ parsed_function->SetNodeSequence(fragment);
+ parsed_function->set_default_parameter_values(Array::Handle());
+ parsed_function->set_expression_temp_var(
ParsedFunction::CreateExpressionTempVar(0));
- fragment->scope()->AddVariable(parsed_function.expression_temp_var());
- parsed_function.AllocateVariables();
+ fragment->scope()->AddVariable(parsed_function->expression_temp_var());
+ parsed_function->AllocateVariables();
// Non-optimized code generator.
- CompileParsedFunctionHelper(parsed_function, false);
+ CompileParsedFunctionHelper(*parsed_function, false);
GrowableArray<const Object*> arguments; // no arguments.
const Array& kNoArgumentNames = Array::Handle();
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698