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

Side by Side Diff: src/objects.h

Issue 2813843002: [string] Add a fast path to String.p.replace (Closed)
Patch Set: Don't scan twice Created 3 years, 8 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/code-stub-assembler.cc ('k') | src/objects.cc » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 8185 matching lines...) Expand 10 before | Expand all | Expand 10 after
8196 virtual MaybeHandle<String> GetNamedCapture(Handle<String> name, 8196 virtual MaybeHandle<String> GetNamedCapture(Handle<String> name,
8197 CaptureState* state) = 0; 8197 CaptureState* state) = 0;
8198 8198
8199 virtual ~Match() {} 8199 virtual ~Match() {}
8200 }; 8200 };
8201 8201
8202 // ES#sec-getsubstitution 8202 // ES#sec-getsubstitution
8203 // GetSubstitution(matched, str, position, captures, replacement) 8203 // GetSubstitution(matched, str, position, captures, replacement)
8204 // Expand the $-expressions in the string and return a new string with 8204 // Expand the $-expressions in the string and return a new string with
8205 // the result. 8205 // the result.
8206 // A {start_index} can be passed to specify where to start scanning the
8207 // replacement string.
8206 MUST_USE_RESULT static MaybeHandle<String> GetSubstitution( 8208 MUST_USE_RESULT static MaybeHandle<String> GetSubstitution(
8207 Isolate* isolate, Match* match, Handle<String> replacement); 8209 Isolate* isolate, Match* match, Handle<String> replacement,
8210 int start_index = 0);
8208 8211
8209 // String equality operations. 8212 // String equality operations.
8210 inline bool Equals(String* other); 8213 inline bool Equals(String* other);
8211 inline static bool Equals(Handle<String> one, Handle<String> two); 8214 inline static bool Equals(Handle<String> one, Handle<String> two);
8212 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false); 8215 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false);
8213 8216
8214 // Dispatches to Is{One,Two}ByteEqualTo. 8217 // Dispatches to Is{One,Two}ByteEqualTo.
8215 template <typename Char> 8218 template <typename Char>
8216 bool IsEqualTo(Vector<const Char> str); 8219 bool IsEqualTo(Vector<const Char> str);
8217 8220
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after
10249 } 10252 }
10250 }; 10253 };
10251 10254
10252 10255
10253 } // NOLINT, false-positive due to second-order macros. 10256 } // NOLINT, false-positive due to second-order macros.
10254 } // NOLINT, false-positive due to second-order macros. 10257 } // NOLINT, false-positive due to second-order macros.
10255 10258
10256 #include "src/objects/object-macros-undef.h" 10259 #include "src/objects/object-macros-undef.h"
10257 10260
10258 #endif // V8_OBJECTS_H_ 10261 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698