Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix incorrect assumption about young/old space allocation in

JSON stringify (introduced in r5951).
Review URL: http://codereview.chromium.org/5746005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information...
commit 9977abb42ae9bce6089e3a4e717cc6f8d73e7155 1 parent b50b984
erik.corry@gmail.com authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/runtime.cc
View
7 src/runtime.cc
@@ -4689,6 +4689,13 @@ static MaybeObject* QuoteJsonString(Vector<const Char> characters) {
if (!new_alloc->ToObject(&new_object)) {
return new_alloc;
}
+ if (!Heap::new_space()->Contains(new_object)) {
+ // Even if our string is small enough to fit in new space we still have to
+ // handle it being allocated in old space as may happen in the third
+ // attempt. See CALL_AND_RETRY in heap-inl.h and similar code in
+ // CEntryStub::GenerateCore.
+ return SlowQuoteJsonString<Char, StringType>(characters);
+ }
StringType* new_string = StringType::cast(new_object);
ASSERT(Heap::new_space()->Contains(new_string));
Please sign in to comment.
Something went wrong with that request. Please try again.