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

Unified Diff: runtime/vm/compiler.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 | « no previous file | runtime/vm/kernel.h » ('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 545e001f4993f5b184bf9e2baf00a47ab0dcf8b2..5c5628f11e532525bf4152aa98a978862a8d2aab 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1714,29 +1714,7 @@ RawObject* Compiler::EvaluateStaticInitializer(const Field& field) {
// Create a one-time-use function to evaluate the initializer and invoke
// it immediately.
if (field.kernel_field() != NULL) {
- // kImplicitStaticFinalGetter is used for both implicit static getters
- // and static initializers. The Kernel graph builder will tell the
- // difference by pattern matching on the name.
- const String& name = String::Handle(
- zone, Symbols::FromConcat(thread, Symbols::InitPrefix(),
- String::Handle(zone, field.name())));
- const Script& script = Script::Handle(zone, field.Script());
- Object& owner = Object::Handle(zone, field.Owner());
- owner = PatchClass::New(Class::Cast(owner), script);
- const Function& function = Function::ZoneHandle(
- zone, Function::New(name, RawFunction::kImplicitStaticFinalGetter,
- true, // is_static
- false, // is_const
- false, // is_abstract
- false, // is_external
- false, // is_native
- owner, TokenPosition::kNoSource));
- function.set_kernel_function(field.kernel_field());
- function.set_result_type(AbstractType::Handle(zone, field.type()));
- function.set_is_reflectable(false);
- function.set_is_debuggable(false);
- function.set_is_inlinable(false);
- parsed_function = new (zone) ParsedFunction(thread, function);
+ parsed_function = kernel::ParseStaticFieldInitializer(zone, field);
} else {
parsed_function = Parser::ParseStaticFieldInitializer(field);
parsed_function->AllocateVariables();
« no previous file with comments | « no previous file | runtime/vm/kernel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698