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

Side by Side Diff: runtime/vm/compiler.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 unified diff | Download patch
« no previous file with comments | « runtime/observatory/tests/service/coverage_test.dart ('k') | runtime/vm/compiler_stats.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 !func.is_abstract() && 1326 !func.is_abstract() &&
1327 !func.IsRedirectingFactory()) { 1327 !func.IsRedirectingFactory()) {
1328 error = CompileFunction(thread, func); 1328 error = CompileFunction(thread, func);
1329 if (!error.IsNull()) { 1329 if (!error.IsNull()) {
1330 return error.raw(); 1330 return error.raw();
1331 } 1331 }
1332 func.ClearICDataArray(); 1332 func.ClearICDataArray();
1333 func.ClearCode(); 1333 func.ClearCode();
1334 } 1334 }
1335 } 1335 }
1336
1336 // Inner functions get added to the closures array. As part of compilation 1337 // Inner functions get added to the closures array. As part of compilation
1337 // more closures can be added to the end of the array. Compile all the 1338 // more closures can be added to the end of the array. Compile all the
1338 // closures until we have reached the end of the "worklist". 1339 // closures until we have reached the end of the "worklist".
1339 GrowableObjectArray& closures = 1340 const GrowableObjectArray& closures =
1340 GrowableObjectArray::Handle(zone, cls.closures()); 1341 GrowableObjectArray::Handle(zone,
1341 if (!closures.IsNull()) { 1342 Isolate::Current()->object_store()->closure_functions());
1342 for (int i = 0; i < closures.Length(); i++) { 1343 for (int i = 0; i < closures.Length(); i++) {
1343 func ^= closures.At(i); 1344 func ^= closures.At(i);
1344 if (!func.HasCode()) { 1345 if ((func.Owner() == cls.raw()) && !func.HasCode()) {
1345 error = CompileFunction(thread, func); 1346 error = CompileFunction(thread, func);
1346 if (!error.IsNull()) { 1347 if (!error.IsNull()) {
1347 return error.raw(); 1348 return error.raw();
1348 }
1349 func.ClearICDataArray();
1350 func.ClearCode();
1351 } 1349 }
1350 func.ClearICDataArray();
1351 func.ClearCode();
1352 } 1352 }
1353 } 1353 }
1354 return error.raw(); 1354 return error.raw();
1355 } 1355 }
1356 1356
1357 1357
1358 void Compiler::CompileStaticInitializer(const Field& field) { 1358 void Compiler::CompileStaticInitializer(const Field& field) {
1359 ASSERT(field.is_static()); 1359 ASSERT(field.is_static());
1360 if (field.HasPrecompiledInitializer()) { 1360 if (field.HasPrecompiledInitializer()) {
1361 // TODO(rmacnak): Investigate why this happens for _enum_names. 1361 // TODO(rmacnak): Investigate why this happens for _enum_names.
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 isolate->set_background_compiler(task); 1965 isolate->set_background_compiler(task);
1966 start_task = true; 1966 start_task = true;
1967 } 1967 }
1968 } 1968 }
1969 if (start_task) { 1969 if (start_task) {
1970 Dart::thread_pool()->Run(isolate->background_compiler()); 1970 Dart::thread_pool()->Run(isolate->background_compiler());
1971 } 1971 }
1972 } 1972 }
1973 1973
1974 } // namespace dart 1974 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/coverage_test.dart ('k') | runtime/vm/compiler_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698