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

Side by Side Diff: src/factory.cc

Issue 7230006: Inctroduce NewStrictSubstring to avoid check for SubString(str, 0, str.length... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 6 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/factory.h ('k') | src/json.js » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 Handle<String> Factory::NewSubString(Handle<String> str, 208 Handle<String> Factory::NewSubString(Handle<String> str,
209 int begin, 209 int begin,
210 int end) { 210 int end) {
211 CALL_HEAP_FUNCTION(isolate(), 211 CALL_HEAP_FUNCTION(isolate(),
212 str->SubString(begin, end), 212 str->SubString(begin, end),
213 String); 213 String);
214 } 214 }
215 215
216 216
217 Handle<String> Factory::NewStrictSubString(Handle<String> str,
218 int begin,
219 int end) {
220 ASSERT(begin > 0 || end < str->length());
221 CALL_HEAP_FUNCTION(isolate(),
222 isolate()->heap()->AllocateSubString(*str, begin, end),
223 String);
224 }
225
226
217 Handle<String> Factory::NewExternalStringFromAscii( 227 Handle<String> Factory::NewExternalStringFromAscii(
218 ExternalAsciiString::Resource* resource) { 228 ExternalAsciiString::Resource* resource) {
219 CALL_HEAP_FUNCTION( 229 CALL_HEAP_FUNCTION(
220 isolate(), 230 isolate(),
221 isolate()->heap()->AllocateExternalStringFromAscii(resource), 231 isolate()->heap()->AllocateExternalStringFromAscii(resource),
222 String); 232 String);
223 } 233 }
224 234
225 235
226 Handle<String> Factory::NewExternalStringFromTwoByte( 236 Handle<String> Factory::NewExternalStringFromTwoByte(
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 Execution::ConfigureInstance(instance, 1240 Execution::ConfigureInstance(instance,
1231 instance_template, 1241 instance_template,
1232 pending_exception); 1242 pending_exception);
1233 } else { 1243 } else {
1234 *pending_exception = false; 1244 *pending_exception = false;
1235 } 1245 }
1236 } 1246 }
1237 1247
1238 1248
1239 } } // namespace v8::internal 1249 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698