Chromium Code Reviews| Index: src/json-stringifier.h |
| diff --git a/src/json-stringifier.h b/src/json-stringifier.h |
| index 80ef39507812207ac5dbaa690b51855bfd522793..2399395396aa28c601cd5a4a88c07a85e12cbfc5 100644 |
| --- a/src/json-stringifier.h |
| +++ b/src/json-stringifier.h |
| @@ -603,26 +603,7 @@ void BasicJsonStringifier::ShrinkCurrentPart() { |
| return; |
| } |
| - int string_size, allocated_string_size; |
| - if (is_ascii_) { |
| - allocated_string_size = SeqOneByteString::SizeFor(part_length_); |
| - string_size = SeqOneByteString::SizeFor(current_index_); |
| - } else { |
| - allocated_string_size = SeqTwoByteString::SizeFor(part_length_); |
| - string_size = SeqTwoByteString::SizeFor(current_index_); |
| - } |
| - |
| - int delta = allocated_string_size - string_size; |
| - current_part_->set_length(current_index_); |
| - |
| - // String sizes are pointer size aligned, so that we can use filler objects |
| - // that are a multiple of pointer size. |
| - Address end_of_string = current_part_->address() + string_size; |
| - isolate_->heap()->CreateFillerObjectAt(end_of_string, delta); |
| - if (Marking::IsBlack(Marking::MarkBitFrom(*current_part_))) { |
| - MemoryChunk::IncrementLiveBytesFromMutator( |
| - current_part_->address(), -delta); |
| - } |
| + SeqString::cast(*current_part_)->Truncate(current_index_); |
|
Toon Verwaest
2012/12/05 14:29:12
Runtime_Truncate returns the resulting string; and
|
| } |