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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2786083002: Read platform.dill in the VM. (Closed)
Patch Set: Incorporate review comments and merge. Created 3 years, 8 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/kernel_reader.cc ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index 140b56cbfdb16b7adfd50b4d95e1b72823fbea04..8a2bc7f64a9763707e51194007271a7031a2fcec 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -4925,7 +4925,35 @@ void FlowGraphBuilder::VisitVariableSet(VariableSet* node) {
void FlowGraphBuilder::VisitStaticGet(StaticGet* node) {
- fragment_ = streaming_flow_graph_builder_->BuildAt(node->kernel_offset());
+ if (node->kernel_offset() != -1) {
+ fragment_ = streaming_flow_graph_builder_->BuildAt(node->kernel_offset());
+ return;
+ }
+ // A StaticGet will always have a kernel_offset, except for the StaticGet that
+ // was manually created for _getMainClosure in dart:_builtin. Compile that
+ // one specially here.
+ const dart::Library& builtin =
+ dart::Library::Handle(Z, I->object_store()->builtin_library());
+ const Object& main =
+ Object::Handle(Z, builtin.LookupObjectAllowPrivate(dart::String::Handle(
+ Z, dart::String::New("main"))));
+ if (main.IsField()) {
+ UNIMPLEMENTED();
+ } else if (main.IsFunction()) {
+ const Function& function = Function::Cast(main);
+ if (function.kind() == RawFunction::kRegularFunction) {
+ const Function& closure_function =
+ Function::Handle(Z, function.ImplicitClosureFunction());
+ closure_function.set_kernel_function(function.kernel_function());
+ const Instance& closure =
+ Instance::ZoneHandle(Z, closure_function.ImplicitStaticClosure());
+ fragment_ = Constant(closure);
+ } else {
+ UNIMPLEMENTED();
+ }
+ } else {
+ UNIMPLEMENTED();
+ }
}
« no previous file with comments | « runtime/vm/kernel_reader.cc ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698