| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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/regexp.h" | 5 #include "vm/regexp.h" |
| 6 | 6 |
| 7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
| 8 #include "vm/regexp_assembler.h" | 8 #include "vm/regexp_assembler.h" |
| 9 #include "vm/regexp_assembler_bytecode.h" | 9 #include "vm/regexp_assembler_bytecode.h" |
| 10 #include "vm/regexp_assembler_ir.h" | 10 #include "vm/regexp_assembler_ir.h" |
| 11 #include "vm/regexp_ast.h" | 11 #include "vm/regexp_ast.h" |
| 12 #include "vm/unibrow-inl.h" | 12 #include "vm/unibrow-inl.h" |
| 13 #include "vm/unicode.h" | 13 #include "vm/unicode.h" |
| 14 #include "vm/symbols.h" | 14 #include "vm/symbols.h" |
| 15 #include "vm/thread.h" | 15 #include "vm/thread.h" |
| 16 | 16 |
| 17 #define Z (zone()) | 17 #define Z (zone()) |
| 18 | 18 |
| 19 namespace dart { | 19 namespace dart { |
| 20 | 20 |
| 21 DECLARE_FLAG(bool, trace_irregexp); | 21 DECLARE_FLAG(bool, trace_irregexp); |
| 22 DEFINE_FLAG(bool, interpret_irregexp, false, | |
| 23 "Use irregexp bytecode interpreter"); | |
| 24 | 22 |
| 25 // Default to generating optimized regexp code. | 23 // Default to generating optimized regexp code. |
| 26 static const bool kRegexpOptimization = true; | 24 static const bool kRegexpOptimization = true; |
| 27 | 25 |
| 28 // More makes code generation slower, less makes V8 benchmark score lower. | 26 // More makes code generation slower, less makes V8 benchmark score lower. |
| 29 static const intptr_t kMaxLookaheadForBoyerMoore = 8; | 27 static const intptr_t kMaxLookaheadForBoyerMoore = 8; |
| 30 | 28 |
| 31 ContainedInLattice AddRange(ContainedInLattice containment, | 29 ContainedInLattice AddRange(ContainedInLattice containment, |
| 32 const intptr_t* ranges, | 30 const intptr_t* ranges, |
| 33 intptr_t ranges_length, | 31 intptr_t ranges_length, |
| (...skipping 5292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5326 CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner); | 5324 CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner); |
| 5327 CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner); | 5325 CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner); |
| 5328 CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner); | 5326 CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner); |
| 5329 CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner); | 5327 CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner); |
| 5330 | 5328 |
| 5331 return regexp.raw(); | 5329 return regexp.raw(); |
| 5332 } | 5330 } |
| 5333 | 5331 |
| 5334 | 5332 |
| 5335 } // namespace dart | 5333 } // namespace dart |
| OLD | NEW |