Chromium Code Reviews| Index: runtime/vm/compiler.cc |
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc |
| index e084f1606dc6a3e64f38c5aee33a163dc219ad5a..b67e37462e5b9dc8d167d413d35a6c188670395c 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()); |
| + { |
| +#ifndef PRODUCT |
|
Cutch
2016/05/13 20:23:27
could use NOT_IN_PRODUCT()
rmacnak
2016/05/16 16:28:49
Done.
|
| + VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId); |
| + TimelineDurationScope tds(thread, Timeline::GetCompilerStream(), |
| + "CompileStaticInitializer"); |
| + if (tds.enabled()) { |
| + tds.SetNumArguments(1); |
| + tds.CopyArgument(0, "field", field.ToCString()); |
| + } |
| +#endif // !PRODUCT |
| + |
| + 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 { |