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

Side by Side Diff: src/objects.h

Issue 228093004: Implement handlified String::Flatten. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: even shorter Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/messages.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 8987 matching lines...) Expand 10 before | Expand all | Expand 10 after
8998 // 8998 //
8999 // Use FlattenString from Handles.cc to flatten even in case an 8999 // Use FlattenString from Handles.cc to flatten even in case an
9000 // allocation failure happens. 9000 // allocation failure happens.
9001 inline MaybeObject* TryFlatten(PretenureFlag pretenure = NOT_TENURED); 9001 inline MaybeObject* TryFlatten(PretenureFlag pretenure = NOT_TENURED);
9002 9002
9003 // Convenience function. Has exactly the same behavior as 9003 // Convenience function. Has exactly the same behavior as
9004 // TryFlatten(), except in the case of failure returns the original 9004 // TryFlatten(), except in the case of failure returns the original
9005 // string. 9005 // string.
9006 inline String* TryFlattenGetString(PretenureFlag pretenure = NOT_TENURED); 9006 inline String* TryFlattenGetString(PretenureFlag pretenure = NOT_TENURED);
9007 9007
9008 static inline Handle<String> Flatten(Handle<String> string,
9009 PretenureFlag pretenure = NOT_TENURED);
9010
9011 static Handle<String> SlowFlatten(Handle<ConsString> cons,
9012 PretenureFlag tenure);
9013
9014
9008 // Tries to return the content of a flat string as a structure holding either 9015 // Tries to return the content of a flat string as a structure holding either
9009 // a flat vector of char or of uc16. 9016 // a flat vector of char or of uc16.
9010 // If the string isn't flat, and therefore doesn't have flat content, the 9017 // If the string isn't flat, and therefore doesn't have flat content, the
9011 // returned structure will report so, and can't provide a vector of either 9018 // returned structure will report so, and can't provide a vector of either
9012 // kind. 9019 // kind.
9013 FlatContent GetFlatContent(); 9020 FlatContent GetFlatContent();
9014 9021
9015 // Returns the parent of a sliced string or first part of a flat cons string. 9022 // Returns the parent of a sliced string or first part of a flat cons string.
9016 // Requires: StringShape(this).IsIndirect() && this->IsFlat() 9023 // Requires: StringShape(this).IsIndirect() && this->IsFlat()
9017 inline String* GetUnderlying(); 9024 inline String* GetUnderlying();
(...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after
11004 } else { 11011 } else {
11005 value &= ~(1 << bit_position); 11012 value &= ~(1 << bit_position);
11006 } 11013 }
11007 return value; 11014 return value;
11008 } 11015 }
11009 }; 11016 };
11010 11017
11011 } } // namespace v8::internal 11018 } } // namespace v8::internal
11012 11019
11013 #endif // V8_OBJECTS_H_ 11020 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/messages.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698