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

Unified Diff: runtime/vm/parser.cc

Issue 2411823003: VM support for running Kernel binaries. (Closed)
Patch Set: Address initial review 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
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index cb9c620101ec318ff2baffb48bf4f5a698cea49e..a7e057f6fe6c83c2bbc8b35dd5d95f844165aa3e 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/dil_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 {
}
+dil::ScopeBuildingResult* ParsedFunction::EnsureDilScopes() {
+ if (dil_scopes_ == NULL) {
+ dil::TreeNode* node = NULL;
+ if (function().dil_function() != kNoDilNode) {
+ node = reinterpret_cast<dil::TreeNode*>(function().dil_function());
+ }
+ dil::ScopeBuilder builder(this, node);
+ dil_scopes_ = builder.BuildScopes();
+ }
+ return dil_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 `dil -> flowgraph` we don't use the parser.
+ if (parent.dil_function() == kNoDilNode) {
+ 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 {
}
+dil::ScopeBuildingResult* ParsedFunction::EnsureDilScopes() {
+ UNREACHABLE();
+ return NULL;
+}
+
+
LocalVariable* ParsedFunction::EnsureExpressionTemp() {
UNREACHABLE();
return NULL;

Powered by Google App Engine
This is Rietveld 408576698