OLD | NEW |
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 bool FlowGraphCompiler::CanOptimizeFunction() const { | 288 bool FlowGraphCompiler::CanOptimizeFunction() const { |
289 return CanOptimize() && !parsed_function().function().HasBreakpoint(); | 289 return CanOptimize() && !parsed_function().function().HasBreakpoint(); |
290 } | 290 } |
291 | 291 |
292 bool FlowGraphCompiler::CanOSRFunction() const { | 292 bool FlowGraphCompiler::CanOSRFunction() const { |
293 return isolate()->use_osr() && CanOptimizeFunction() && !is_optimizing(); | 293 return isolate()->use_osr() && CanOptimizeFunction() && !is_optimizing(); |
294 } | 294 } |
295 | 295 |
296 bool FlowGraphCompiler::ForceSlowPathForStackOverflow() const { | 296 bool FlowGraphCompiler::ForceSlowPathForStackOverflow() const { |
297 #if !defined(PRODUCT) | |
298 if ((FLAG_stacktrace_every > 0) || (FLAG_deoptimize_every > 0) || | 297 if ((FLAG_stacktrace_every > 0) || (FLAG_deoptimize_every > 0) || |
299 (isolate()->reload_every_n_stack_overflow_checks() > 0)) { | 298 (isolate()->reload_every_n_stack_overflow_checks() > 0)) { |
300 return true; | 299 return true; |
301 } | 300 } |
302 if (FLAG_stacktrace_filter != NULL && | 301 if (FLAG_stacktrace_filter != NULL && |
303 strstr(parsed_function().function().ToFullyQualifiedCString(), | 302 strstr(parsed_function().function().ToFullyQualifiedCString(), |
304 FLAG_stacktrace_filter) != NULL) { | 303 FLAG_stacktrace_filter) != NULL) { |
305 return true; | 304 return true; |
306 } | 305 } |
307 if (is_optimizing() && FLAG_deoptimize_filter != NULL && | 306 if (is_optimizing() && FLAG_deoptimize_filter != NULL && |
308 strstr(parsed_function().function().ToFullyQualifiedCString(), | 307 strstr(parsed_function().function().ToFullyQualifiedCString(), |
309 FLAG_deoptimize_filter) != NULL) { | 308 FLAG_deoptimize_filter) != NULL) { |
310 return true; | 309 return true; |
311 } | 310 } |
312 #endif // !defined(PRODUCT) | |
313 return false; | 311 return false; |
314 } | 312 } |
315 | 313 |
316 static bool IsEmptyBlock(BlockEntryInstr* block) { | 314 static bool IsEmptyBlock(BlockEntryInstr* block) { |
317 return !block->IsCatchBlockEntry() && !block->HasNonRedundantParallelMove() && | 315 return !block->IsCatchBlockEntry() && !block->HasNonRedundantParallelMove() && |
318 block->next()->IsGoto() && | 316 block->next()->IsGoto() && |
319 !block->next()->AsGoto()->HasNonRedundantParallelMove() && | 317 !block->next()->AsGoto()->HasNonRedundantParallelMove() && |
320 !block->IsIndirectEntry(); | 318 !block->IsIndirectEntry(); |
321 } | 319 } |
322 | 320 |
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 return true; | 1939 return true; |
1942 } | 1940 } |
1943 | 1941 |
1944 void FlowGraphCompiler::FrameStateClear() { | 1942 void FlowGraphCompiler::FrameStateClear() { |
1945 ASSERT(!is_optimizing()); | 1943 ASSERT(!is_optimizing()); |
1946 frame_state_.TruncateTo(0); | 1944 frame_state_.TruncateTo(0); |
1947 } | 1945 } |
1948 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 1946 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
1949 | 1947 |
1950 } // namespace dart | 1948 } // namespace dart |
OLD | NEW |