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

Unified Diff: runtime/vm/parser.cc

Issue 1436243005: Collect closure functions in isolate (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index ee1b60fe8313faa133a770b14f72a20f3058d33f..b0cb36bceba4b90065812b03714f678d95d7cbac 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -6571,7 +6571,7 @@ RawFunction* Parser::OpenSyncGeneratorFunction(intptr_t func_pos) {
// function has already been created by a previous
// compilation.
const Function& found_func = Function::Handle(
- Z, current_class().LookupClosureFunction(func_pos));
+ Z, I->LookupClosureFunction(script_, func_pos));
if (!found_func.IsNull() &&
(found_func.token_pos() == func_pos) &&
(found_func.script() == innermost_function().script()) &&
@@ -6712,7 +6712,7 @@ RawFunction* Parser::OpenAsyncFunction(intptr_t async_func_pos) {
// this async function has already been created by a previous
// compilation of this function.
const Function& found_func = Function::Handle(
- Z, current_class().LookupClosureFunction(async_func_pos));
+ Z, I->LookupClosureFunction(script_, async_func_pos));
if (!found_func.IsNull() &&
(found_func.token_pos() == async_func_pos) &&
(found_func.script() == innermost_function().script()) &&
@@ -6848,7 +6848,7 @@ RawFunction* Parser::OpenAsyncGeneratorFunction(intptr_t async_func_pos) {
// this async generator has already been created by a previous
// compilation of this function.
const Function& found_func = Function::Handle(
- Z, current_class().LookupClosureFunction(async_func_pos));
+ Z, I->LookupClosureFunction(script_, async_func_pos));
if (!found_func.IsNull() &&
(found_func.token_pos() == async_func_pos) &&
(found_func.script() == innermost_function().script()) &&
@@ -7619,7 +7619,7 @@ AstNode* Parser::ParseFunctionStatement(bool is_literal) {
// TODO(hausner): There could be two different closures at the given
// function_pos, one enclosed in a closurized function and one enclosed in the
// non-closurized version of this same function.
- function = current_class().LookupClosureFunction(function_pos);
+ function = I->LookupClosureFunction(script_, function_pos);
if (function.IsNull() || (function.token_pos() != function_pos) ||
(function.parent_function() != innermost_function().raw())) {
// The function will be registered in the lookup table by the
@@ -13121,7 +13121,7 @@ RawFunction* Parser::BuildConstructorClosureFunction(const Function& ctr,
intptr_t token_pos) {
ASSERT(ctr.kind() == RawFunction::kConstructor);
Function& closure = Function::Handle(Z);
- closure = current_class().LookupClosureFunction(token_pos);
+ closure = I->LookupClosureFunction(script_, token_pos);
if (!closure.IsNull()) {
ASSERT(closure.IsConstructorClosureFunction());
return closure.raw();

Powered by Google App Engine
This is Rietveld 408576698