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

Unified Diff: src/objects.h

Issue 18552: Fix bug where strings were not flattened before regexp. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/jsregexp.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
===================================================================
--- src/objects.h (revision 1138)
+++ src/objects.h (working copy)
@@ -3131,16 +3131,18 @@
// to this method are not efficient unless the string is flat.
inline uint16_t Get(StringShape shape, int index);
- // Flatten the top level ConsString that is hiding behind this
+ // Try to flatten the top level ConsString that is hiding behind this
// string. This is a no-op unless the string is a ConsString or a
// SlicedString. Flatten mutates the ConsString and might return a
// failure.
- Object* Flatten(StringShape shape);
- // Try to flatten the string. Do not allow handling of allocation
- // failures. After calling TryFlatten, the string could still be a
- // ConsString.
- inline void TryFlatten(StringShape shape);
+ Object* TryFlatten(StringShape shape);
+ // Try to flatten the string. Checks first inline to see if it is necessary.
+ // Do not handle allocation failures. After calling TryFlattenIfNotFlat, the
+ // string could still be a ConsString, in which case a failure is returned.
+ // Use FlattenString from Handles.cc to be sure to flatten.
+ inline Object* TryFlattenIfNotFlat(StringShape shape);
+
Vector<const char> ToAsciiVector();
Vector<const uc16> ToUC16Vector();
« no previous file with comments | « src/jsregexp.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698