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

Unified Diff: runtime/vm/kernel.cc

Issue 3010543002: Rename the class "KernelReader" to "KernelLoader". (Closed)
Patch Set: Fix alphabetical order in vm_sources.gni. Created 3 years, 4 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.h ('k') | runtime/vm/kernel_binary_flowgraph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel.cc
diff --git a/runtime/vm/kernel.cc b/runtime/vm/kernel.cc
index 6e718444c48c1eeba3afa5021c9ee6ef1e48aab0..45d6e94d4ed2e14158b853baa4714c6d195f73a8 100644
--- a/runtime/vm/kernel.cc
+++ b/runtime/vm/kernel.cc
@@ -3,11 +3,32 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/kernel.h"
+#include "vm/kernel_binary_flowgraph.h"
#if !defined(DART_PRECOMPILED_RUNTIME)
namespace dart {
-namespace kernel {} // namespace kernel
+namespace kernel {
+
+bool FieldHasFunctionLiteralInitializer(const Field& field,
+ TokenPosition* start,
+ TokenPosition* end) {
+ Zone* zone = Thread::Current()->zone();
+ const Script& script = Script::Handle(zone, field.Script());
+
+ TranslationHelper translation_helper(
+ Thread::Current(), script.kernel_string_offsets(),
+ script.kernel_string_data(), script.kernel_canonical_names());
+
+ StreamingFlowGraphBuilder builder(
+ &translation_helper, zone, field.kernel_offset(),
+ TypedData::Handle(zone, field.kernel_data()));
+ kernel::FieldHelper field_helper(&builder);
+ field_helper.ReadUntilExcluding(kernel::FieldHelper::kEnd, true);
+ return field_helper.FieldHasFunctionLiteralInitializer(start, end);
+}
+
+} // namespace kernel
} // namespace dart
#endif // !defined(DART_PRECOMPILED_RUNTIME)
« no previous file with comments | « runtime/vm/kernel.h ('k') | runtime/vm/kernel_binary_flowgraph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698