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

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

Issue 1544583002: For background compilation we copy ICData so that it is immutable during comnpilation. However, we … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: l 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
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 24 matching lines...) Expand all
35 #include "vm/scanner.h" 35 #include "vm/scanner.h"
36 #include "vm/symbols.h" 36 #include "vm/symbols.h"
37 #include "vm/tags.h" 37 #include "vm/tags.h"
38 #include "vm/thread_registry.h" 38 #include "vm/thread_registry.h"
39 #include "vm/timer.h" 39 #include "vm/timer.h"
40 40
41 namespace dart { 41 namespace dart {
42 42
43 DEFINE_FLAG(bool, allocation_sinking, true, 43 DEFINE_FLAG(bool, allocation_sinking, true,
44 "Attempt to sink temporary allocations to side exits"); 44 "Attempt to sink temporary allocations to side exits");
45 DEFINE_FLAG(bool, always_clone_ic_descriptor, false, "Testing flag");
zra 2015/12/21 19:31:47 Did you mean to leave this in? If so, is it possib
srdjan 2015/12/21 20:22:49 Removing it, once all platforms pass.
45 DEFINE_FLAG(bool, common_subexpression_elimination, true, 46 DEFINE_FLAG(bool, common_subexpression_elimination, true,
46 "Do common subexpression elimination."); 47 "Do common subexpression elimination.");
47 DEFINE_FLAG(bool, constant_propagation, true, 48 DEFINE_FLAG(bool, constant_propagation, true,
48 "Do conditional constant propagation/unreachable code elimination."); 49 "Do conditional constant propagation/unreachable code elimination.");
49 DEFINE_FLAG(int, deoptimization_counter_threshold, 16, 50 DEFINE_FLAG(int, deoptimization_counter_threshold, 16,
50 "How many times we allow deoptimization before we disallow optimization."); 51 "How many times we allow deoptimization before we disallow optimization.");
51 DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code."); 52 DEFINE_FLAG(bool, disassemble, false, "Disassemble dart code.");
52 DEFINE_FLAG(bool, disassemble_optimized, false, "Disassemble optimized code."); 53 DEFINE_FLAG(bool, disassemble_optimized, false, "Disassemble optimized code.");
53 DEFINE_FLAG(bool, loop_invariant_code_motion, true, 54 DEFINE_FLAG(bool, loop_invariant_code_motion, true,
54 "Do loop invariant code motion."); 55 "Do loop invariant code motion.");
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 ZoneGrowableArray<const ICData*>* ic_data_array = 455 ZoneGrowableArray<const ICData*>* ic_data_array =
455 new(zone) ZoneGrowableArray<const ICData*>(); 456 new(zone) ZoneGrowableArray<const ICData*>();
456 if (optimized) { 457 if (optimized) {
457 // Extract type feedback before the graph is built, as the graph 458 // Extract type feedback before the graph is built, as the graph
458 // builder uses it to attach it to nodes. 459 // builder uses it to attach it to nodes.
459 ASSERT(function.deoptimization_counter() < 460 ASSERT(function.deoptimization_counter() <
460 FLAG_deoptimization_counter_threshold); 461 FLAG_deoptimization_counter_threshold);
461 462
462 // 'Freeze' ICData in background compilation so that it does not 463 // 'Freeze' ICData in background compilation so that it does not
463 // change while compiling. 464 // change while compiling.
464 const bool clone_descriptors = Compiler::IsBackgroundCompilation(); 465 const bool clone_descriptors = FLAG_always_clone_ic_descriptor ||
466 Compiler::IsBackgroundCompilation();
465 function.RestoreICDataMap(ic_data_array, clone_descriptors); 467 function.RestoreICDataMap(ic_data_array, clone_descriptors);
466 468
467 if (FLAG_print_ic_data_map) { 469 if (FLAG_print_ic_data_map) {
468 for (intptr_t i = 0; i < ic_data_array->length(); i++) { 470 for (intptr_t i = 0; i < ic_data_array->length(); i++) {
469 if ((*ic_data_array)[i] != NULL) { 471 if ((*ic_data_array)[i] != NULL) {
470 THR_Print("%" Pd " ", i); 472 THR_Print("%" Pd " ", i);
471 FlowGraphPrinter::PrintICData(*(*ic_data_array)[i]); 473 FlowGraphPrinter::PrintICData(*(*ic_data_array)[i]);
472 } 474 }
473 } 475 }
474 } 476 }
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 } 1979 }
1978 1980
1979 1981
1980 void BackgroundCompiler::EnsureInit(Thread* thread) { 1982 void BackgroundCompiler::EnsureInit(Thread* thread) {
1981 UNREACHABLE(); 1983 UNREACHABLE();
1982 } 1984 }
1983 1985
1984 #endif // DART_PRECOMPILED 1986 #endif // DART_PRECOMPILED
1985 1987
1986 } // namespace dart 1988 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698