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

Side by Side Diff: src/heap/spaces.cc

Issue 1068833002: More robust when allocation fails during compaction (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/full-codegen.h" 9 #include "src/full-codegen.h"
10 #include "src/heap/mark-compact.h" 10 #include "src/heap/mark-compact.h"
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 Page* page = static_cast<Page*>(emergency_memory_); 1157 Page* page = static_cast<Page*>(emergency_memory_);
1158 DCHECK(page->LiveBytes() == 0); 1158 DCHECK(page->LiveBytes() == 0);
1159 DCHECK(AreaSize() == page->area_size()); 1159 DCHECK(AreaSize() == page->area_size());
1160 DCHECK(!free_list_.ContainsPageFreeListItems(page)); 1160 DCHECK(!free_list_.ContainsPageFreeListItems(page));
1161 heap()->isolate()->memory_allocator()->Free(page); 1161 heap()->isolate()->memory_allocator()->Free(page);
1162 emergency_memory_ = NULL; 1162 emergency_memory_ = NULL;
1163 } 1163 }
1164 1164
1165 1165
1166 void PagedSpace::UseEmergencyMemory() { 1166 void PagedSpace::UseEmergencyMemory() {
1167 // Page::Initialize makes the chunk into a real page and adds it to the
1168 // accounting for this space. Unlike PagedSpace::Expand, we don't check
1169 // CanExpand first, so we can go over the limits a little here. That's OK,
1170 // because we are in the process of compacting which will free up at least as
1171 // much memory as it allocates.
1167 Page* page = Page::Initialize(heap(), emergency_memory_, executable(), this); 1172 Page* page = Page::Initialize(heap(), emergency_memory_, executable(), this);
1168 page->InsertAfter(anchor_.prev_page()); 1173 page->InsertAfter(anchor_.prev_page());
1169 emergency_memory_ = NULL; 1174 emergency_memory_ = NULL;
1170 } 1175 }
1171 1176
1172 1177
1173 #ifdef DEBUG 1178 #ifdef DEBUG
1174 void PagedSpace::Print() {} 1179 void PagedSpace::Print() {}
1175 #endif 1180 #endif
1176 1181
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
3142 object->ShortPrint(); 3147 object->ShortPrint();
3143 PrintF("\n"); 3148 PrintF("\n");
3144 } 3149 }
3145 printf(" --------------------------------------\n"); 3150 printf(" --------------------------------------\n");
3146 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3151 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3147 } 3152 }
3148 3153
3149 #endif // DEBUG 3154 #endif // DEBUG
3150 } 3155 }
3151 } // namespace v8::internal 3156 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698