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

Side by Side Diff: runtime/vm/compiler.cc

Issue 1491503003: VM: In CompileAll, don't iterate collected closures for every class (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years 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 | « no previous file | runtime/vm/flow_graph_optimizer.h » ('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 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 !func.is_abstract() && 1383 !func.is_abstract() &&
1384 !func.IsRedirectingFactory()) { 1384 !func.IsRedirectingFactory()) {
1385 error = CompileFunction(thread, func); 1385 error = CompileFunction(thread, func);
1386 if (!error.IsNull()) { 1386 if (!error.IsNull()) {
1387 return error.raw(); 1387 return error.raw();
1388 } 1388 }
1389 func.ClearICDataArray(); 1389 func.ClearICDataArray();
1390 func.ClearCode(); 1390 func.ClearCode();
1391 } 1391 }
1392 } 1392 }
1393
1394 // Inner functions get added to the closures array. As part of compilation
1395 // more closures can be added to the end of the array. Compile all the
1396 // closures until we have reached the end of the "worklist".
1397 const GrowableObjectArray& closures =
1398 GrowableObjectArray::Handle(zone,
1399 Isolate::Current()->object_store()->closure_functions());
1400 for (int i = 0; i < closures.Length(); i++) {
1401 func ^= closures.At(i);
1402 if ((func.Owner() == cls.raw()) && !func.HasCode()) {
1403 error = CompileFunction(thread, func);
1404 if (!error.IsNull()) {
1405 return error.raw();
1406 }
1407 func.ClearICDataArray();
1408 func.ClearCode();
1409 }
1410 }
1411 return error.raw(); 1393 return error.raw();
1412 } 1394 }
1413 1395
1414 1396
1415 void Compiler::CompileStaticInitializer(const Field& field) { 1397 void Compiler::CompileStaticInitializer(const Field& field) {
1416 ASSERT(field.is_static()); 1398 ASSERT(field.is_static());
1417 if (field.HasPrecompiledInitializer()) { 1399 if (field.HasPrecompiledInitializer()) {
1418 // TODO(rmacnak): Investigate why this happens for _enum_names. 1400 // TODO(rmacnak): Investigate why this happens for _enum_names.
1419 OS::Print("Warning: Ignoring repeated request for initializer for %s\n", 1401 OS::Print("Warning: Ignoring repeated request for initializer for %s\n",
1420 field.ToCString()); 1402 field.ToCString());
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 } 1877 }
1896 1878
1897 1879
1898 void BackgroundCompiler::EnsureInit(Thread* thread) { 1880 void BackgroundCompiler::EnsureInit(Thread* thread) {
1899 UNREACHABLE(); 1881 UNREACHABLE();
1900 } 1882 }
1901 1883
1902 #endif // DART_PRECOMPILED 1884 #endif // DART_PRECOMPILED
1903 1885
1904 } // namespace dart 1886 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698