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

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

Issue 1759913002: Make precompiler work with product mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 DECLARE_FLAG(bool, trace_compiler); 52 DECLARE_FLAG(bool, trace_compiler);
53 DECLARE_FLAG(int, inlining_hotness); 53 DECLARE_FLAG(int, inlining_hotness);
54 DECLARE_FLAG(int, inlining_size_threshold); 54 DECLARE_FLAG(int, inlining_size_threshold);
55 DECLARE_FLAG(int, inlining_callee_size_threshold); 55 DECLARE_FLAG(int, inlining_callee_size_threshold);
56 DECLARE_FLAG(int, inline_getters_setters_smaller_than); 56 DECLARE_FLAG(int, inline_getters_setters_smaller_than);
57 DECLARE_FLAG(int, inlining_depth_threshold); 57 DECLARE_FLAG(int, inlining_depth_threshold);
58 DECLARE_FLAG(int, inlining_caller_size_threshold); 58 DECLARE_FLAG(int, inlining_caller_size_threshold);
59 DECLARE_FLAG(int, inlining_constant_arguments_max_size_threshold); 59 DECLARE_FLAG(int, inlining_constant_arguments_max_size_threshold);
60 DECLARE_FLAG(int, inlining_constant_arguments_min_size_threshold); 60 DECLARE_FLAG(int, inlining_constant_arguments_min_size_threshold);
61 61
62 #if !defined(DART_PRECOMPILED_RUNTIME)
63 static void PrecompilationModeHandler(bool value) { 62 static void PrecompilationModeHandler(bool value) {
64 if (value) { 63 if (value) {
65 #if defined(TARGET_ARCH_IA32) 64 #if defined(TARGET_ARCH_IA32)
66 FATAL("Precompilation not supported on IA32"); 65 FATAL("Precompilation not supported on IA32");
67 #endif 66 #endif
68 67
69 #if defined(PRODUCT)
70 FATAL("dart_noopt not supported in product mode");
71 #else
72 FLAG_support_debugger = false;
73
74 // Flags affecting compilation only: 68 // Flags affecting compilation only:
75 // There is no counter feedback in precompilation, so ignore the counter 69 // There is no counter feedback in precompilation, so ignore the counter
76 // when making inlining decisions. 70 // when making inlining decisions.
77 FLAG_inlining_hotness = 0; 71 FLAG_inlining_hotness = 0;
78 // Use smaller thresholds in precompilation as we are compiling everything 72 // Use smaller thresholds in precompilation as we are compiling everything
79 // with the optimizing compiler instead of only hot functions. 73 // with the optimizing compiler instead of only hot functions.
80 FLAG_inlining_size_threshold = 5; 74 FLAG_inlining_size_threshold = 5;
81 FLAG_inline_getters_setters_smaller_than = 5; 75 FLAG_inline_getters_setters_smaller_than = 5;
82 FLAG_inlining_callee_size_threshold = 20; 76 FLAG_inlining_callee_size_threshold = 20;
83 FLAG_inlining_depth_threshold = 2; 77 FLAG_inlining_depth_threshold = 2;
84 FLAG_inlining_caller_size_threshold = 1000; 78 FLAG_inlining_caller_size_threshold = 1000;
85 FLAG_inlining_constant_arguments_max_size_threshold = 100; 79 FLAG_inlining_constant_arguments_max_size_threshold = 100;
86 FLAG_inlining_constant_arguments_min_size_threshold = 30; 80 FLAG_inlining_constant_arguments_min_size_threshold = 30;
87 81
88 FLAG_allow_absolute_addresses = false; 82 FLAG_allow_absolute_addresses = false;
89 FLAG_always_megamorphic_calls = true; 83 FLAG_always_megamorphic_calls = true;
90 FLAG_background_compilation = false;
91 FLAG_collect_code = false;
92 FLAG_collect_dynamic_function_names = true; 84 FLAG_collect_dynamic_function_names = true;
93 FLAG_deoptimize_alot = false; // Used in some tests.
94 FLAG_deoptimize_every = 0; // Used in some tests.
95 FLAG_emit_edge_counters = false; 85 FLAG_emit_edge_counters = false;
96 FLAG_enable_mirrors = false;
97 FLAG_fields_may_be_reset = true; 86 FLAG_fields_may_be_reset = true;
98 FLAG_ic_range_profiling = false; 87 FLAG_ic_range_profiling = false;
99 FLAG_interpret_irregexp = true;
100 FLAG_lazy_dispatchers = false; 88 FLAG_lazy_dispatchers = false;
101 FLAG_link_natives_lazily = true; 89 FLAG_link_natives_lazily = true;
102 FLAG_load_deferred_eagerly = true;
103 FLAG_optimization_counter_threshold = -1; 90 FLAG_optimization_counter_threshold = -1;
104 FLAG_polymorphic_with_deopt = false; 91 FLAG_polymorphic_with_deopt = false;
105 FLAG_precompiled_mode = true; 92 FLAG_precompiled_mode = true;
93 FLAG_reorder_basic_blocks = false;
94 FLAG_use_field_guards = false;
95 FLAG_use_cha_deopt = false;
96
97 #if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
98 // Set flags affecting runtime accordingly for dart_noopt.
99 FLAG_background_compilation = false;
100 FLAG_collect_code = false;
101 FLAG_support_debugger = false;
102 FLAG_deoptimize_alot = false; // Used in some tests.
103 FLAG_deoptimize_every = 0; // Used in some tests.
104 FLAG_enable_mirrors = false;
105 FLAG_interpret_irregexp = true;
106 FLAG_load_deferred_eagerly = true;
106 FLAG_print_stop_message = false; 107 FLAG_print_stop_message = false;
107 FLAG_use_cha_deopt = false;
108 FLAG_use_field_guards = false;
109 FLAG_use_osr = false; 108 FLAG_use_osr = false;
110 #endif // PRODUCT 109 #endif
111 } 110 }
112 } 111 }
113 112
114 DEFINE_FLAG_HANDLER(PrecompilationModeHandler, 113 DEFINE_FLAG_HANDLER(PrecompilationModeHandler,
115 precompilation, 114 precompilation,
116 "Precompilation mode"); 115 "Precompilation mode");
117 116
118 #else // DART_PRECOMPILED_RUNTIME 117 #ifdef DART_PRECOMPILED_RUNTIME
119 118
120 COMPILE_ASSERT(!FLAG_allow_absolute_addresses);
121 COMPILE_ASSERT(!FLAG_background_compilation); 119 COMPILE_ASSERT(!FLAG_background_compilation);
122 COMPILE_ASSERT(!FLAG_collect_code); 120 COMPILE_ASSERT(!FLAG_collect_code);
123 COMPILE_ASSERT(!FLAG_deoptimize_alot); // Used in some tests. 121 COMPILE_ASSERT(!FLAG_deoptimize_alot); // Used in some tests.
124 COMPILE_ASSERT(!FLAG_emit_edge_counters);
125 COMPILE_ASSERT(!FLAG_enable_mirrors); 122 COMPILE_ASSERT(!FLAG_enable_mirrors);
126 COMPILE_ASSERT(!FLAG_ic_range_profiling);
127 COMPILE_ASSERT(!FLAG_lazy_dispatchers);
128 COMPILE_ASSERT(!FLAG_polymorphic_with_deopt);
129 COMPILE_ASSERT(!FLAG_print_stop_message); 123 COMPILE_ASSERT(!FLAG_print_stop_message);
130 COMPILE_ASSERT(!FLAG_use_cha_deopt);
131 COMPILE_ASSERT(!FLAG_use_field_guards);
132 COMPILE_ASSERT(!FLAG_use_osr); 124 COMPILE_ASSERT(!FLAG_use_osr);
133 COMPILE_ASSERT(FLAG_always_megamorphic_calls);
134 COMPILE_ASSERT(FLAG_collect_dynamic_function_names);
135 COMPILE_ASSERT(FLAG_deoptimize_every == 0); // Used in some tests. 125 COMPILE_ASSERT(FLAG_deoptimize_every == 0); // Used in some tests.
136 COMPILE_ASSERT(FLAG_fields_may_be_reset);
137 COMPILE_ASSERT(FLAG_interpret_irregexp); 126 COMPILE_ASSERT(FLAG_interpret_irregexp);
138 COMPILE_ASSERT(FLAG_link_natives_lazily);
139 COMPILE_ASSERT(FLAG_load_deferred_eagerly); 127 COMPILE_ASSERT(FLAG_load_deferred_eagerly);
140 COMPILE_ASSERT(FLAG_optimization_counter_threshold == -1);
141 COMPILE_ASSERT(FLAG_precompiled_mode);
142 128
143 #endif // DART_PRECOMPILED_RUNTIME 129 #endif // DART_PRECOMPILED_RUNTIME
144 130
145 131
146 // Assign locations to incoming arguments, i.e., values pushed above spill slots 132 // Assign locations to incoming arguments, i.e., values pushed above spill slots
147 // with PushArgument. Recursively allocates from outermost to innermost 133 // with PushArgument. Recursively allocates from outermost to innermost
148 // environment. 134 // environment.
149 void CompilerDeoptInfo::AllocateIncomingParametersRecursive( 135 void CompilerDeoptInfo::AllocateIncomingParametersRecursive(
150 Environment* env, 136 Environment* env,
151 intptr_t* stack_height) { 137 intptr_t* stack_height) {
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1935 1921
1936 1922
1937 void FlowGraphCompiler::FrameStateClear() { 1923 void FlowGraphCompiler::FrameStateClear() {
1938 ASSERT(!is_optimizing()); 1924 ASSERT(!is_optimizing());
1939 frame_state_.TruncateTo(0); 1925 frame_state_.TruncateTo(0);
1940 } 1926 }
1941 #endif 1927 #endif
1942 1928
1943 1929
1944 } // namespace dart 1930 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698