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

Unified Diff: src/objects.cc

Issue 1376753002: [heap] Remove NewSpace::set_top and the corresponding hack (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/heap/spaces.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index b6c40d67fe8a64c13d4f7b44779e47281956a306..08383030d8ea63793ffd24ab057cb6df42363caa 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9928,16 +9928,9 @@ Handle<String> SeqString::Truncate(Handle<SeqString> string, int new_length) {
DCHECK_OBJECT_ALIGNED(start_of_string + new_size);
Heap* heap = string->GetHeap();
- NewSpace* newspace = heap->new_space();
- if (newspace->Contains(start_of_string) &&
- newspace->top() == start_of_string + old_size) {
- // Last allocated object in new space. Simply lower allocation top.
- newspace->set_top(start_of_string + new_size);
- } else {
- // Sizes are pointer size aligned, so that we can use filler objects
- // that are a multiple of pointer size.
- heap->CreateFillerObjectAt(start_of_string + new_size, delta);
- }
+ // Sizes are pointer size aligned, so that we can use filler objects
+ // that are a multiple of pointer size.
+ heap->CreateFillerObjectAt(start_of_string + new_size, delta);
heap->AdjustLiveBytes(*string, -delta, Heap::CONCURRENT_TO_SWEEPER);
// We are storing the new length using release store after creating a filler
« no previous file with comments | « src/heap/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698