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

Side by Side Diff: src/objects.h

Issue 12440061: Improve SeqString::Truncate for latest allocated strings. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: renamed according to suggestion Created 7 years, 9 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/json-stringifier.h ('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 7736 matching lines...) Expand 10 before | Expand all | Expand 10 after
7747 public: 7747 public:
7748 // Casting. 7748 // Casting.
7749 static inline SeqString* cast(Object* obj); 7749 static inline SeqString* cast(Object* obj);
7750 7750
7751 // Layout description. 7751 // Layout description.
7752 static const int kHeaderSize = String::kSize; 7752 static const int kHeaderSize = String::kSize;
7753 7753
7754 // Truncate the string in-place if possible and return the result. 7754 // Truncate the string in-place if possible and return the result.
7755 // In case of new_length == 0, the empty string is returned without 7755 // In case of new_length == 0, the empty string is returned without
7756 // truncating the original string. 7756 // truncating the original string.
7757 MUST_USE_RESULT String* Truncate(int new_length); 7757 MUST_USE_RESULT static Handle<String> Truncate(Handle<SeqString> string,
7758 7758 int new_length);
7759 private: 7759 private:
7760 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqString); 7760 DISALLOW_IMPLICIT_CONSTRUCTORS(SeqString);
7761 }; 7761 };
7762 7762
7763 7763
7764 // The AsciiString class captures sequential ASCII string objects. 7764 // The AsciiString class captures sequential ASCII string objects.
7765 // Each character in the AsciiString is an ASCII character. 7765 // Each character in the AsciiString is an ASCII character.
7766 class SeqOneByteString: public SeqString { 7766 class SeqOneByteString: public SeqString {
7767 public: 7767 public:
7768 static const bool kHasAsciiEncoding = true; 7768 static const bool kHasAsciiEncoding = true;
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
9261 } else { 9261 } else {
9262 value &= ~(1 << bit_position); 9262 value &= ~(1 << bit_position);
9263 } 9263 }
9264 return value; 9264 return value;
9265 } 9265 }
9266 }; 9266 };
9267 9267
9268 } } // namespace v8::internal 9268 } } // namespace v8::internal
9269 9269
9270 #endif // V8_OBJECTS_H_ 9270 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/json-stringifier.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698