| Index: runtime/vm/compiler.cc
|
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
|
| index 1382d12f0b75c5380de034cf2f77da5233b64dd5..64bb5ad9e6026e5b509ec0e2e4868830bca252b0 100644
|
| --- a/runtime/vm/compiler.cc
|
| +++ b/runtime/vm/compiler.cc
|
| @@ -1568,19 +1568,31 @@ RawObject* Compiler::EvaluateStaticInitializer(const Field& field) {
|
| // it now, but don't bother remembering it because it won't be used again.
|
| ASSERT(!field.HasPrecompiledInitializer());
|
| Thread* const thread = Thread::Current();
|
| - StackZone zone(thread);
|
| - ParsedFunction* parsed_function =
|
| - Parser::ParseStaticFieldInitializer(field);
|
| -
|
| - parsed_function->AllocateVariables();
|
| - // Non-optimized code generator.
|
| - DartCompilationPipeline pipeline;
|
| - CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId);
|
| - helper.Compile(&pipeline);
|
| - const Function& initializer =
|
| - Function::Handle(parsed_function->function().raw());
|
| - Code::Handle(initializer.unoptimized_code()).set_var_descriptors(
|
| - Object::empty_var_descriptors());
|
| + Function& initializer = Function::Handle(thread->zone());
|
| + {
|
| + NOT_IN_PRODUCT(
|
| + VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
|
| + TimelineDurationScope tds(thread, Timeline::GetCompilerStream(),
|
| + "CompileStaticInitializer");
|
| + if (tds.enabled()) {
|
| + tds.SetNumArguments(1);
|
| + tds.CopyArgument(0, "field", field.ToCString());
|
| + }
|
| + )
|
| +
|
| + StackZone zone(thread);
|
| + ParsedFunction* parsed_function =
|
| + Parser::ParseStaticFieldInitializer(field);
|
| +
|
| + parsed_function->AllocateVariables();
|
| + // Non-optimized code generator.
|
| + DartCompilationPipeline pipeline;
|
| + CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId);
|
| + helper.Compile(&pipeline);
|
| + initializer = parsed_function->function().raw();
|
| + Code::Handle(initializer.unoptimized_code()).set_var_descriptors(
|
| + Object::empty_var_descriptors());
|
| + }
|
| // Invoke the function to evaluate the expression.
|
| return DartEntry::InvokeFunction(initializer, Object::empty_array());
|
| } else {
|
|
|