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

Side by Side Diff: src/objects.h

Issue 2350963004: [builtins] Move StringIndexOf to a C++ builtin. (Closed)
Patch Set: Change IndexOf usage to use unchecked version Created 4 years, 2 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/js/string.js ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
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 9311 matching lines...) Expand 10 before | Expand all | Expand 10 after
9322 // character or string equality and collating order defined in the Unicode 9322 // character or string equality and collating order defined in the Unicode
9323 // specification. Therefore String values that are canonically equal according 9323 // specification. Therefore String values that are canonically equal according
9324 // to the Unicode standard could test as unequal. In effect this algorithm 9324 // to the Unicode standard could test as unequal. In effect this algorithm
9325 // assumes that both Strings are already in normalized form. Also, note that 9325 // assumes that both Strings are already in normalized form. Also, note that
9326 // for strings containing supplementary characters, lexicographic ordering on 9326 // for strings containing supplementary characters, lexicographic ordering on
9327 // sequences of UTF-16 code unit values differs from that on sequences of code 9327 // sequences of UTF-16 code unit values differs from that on sequences of code
9328 // point values. 9328 // point values.
9329 MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x, 9329 MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x,
9330 Handle<String> y); 9330 Handle<String> y);
9331 9331
9332 // Perform ES6 21.1.3.8, including checking arguments.
9333 static Object* IndexOf(Isolate* isolate, Handle<Object> receiver,
9334 Handle<Object> search,
9335 Handle<Object> position);
9332 // Perform string match of pattern on subject, starting at start index. 9336 // Perform string match of pattern on subject, starting at start index.
9333 // Caller must ensure that 0 <= start_index <= sub->length(). 9337 // Caller must ensure that 0 <= start_index <= sub->length(), as this does not
9334 static int IndexOf(Isolate* isolate, Handle<String> sub, Handle<String> pat, 9338 // check any arguments.
9335 int start_index); 9339 static int IndexOf(Isolate* isolate, Handle<String> receiver,
Franzi 2016/09/23 11:37:00 Is the inner function only used inside Object* Ind
9340 Handle<String> search, int start_index);
9336 9341
9337 static Object* LastIndexOf(Isolate* isolate, Handle<Object> receiver, 9342 static Object* LastIndexOf(Isolate* isolate, Handle<Object> receiver,
9338 Handle<Object> search, Handle<Object> position); 9343 Handle<Object> search, Handle<Object> position);
9339 9344
9340 // String equality operations. 9345 // String equality operations.
9341 inline bool Equals(String* other); 9346 inline bool Equals(String* other);
9342 inline static bool Equals(Handle<String> one, Handle<String> two); 9347 inline static bool Equals(Handle<String> one, Handle<String> two);
9343 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false); 9348 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false);
9344 bool IsOneByteEqualTo(Vector<const uint8_t> str); 9349 bool IsOneByteEqualTo(Vector<const uint8_t> str);
9345 bool IsTwoByteEqualTo(Vector<const uc16> str); 9350 bool IsTwoByteEqualTo(Vector<const uc16> str);
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
11311 } 11316 }
11312 return value; 11317 return value;
11313 } 11318 }
11314 }; 11319 };
11315 11320
11316 11321
11317 } // NOLINT, false-positive due to second-order macros. 11322 } // NOLINT, false-positive due to second-order macros.
11318 } // NOLINT, false-positive due to second-order macros. 11323 } // NOLINT, false-positive due to second-order macros.
11319 11324
11320 #endif // V8_OBJECTS_H_ 11325 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/js/string.js ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698