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

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

Issue 11040021: Fix slot recording of code target patches. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Ulan Degenbaev. Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4061 matching lines...) Expand 10 before | Expand all | Expand 10 after
4072 target_page->slots_buffer_address(), 4072 target_page->slots_buffer_address(),
4073 SlotsBuffer::CODE_ENTRY_SLOT, 4073 SlotsBuffer::CODE_ENTRY_SLOT,
4074 slot, 4074 slot,
4075 SlotsBuffer::FAIL_ON_OVERFLOW)) { 4075 SlotsBuffer::FAIL_ON_OVERFLOW)) {
4076 EvictEvacuationCandidate(target_page); 4076 EvictEvacuationCandidate(target_page);
4077 } 4077 }
4078 } 4078 }
4079 } 4079 }
4080 4080
4081 4081
4082 void MarkCompactCollector::RecordCodeTargetPatch(Address pc, Code* target) {
4083 ASSERT(heap()->gc_state() == Heap::MARK_COMPACT);
4084 if(is_compacting()) {
4085 Code* host = heap()->isolate()->inner_pointer_to_code_cache()->
4086 GcSafeFindCodeForInnerPointer(pc);
4087 MarkBit mark_bit = Marking::MarkBitFrom(host);
4088 if (Marking::IsBlack(mark_bit)) {
4089 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
4090 RecordRelocSlot(&rinfo, target);
4091 }
4092 }
4093 }
4094
4095
4082 static inline SlotsBuffer::SlotType DecodeSlotType( 4096 static inline SlotsBuffer::SlotType DecodeSlotType(
4083 SlotsBuffer::ObjectSlot slot) { 4097 SlotsBuffer::ObjectSlot slot) {
4084 return static_cast<SlotsBuffer::SlotType>(reinterpret_cast<intptr_t>(slot)); 4098 return static_cast<SlotsBuffer::SlotType>(reinterpret_cast<intptr_t>(slot));
4085 } 4099 }
4086 4100
4087 4101
4088 void SlotsBuffer::UpdateSlots(Heap* heap) { 4102 void SlotsBuffer::UpdateSlots(Heap* heap) {
4089 PointersUpdatingVisitor v(heap); 4103 PointersUpdatingVisitor v(heap);
4090 4104
4091 for (int slot_idx = 0; slot_idx < idx_; ++slot_idx) { 4105 for (int slot_idx = 0; slot_idx < idx_; ++slot_idx) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
4141 while (buffer != NULL) { 4155 while (buffer != NULL) {
4142 SlotsBuffer* next_buffer = buffer->next(); 4156 SlotsBuffer* next_buffer = buffer->next();
4143 DeallocateBuffer(buffer); 4157 DeallocateBuffer(buffer);
4144 buffer = next_buffer; 4158 buffer = next_buffer;
4145 } 4159 }
4146 *buffer_address = NULL; 4160 *buffer_address = NULL;
4147 } 4161 }
4148 4162
4149 4163
4150 } } // namespace v8::internal 4164 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698