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

Side by Side Diff: src/runtime/runtime-strings.cc

Issue 1630633002: [regexp] correctly advance zero length matches for global/unicode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@backrefbounds
Patch Set: fix test Created 4 years, 10 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
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | test/mjsunit/harmony/unicode-regexp-zero-length.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/conversions-inl.h" 8 #include "src/conversions-inl.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/regexp/jsregexp-inl.h" 10 #include "src/regexp/jsregexp-inl.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 RUNTIME_FUNCTION(Runtime_StringMatch) { 334 RUNTIME_FUNCTION(Runtime_StringMatch) {
335 HandleScope handles(isolate); 335 HandleScope handles(isolate);
336 DCHECK(args.length() == 3); 336 DCHECK(args.length() == 3);
337 337
338 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); 338 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0);
339 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 1); 339 CONVERT_ARG_HANDLE_CHECKED(JSRegExp, regexp, 1);
340 CONVERT_ARG_HANDLE_CHECKED(JSArray, regexp_info, 2); 340 CONVERT_ARG_HANDLE_CHECKED(JSArray, regexp_info, 2);
341 341
342 RUNTIME_ASSERT(regexp_info->HasFastObjectElements()); 342 RUNTIME_ASSERT(regexp_info->HasFastObjectElements());
343 343
344 RegExpImpl::GlobalCache global_cache(regexp, subject, true, isolate); 344 RegExpImpl::GlobalCache global_cache(regexp, subject, isolate);
345 if (global_cache.HasException()) return isolate->heap()->exception(); 345 if (global_cache.HasException()) return isolate->heap()->exception();
346 346
347 int capture_count = regexp->CaptureCount(); 347 int capture_count = regexp->CaptureCount();
348 348
349 ZoneScope zone_scope(isolate->runtime_zone()); 349 ZoneScope zone_scope(isolate->runtime_zone());
350 ZoneList<int> offsets(8, zone_scope.zone()); 350 ZoneList<int> offsets(8, zone_scope.zone());
351 351
352 while (true) { 352 while (true) {
353 int32_t* match = global_cache.FetchNext(); 353 int32_t* match = global_cache.FetchNext();
354 if (match == NULL) break; 354 if (match == NULL) break;
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 SealHandleScope shs(isolate); 1240 SealHandleScope shs(isolate);
1241 DCHECK(args.length() == 2); 1241 DCHECK(args.length() == 2);
1242 if (!args[0]->IsString()) return isolate->heap()->undefined_value(); 1242 if (!args[0]->IsString()) return isolate->heap()->undefined_value();
1243 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value(); 1243 if (!args[1]->IsNumber()) return isolate->heap()->undefined_value();
1244 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value(); 1244 if (std::isinf(args.number_at(1))) return isolate->heap()->nan_value();
1245 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate); 1245 return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate);
1246 } 1246 }
1247 1247
1248 } // namespace internal 1248 } // namespace internal
1249 } // namespace v8 1249 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | test/mjsunit/harmony/unicode-regexp-zero-length.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698