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

Side by Side Diff: src/factory.h

Issue 114943004: Reland "Handlify concat string and substring." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix test case. Created 7 years 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // characters of the string are uninitialized. Currently used in regexp code 151 // characters of the string are uninitialized. Currently used in regexp code
152 // only, where they are pretenured. 152 // only, where they are pretenured.
153 Handle<SeqOneByteString> NewRawOneByteString( 153 Handle<SeqOneByteString> NewRawOneByteString(
154 int length, 154 int length,
155 PretenureFlag pretenure = NOT_TENURED); 155 PretenureFlag pretenure = NOT_TENURED);
156 Handle<SeqTwoByteString> NewRawTwoByteString( 156 Handle<SeqTwoByteString> NewRawTwoByteString(
157 int length, 157 int length,
158 PretenureFlag pretenure = NOT_TENURED); 158 PretenureFlag pretenure = NOT_TENURED);
159 159
160 // Create a new cons string object which consists of a pair of strings. 160 // Create a new cons string object which consists of a pair of strings.
161 Handle<String> NewConsString(Handle<String> first, 161 Handle<String> NewConsString(Handle<String> left,
162 Handle<String> second); 162 Handle<String> right);
163
164 Handle<ConsString> NewRawConsString(String::Encoding encoding);
163 165
164 // Create a new sequential string containing the concatenation of the inputs. 166 // Create a new sequential string containing the concatenation of the inputs.
165 Handle<String> NewFlatConcatString(Handle<String> first, 167 Handle<String> NewFlatConcatString(Handle<String> first,
166 Handle<String> second); 168 Handle<String> second);
167 169
168 // Create a new string object which holds a substring of a string.
169 Handle<String> NewSubString(Handle<String> str,
170 int begin,
171 int end);
172
173 // Create a new string object which holds a proper substring of a string. 170 // Create a new string object which holds a proper substring of a string.
174 Handle<String> NewProperSubString(Handle<String> str, 171 Handle<String> NewProperSubString(Handle<String> str,
175 int begin, 172 int begin,
176 int end); 173 int end);
177 174
175 // Create a new string object which holds a substring of a string.
176 Handle<String> NewSubString(Handle<String> str, int begin, int end) {
177 if (begin == 0 && end == str->length()) return str;
178 return NewProperSubString(str, begin, end);
179 }
180
181 Handle<SlicedString> NewRawSlicedString(String::Encoding encoding);
182
178 // Creates a new external String object. There are two String encodings 183 // Creates a new external String object. There are two String encodings
179 // in the system: ASCII and two byte. Unlike other String types, it does 184 // in the system: ASCII and two byte. Unlike other String types, it does
180 // not make sense to have a UTF-8 factory function for external strings, 185 // not make sense to have a UTF-8 factory function for external strings,
181 // because we cannot change the underlying buffer. 186 // because we cannot change the underlying buffer.
182 Handle<String> NewExternalStringFromAscii( 187 Handle<String> NewExternalStringFromAscii(
183 const ExternalAsciiString::Resource* resource); 188 const ExternalAsciiString::Resource* resource);
184 Handle<String> NewExternalStringFromTwoByte( 189 Handle<String> NewExternalStringFromTwoByte(
185 const ExternalTwoByteString::Resource* resource); 190 const ExternalTwoByteString::Resource* resource);
186 191
187 // Create a symbol. 192 // Create a symbol.
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 isolate()); 593 isolate());
589 } else { 594 } else {
590 return NewNumber(static_cast<double>(value), pretenure); 595 return NewNumber(static_cast<double>(value), pretenure);
591 } 596 }
592 } 597 }
593 598
594 599
595 } } // namespace v8::internal 600 } } // namespace v8::internal
596 601
597 #endif // V8_FACTORY_H_ 602 #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