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/code_generator.h" | 5 #include "vm/code_generator.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 original_function_name, | 1024 original_function_name, |
1025 orig_arguments, | 1025 orig_arguments, |
1026 orig_arguments_desc)); | 1026 orig_arguments_desc)); |
1027 CheckResultError(result); | 1027 CheckResultError(result); |
1028 arguments.SetReturn(result); | 1028 arguments.SetReturn(result); |
1029 } | 1029 } |
1030 | 1030 |
1031 | 1031 |
1032 static bool CanOptimizeFunction(const Function& function, Isolate* isolate) { | 1032 static bool CanOptimizeFunction(const Function& function, Isolate* isolate) { |
1033 const intptr_t kLowInvocationCount = -100000000; | 1033 const intptr_t kLowInvocationCount = -100000000; |
| 1034 // TODO(jgruber): Enable optimizations of irregexp functions. |
| 1035 if (function.kind() == RawFunction::kIrregexpFunction) { |
| 1036 function.set_usage_counter(kLowInvocationCount); |
| 1037 return false; |
| 1038 } |
1034 if (isolate->debugger()->IsStepping() || | 1039 if (isolate->debugger()->IsStepping() || |
1035 isolate->debugger()->HasBreakpoint(function)) { | 1040 isolate->debugger()->HasBreakpoint(function)) { |
1036 // We cannot set breakpoints and single step in optimized code, | 1041 // We cannot set breakpoints and single step in optimized code, |
1037 // so do not optimize the function. | 1042 // so do not optimize the function. |
1038 function.set_usage_counter(0); | 1043 function.set_usage_counter(0); |
1039 return false; | 1044 return false; |
1040 } | 1045 } |
1041 if (function.deoptimization_counter() >= | 1046 if (function.deoptimization_counter() >= |
1042 FLAG_deoptimization_counter_threshold) { | 1047 FLAG_deoptimization_counter_threshold) { |
1043 if (FLAG_trace_failed_optimization_attempts || | 1048 if (FLAG_trace_failed_optimization_attempts || |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 field.RecordStore(value); | 1587 field.RecordStore(value); |
1583 } | 1588 } |
1584 | 1589 |
1585 | 1590 |
1586 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { | 1591 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { |
1587 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1592 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
1588 field.EvaluateInitializer(); | 1593 field.EvaluateInitializer(); |
1589 } | 1594 } |
1590 | 1595 |
1591 } // namespace dart | 1596 } // namespace dart |
OLD | NEW |