Skip to content

Commit

Permalink
Fix incorrect assumption about young/old space allocation in
Browse files Browse the repository at this point in the history
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
erik.corry@gmail.com committed Dec 13, 2010
1 parent b50b984 commit 9977abb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/runtime.cc
Expand Up @@ -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));

Expand Down

0 comments on commit 9977abb

Please sign in to comment.