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

Unified Diff: src/json-parser.cc

Issue 6976027: Merge revision 8082 to trunk (fixes crbug 83877) (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 7 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 | « src/json-parser.h ('k') | src/version.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.cc
===================================================================
--- src/json-parser.cc (revision 8082)
+++ src/json-parser.cc (working copy)
@@ -380,7 +380,7 @@
while (c0_ != '"') {
// Create new seq string
if (count >= kInitialSpecialStringSize * allocation_count) {
- allocation_count++;
+ allocation_count = allocation_count * 2;
int new_size = allocation_count * kInitialSpecialStringSize;
Handle<String> new_two_byte =
isolate()->factory()->NewRawTwoByteString(new_size,
@@ -443,10 +443,18 @@
Advance();
// Shrink the the string to our length.
- isolate()->heap()->
- new_space()->
- ShrinkStringAtAllocationBoundary<SeqTwoByteString>(*seq_two_byte,
- count);
+ if (isolate()->heap()->InNewSpace(*seq_two_byte)) {
+ isolate()->heap()->new_space()->
+ ShrinkStringAtAllocationBoundary<SeqTwoByteString>(*seq_two_byte,
+ count);
+ } else {
+ int string_size = SeqTwoByteString::SizeFor(count);
+ int allocated_string_size =
+ SeqTwoByteString::SizeFor(kInitialSpecialStringSize * allocation_count);
+ int delta = allocated_string_size - string_size;
+ Address start_filler_object = seq_two_byte->address() + string_size;
+ isolate()->heap()->CreateFillerObjectAt(start_filler_object, delta);
+ }
string_val_ = isolate()->factory()->NewConsString(ascii, seq_two_byte);
return Token::STRING;
}
« no previous file with comments | « src/json-parser.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698