Index: src/json-stringifier.h |
diff --git a/src/json-stringifier.h b/src/json-stringifier.h |
index 418d4794595367f088e09cbb519d65209ff7bd96..b9775c9d8a9f19b19c15c400818514f9e12da238 100644 |
--- a/src/json-stringifier.h |
+++ b/src/json-stringifier.h |
@@ -55,7 +55,7 @@ class BasicJsonStringifier BASE_EMBEDDED { |
void ChangeEncoding(); |
- void ShrinkCurrentPart(); |
+ INLINE(void ShrinkCurrentPart()); |
template <bool is_ascii, typename Char> |
INLINE(void Append_(Char c)); |
@@ -322,15 +322,7 @@ MaybeObject* BasicJsonStringifier::StringifyString_(Isolate* isolate, |
dest->GetChars() + 1, |
string->length()); |
dest->Set(final_size++, '\"'); |
- if (isolate->heap()->InNewSpace(*result)) { |
- // In new space, simply lower the allocation top to fit the actual size. |
- isolate->heap()->new_space()->ShrinkStringAtAllocationBoundary<StringType>( |
- *result, final_size); |
- return *result; |
- } else { |
- // Not in new space, need to fill the wasted space with filler objects. |
- return SeqString::cast(*result)->Truncate(final_size); |
- } |
+ return *SeqString::Truncate(Handle<SeqString>::cast(result), final_size); |
} |
@@ -697,8 +689,8 @@ BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject( |
void BasicJsonStringifier::ShrinkCurrentPart() { |
ASSERT(current_index_ < part_length_); |
- current_part_ = Handle<String>( |
- SeqString::cast(*current_part_)->Truncate(current_index_), isolate_); |
+ current_part_ = SeqString::Truncate(Handle<SeqString>::cast(current_part_), |
+ current_index_); |
} |