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

Unified Diff: runtime/vm/parser.cc

Issue 2411823003: VM support for running Kernel binaries. (Closed)
Patch Set: Address comments Created 4 years, 2 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/parser.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index cb9c620101ec318ff2baffb48bf4f5a698cea49e..3d211a3891386329e687c8cae843c59e2a90a746 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -16,6 +16,7 @@
#include "vm/compiler_stats.h"
#include "vm/dart_api_impl.h"
#include "vm/dart_entry.h"
+#include "vm/kernel_to_il.h"
#include "vm/growable_array.h"
#include "vm/handles.h"
#include "vm/hash_table.h"
@@ -225,6 +226,19 @@ void ParsedFunction::Bailout(const char* origin, const char* reason) const {
}
+kernel::ScopeBuildingResult* ParsedFunction::EnsureKernelScopes() {
+ if (kernel_scopes_ == NULL) {
+ kernel::TreeNode* node = NULL;
+ if (function().kernel_function() != NULL) {
+ node = static_cast<kernel::TreeNode*>(function().kernel_function());
+ }
+ kernel::ScopeBuilder builder(this, node);
+ kernel_scopes_ = builder.BuildScopes();
+ }
+ return kernel_scopes_;
+}
+
+
LocalVariable* ParsedFunction::EnsureExpressionTemp() {
if (!has_expression_temp_var()) {
LocalVariable* temp =
@@ -1592,10 +1606,13 @@ SequenceNode* Parser::ParseImplicitClosure(const Function& func) {
&Object::dynamic_type());
ASSERT(func.num_fixed_parameters() == 2); // closure, value.
} else if (!parent.IsGetterFunction() && !parent.IsImplicitGetterFunction()) {
- const bool allow_explicit_default_values = true;
- SkipFunctionPreamble();
- ParseFormalParameterList(allow_explicit_default_values, false, &params);
- SetupDefaultsForOptionalParams(params);
+ // NOTE: For the `kernel -> flowgraph` we don't use the parser.
+ if (parent.kernel_function() == NULL) {
+ const bool allow_explicit_default_values = true;
+ SkipFunctionPreamble();
+ ParseFormalParameterList(allow_explicit_default_values, false, &params);
+ SetupDefaultsForOptionalParams(params);
+ }
}
// Populate function scope with the formal parameters.
@@ -15015,6 +15032,12 @@ void ParsedFunction::AddToGuardedFields(const Field* field) const {
}
+kernel::ScopeBuildingResult* ParsedFunction::EnsureKernelScopes() {
+ UNREACHABLE();
+ return NULL;
+}
+
+
LocalVariable* ParsedFunction::EnsureExpressionTemp() {
UNREACHABLE();
return NULL;
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698