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

Unified Diff: src/runtime.cc

Issue 7003083: Don't allocate handles for substrings when filling up the split result array. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 8234)
+++ src/runtime.cc (working copy)
@@ -5805,11 +5805,14 @@
Handle<FixedArray> elements(FixedArray::cast(result->elements()));
int part_start = 0;
for (int i = 0; i < part_count; i++) {
- HandleScope local_loop_handle;
int part_end = indices.at(i);
- Handle<String> substring =
- isolate->factory()->NewSubString(subject, part_start, part_end);
- elements->set(i, *substring);
+ Object* result;
+ { MaybeObject* maybe_result = isolate->heap()->AllocateSubString(*subject,
+ part_start,
Lasse Reichstein 2011/06/10 07:32:17 This is an unpretty combination of handle and non-
sandholm 2011/06/10 10:13:31 Done.
+ part_end);
+ if (!maybe_result->ToObject(&result)) return maybe_result;
+ }
+ elements->set(i, result);
part_start = part_end + pattern_length;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698