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

Side by Side Diff: src/heap/mark-compact.cc

Issue 1225573002: Record code slots that may point to evacuation candidate objects after deoptimizing them. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
« src/deoptimizer.cc ('K') | « src/heap/mark-compact.h ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 3233 matching lines...) Expand 10 before | Expand all | Expand 10 after
3244 Page* p = evacuation_candidates_[i]; 3244 Page* p = evacuation_candidates_[i];
3245 DCHECK(p->IsEvacuationCandidate() || 3245 DCHECK(p->IsEvacuationCandidate() ||
3246 p->IsFlagSet(Page::RESCAN_ON_EVACUATION)); 3246 p->IsFlagSet(Page::RESCAN_ON_EVACUATION));
3247 if (p->IsEvacuationCandidate()) { 3247 if (p->IsEvacuationCandidate()) {
3248 SlotsBuffer::RemoveObjectSlots(heap_, p->slots_buffer(), invalid_object); 3248 SlotsBuffer::RemoveObjectSlots(heap_, p->slots_buffer(), invalid_object);
3249 } 3249 }
3250 } 3250 }
3251 } 3251 }
3252 3252
3253 3253
3254 void MarkCompactCollector::RecordDeoptimizedCodeSlots(Code* code) {
3255 Object** reloc_info_slot = Code::RawField(code, Code::kRelocationInfoOffset);
3256 RecordSlot(reloc_info_slot, reloc_info_slot, *reloc_info_slot);
3257 Object** handler_table_slot = Code::RawField(code, Code::kHandlerTableOffset);
3258 RecordSlot(handler_table_slot, handler_table_slot, *handler_table_slot);
3259 Object** deopt_data_slot =
3260 Code::RawField(code, Code::kDeoptimizationDataOffset);
3261 RecordSlot(deopt_data_slot, deopt_data_slot, *deopt_data_slot);
3262 Object** type_feedback_slot =
3263 Code::RawField(code, Code::kTypeFeedbackInfoOffset);
3264 RecordSlot(type_feedback_slot, type_feedback_slot, *type_feedback_slot);
3265 Object** next_code_slot = Code::RawField(code, Code::kNextCodeLinkOffset);
3266 RecordSlot(next_code_slot, next_code_slot, *next_code_slot);
3267 Object** meta_data_slot = Code::RawField(code, Code::kGCMetadataOffset);
3268 RecordSlot(meta_data_slot, meta_data_slot, *meta_data_slot);
3269 Object** constant_pool_slot = Code::RawField(code, Code::kConstantPoolOffset);
3270 RecordSlot(constant_pool_slot, constant_pool_slot, *constant_pool_slot);
3271 }
3272
3273
3254 void MarkCompactCollector::EvacuateNewSpace() { 3274 void MarkCompactCollector::EvacuateNewSpace() {
3255 // There are soft limits in the allocation code, designed trigger a mark 3275 // There are soft limits in the allocation code, designed trigger a mark
3256 // sweep collection by failing allocations. But since we are already in 3276 // sweep collection by failing allocations. But since we are already in
3257 // a mark-sweep allocation, there is no sense in trying to trigger one. 3277 // a mark-sweep allocation, there is no sense in trying to trigger one.
3258 AlwaysAllocateScope scope(isolate()); 3278 AlwaysAllocateScope scope(isolate());
3259 3279
3260 NewSpace* new_space = heap()->new_space(); 3280 NewSpace* new_space = heap()->new_space();
3261 3281
3262 // Store allocation range before flipping semispaces. 3282 // Store allocation range before flipping semispaces.
3263 Address from_bottom = new_space->bottom(); 3283 Address from_bottom = new_space->bottom();
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
4695 SlotsBuffer* buffer = *buffer_address; 4715 SlotsBuffer* buffer = *buffer_address;
4696 while (buffer != NULL) { 4716 while (buffer != NULL) {
4697 SlotsBuffer* next_buffer = buffer->next(); 4717 SlotsBuffer* next_buffer = buffer->next();
4698 DeallocateBuffer(buffer); 4718 DeallocateBuffer(buffer);
4699 buffer = next_buffer; 4719 buffer = next_buffer;
4700 } 4720 }
4701 *buffer_address = NULL; 4721 *buffer_address = NULL;
4702 } 4722 }
4703 } // namespace internal 4723 } // namespace internal
4704 } // namespace v8 4724 } // namespace v8
OLDNEW
« src/deoptimizer.cc ('K') | « src/heap/mark-compact.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698