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" |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 intptr_t binary_chop_index = (end_index + start_index) / 2; | 1227 intptr_t binary_chop_index = (end_index + start_index) / 2; |
1228 // The first test ensures that we get to the code that handles the Latin1 | 1228 // The first test ensures that we get to the code that handles the Latin1 |
1229 // range with a single not-taken branch, speeding up this important | 1229 // range with a single not-taken branch, speeding up this important |
1230 // character range (even non-Latin1 charset-based text has spaces and | 1230 // character range (even non-Latin1 charset-based text has spaces and |
1231 // punctuation). | 1231 // punctuation). |
1232 if (*border - 1 > Symbols::kMaxOneCharCodeSymbol && // Latin1 case. | 1232 if (*border - 1 > Symbols::kMaxOneCharCodeSymbol && // Latin1 case. |
1233 end_index - start_index > (*new_start_index - start_index) * 2 && | 1233 end_index - start_index > (*new_start_index - start_index) * 2 && |
1234 last - first > kSize * 2 && | 1234 last - first > kSize * 2 && |
1235 binary_chop_index > *new_start_index && | 1235 binary_chop_index > *new_start_index && |
1236 ranges->At(binary_chop_index) >= first + 2 * kSize) { | 1236 ranges->At(binary_chop_index) >= first + 2 * kSize) { |
1237 intptr_t scan_forward_for_section_border = binary_chop_index;; | 1237 intptr_t scan_forward_for_section_border = binary_chop_index; |
1238 intptr_t new_border = (ranges->At(binary_chop_index) | kMask) + 1; | 1238 intptr_t new_border = (ranges->At(binary_chop_index) | kMask) + 1; |
1239 | 1239 |
1240 while (scan_forward_for_section_border < end_index) { | 1240 while (scan_forward_for_section_border < end_index) { |
1241 if (ranges->At(scan_forward_for_section_border) > new_border) { | 1241 if (ranges->At(scan_forward_for_section_border) > new_border) { |
1242 *new_start_index = scan_forward_for_section_border; | 1242 *new_start_index = scan_forward_for_section_border; |
1243 *border = new_border; | 1243 *border = new_border; |
1244 break; | 1244 break; |
1245 } | 1245 } |
1246 scan_forward_for_section_border++; | 1246 scan_forward_for_section_border++; |
1247 } | 1247 } |
(...skipping 4075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5323 regexp, kExternalOneByteStringCid, owner); | 5323 regexp, kExternalOneByteStringCid, owner); |
5324 CreateSpecializedFunction(thread, zone, | 5324 CreateSpecializedFunction(thread, zone, |
5325 regexp, kExternalTwoByteStringCid, owner); | 5325 regexp, kExternalTwoByteStringCid, owner); |
5326 } | 5326 } |
5327 | 5327 |
5328 return regexp.raw(); | 5328 return regexp.raw(); |
5329 } | 5329 } |
5330 | 5330 |
5331 | 5331 |
5332 } // namespace dart | 5332 } // namespace dart |
OLD | NEW |