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

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

Issue 864753003: Remove implicit uint8_t to char cast in string replace. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/jsregexp-inl.h" 8 #include "src/jsregexp-inl.h"
9 #include "src/jsregexp.h" 9 #include "src/jsregexp.h"
10 #include "src/runtime/runtime-utils.h" 10 #include "src/runtime/runtime-utils.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 case REPLACEMENT_STRING: 271 case REPLACEMENT_STRING:
272 builder->AddString(replacement_substrings_[part.data]); 272 builder->AddString(replacement_substrings_[part.data]);
273 break; 273 break;
274 default: 274 default:
275 UNREACHABLE(); 275 UNREACHABLE();
276 } 276 }
277 } 277 }
278 } 278 }
279 279
280 280
281 void FindOneByteStringIndices(Vector<const uint8_t> subject, char pattern, 281 void FindOneByteStringIndices(Vector<const uint8_t> subject, uint8_t pattern,
282 ZoneList<int>* indices, unsigned int limit, 282 ZoneList<int>* indices, unsigned int limit,
283 Zone* zone) { 283 Zone* zone) {
284 DCHECK(limit > 0); 284 DCHECK(limit > 0);
285 // Collect indices of pattern in subject using memchr. 285 // Collect indices of pattern in subject using memchr.
286 // Stop after finding at most limit values. 286 // Stop after finding at most limit values.
287 const uint8_t* subject_start = subject.start(); 287 const uint8_t* subject_start = subject.start();
288 const uint8_t* subject_end = subject_start + subject.length(); 288 const uint8_t* subject_end = subject_start + subject.length();
289 const uint8_t* pos = subject_start; 289 const uint8_t* pos = subject_start;
290 while (limit > 0) { 290 while (limit > 0) {
291 pos = reinterpret_cast<const uint8_t*>( 291 pos = reinterpret_cast<const uint8_t*>(
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 1123
1124 1124
1125 RUNTIME_FUNCTION(RuntimeReference_IsRegExp) { 1125 RUNTIME_FUNCTION(RuntimeReference_IsRegExp) {
1126 SealHandleScope shs(isolate); 1126 SealHandleScope shs(isolate);
1127 DCHECK(args.length() == 1); 1127 DCHECK(args.length() == 1);
1128 CONVERT_ARG_CHECKED(Object, obj, 0); 1128 CONVERT_ARG_CHECKED(Object, obj, 0);
1129 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); 1129 return isolate->heap()->ToBoolean(obj->IsJSRegExp());
1130 } 1130 }
1131 } 1131 }
1132 } // namespace v8::internal 1132 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698