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

Unified Diff: runtime/vm/precompiler.cc

Issue 2515763002: VM: [Kernel] Don't use Parser::ParseStaticFieldInitializer for fields that come from Kernel. (Closed)
Patch Set: Done Created 4 years, 1 month 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/kernel_reader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index 5c504582ad160bc9a5eb2a055fed061e7c46b561..8d72d929abe6c6db84d12611f4966a5a61782a1d 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -1118,12 +1118,20 @@ RawFunction* Precompiler::CompileStaticInitializer(const Field& field,
bool compute_type) {
ASSERT(field.is_static());
Thread* thread = Thread::Current();
- StackZone zone(thread);
+ StackZone stack_zone(thread);
+ Zone* zone = stack_zone.GetZone();
+
+ ParsedFunction* parsed_function;
+ // Check if this field is comming from the Kernel binary.
+ if (field.kernel_field() != NULL) {
+ parsed_function = kernel::ParseStaticFieldInitializer(zone, field);
+ } else {
+ parsed_function = Parser::ParseStaticFieldInitializer(field);
+ parsed_function->AllocateVariables();
+ }
- ParsedFunction* parsed_function = Parser::ParseStaticFieldInitializer(field);
- parsed_function->AllocateVariables();
- DartPrecompilationPipeline pipeline(zone.GetZone());
+ DartPrecompilationPipeline pipeline(zone);
PrecompileParsedFunctionHelper helper(/* precompiler = */ NULL,
parsed_function,
/* optimized = */ true);
« no previous file with comments | « runtime/vm/kernel_reader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698