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

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

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698