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

Side by Side Diff: src/factory.h

Issue 50073005: Handlify concat string and substring. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | « no previous file | src/factory.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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // characters of the string are uninitialized. Currently used in regexp code 149 // characters of the string are uninitialized. Currently used in regexp code
150 // only, where they are pretenured. 150 // only, where they are pretenured.
151 Handle<SeqOneByteString> NewRawOneByteString( 151 Handle<SeqOneByteString> NewRawOneByteString(
152 int length, 152 int length,
153 PretenureFlag pretenure = NOT_TENURED); 153 PretenureFlag pretenure = NOT_TENURED);
154 Handle<SeqTwoByteString> NewRawTwoByteString( 154 Handle<SeqTwoByteString> NewRawTwoByteString(
155 int length, 155 int length,
156 PretenureFlag pretenure = NOT_TENURED); 156 PretenureFlag pretenure = NOT_TENURED);
157 157
158 // Create a new cons string object which consists of a pair of strings. 158 // Create a new cons string object which consists of a pair of strings.
159 Handle<String> NewConsString(Handle<String> first, 159 Handle<String> NewConsString(Handle<String> left,
160 Handle<String> second); 160 Handle<String> right);
161
162 Handle<ConsString> NewRawConsString(String::Encoding encoding);
161 163
162 // Create a new sequential string containing the concatenation of the inputs. 164 // Create a new sequential string containing the concatenation of the inputs.
163 Handle<String> NewFlatConcatString(Handle<String> first, 165 Handle<String> NewFlatConcatString(Handle<String> first,
164 Handle<String> second); 166 Handle<String> second);
165 167
166 // Create a new string object which holds a substring of a string.
167 Handle<String> NewSubString(Handle<String> str,
168 int begin,
169 int end);
170
171 // Create a new string object which holds a proper substring of a string. 168 // Create a new string object which holds a proper substring of a string.
172 Handle<String> NewProperSubString(Handle<String> str, 169 Handle<String> NewProperSubString(Handle<String> str,
173 int begin, 170 int begin,
174 int end); 171 int end);
175 172
173 // Create a new string object which holds a substring of a string.
174 Handle<String> NewSubString(Handle<String> str, int begin, int end) {
175 if (begin == 0 && end == str->length()) return str;
176 return NewProperSubString(str, begin, end);
177 }
178
179 Handle<SlicedString> NewRawSlicedString(String::Encoding encoding);
180
176 // Creates a new external String object. There are two String encodings 181 // Creates a new external String object. There are two String encodings
177 // in the system: ASCII and two byte. Unlike other String types, it does 182 // in the system: ASCII and two byte. Unlike other String types, it does
178 // not make sense to have a UTF-8 factory function for external strings, 183 // not make sense to have a UTF-8 factory function for external strings,
179 // because we cannot change the underlying buffer. 184 // because we cannot change the underlying buffer.
180 Handle<String> NewExternalStringFromAscii( 185 Handle<String> NewExternalStringFromAscii(
181 const ExternalAsciiString::Resource* resource); 186 const ExternalAsciiString::Resource* resource);
182 Handle<String> NewExternalStringFromTwoByte( 187 Handle<String> NewExternalStringFromTwoByte(
183 const ExternalTwoByteString::Resource* resource); 188 const ExternalTwoByteString::Resource* resource);
184 189
185 // Create a symbol. 190 // Create a symbol.
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 680 }
676 681
677 private: 682 private:
678 Isolate* isolate_; 683 Isolate* isolate_;
679 }; 684 };
680 685
681 686
682 } } // namespace v8::internal 687 } } // namespace v8::internal
683 688
684 #endif // V8_FACTORY_H_ 689 #endif // V8_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698