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

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

Issue 13880031: GDBJIT: Remove codes when they are garbage collected. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/gdb-jit.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 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 3099 matching lines...) Expand 10 before | Expand all | Expand 10 after
3110 ASSERT(static_cast<unsigned>(cell_index) == 3110 ASSERT(static_cast<unsigned>(cell_index) ==
3111 Bitmap::IndexToCell( 3111 Bitmap::IndexToCell(
3112 Bitmap::CellAlignIndex( 3112 Bitmap::CellAlignIndex(
3113 p->AddressToMarkbitIndex(object_address)))); 3113 p->AddressToMarkbitIndex(object_address))));
3114 int live_objects = MarkWordToObjectStarts(cells[cell_index], offsets); 3114 int live_objects = MarkWordToObjectStarts(cells[cell_index], offsets);
3115 int live_index = 0; 3115 int live_index = 0;
3116 for ( ; live_objects != 0; live_objects--) { 3116 for ( ; live_objects != 0; live_objects--) {
3117 Address free_end = object_address + offsets[live_index++] * kPointerSize; 3117 Address free_end = object_address + offsets[live_index++] * kPointerSize;
3118 if (free_end != free_start) { 3118 if (free_end != free_start) {
3119 space->Free(free_start, static_cast<int>(free_end - free_start)); 3119 space->Free(free_start, static_cast<int>(free_end - free_start));
3120 #ifdef ENABLE_GDB_JIT_INTERFACE
Michael Starzinger 2013/07/03 11:18:50 I am not particularly fond of plastering GDBJIT en
3121 if (FLAG_gdbjit && space->identity() == CODE_SPACE) {
3122 GDBJITInterface::RemoveCodeRange(free_start, free_end);
3123 }
3124 #endif
3120 } 3125 }
3121 HeapObject* live_object = HeapObject::FromAddress(free_end); 3126 HeapObject* live_object = HeapObject::FromAddress(free_end);
3122 ASSERT(Marking::IsBlack(Marking::MarkBitFrom(live_object))); 3127 ASSERT(Marking::IsBlack(Marking::MarkBitFrom(live_object)));
3123 Map* map = live_object->map(); 3128 Map* map = live_object->map();
3124 int size = live_object->SizeFromMap(map); 3129 int size = live_object->SizeFromMap(map);
3125 if (sweeping_mode == SWEEP_AND_VISIT_LIVE_OBJECTS) { 3130 if (sweeping_mode == SWEEP_AND_VISIT_LIVE_OBJECTS) {
3126 live_object->IterateBody(map->instance_type(), size, v); 3131 live_object->IterateBody(map->instance_type(), size, v);
3127 } 3132 }
3128 if ((skip_list_mode == REBUILD_SKIP_LIST) && skip_list != NULL) { 3133 if ((skip_list_mode == REBUILD_SKIP_LIST) && skip_list != NULL) {
3129 int new_region_start = 3134 int new_region_start =
3130 SkipList::RegionNumber(free_end); 3135 SkipList::RegionNumber(free_end);
3131 int new_region_end = 3136 int new_region_end =
3132 SkipList::RegionNumber(free_end + size - kPointerSize); 3137 SkipList::RegionNumber(free_end + size - kPointerSize);
3133 if (new_region_start != curr_region || 3138 if (new_region_start != curr_region ||
3134 new_region_end != curr_region) { 3139 new_region_end != curr_region) {
3135 skip_list->AddObject(free_end, size); 3140 skip_list->AddObject(free_end, size);
3136 curr_region = new_region_end; 3141 curr_region = new_region_end;
3137 } 3142 }
3138 } 3143 }
3139 free_start = free_end + size; 3144 free_start = free_end + size;
3140 } 3145 }
3141 // Clear marking bits for current cell. 3146 // Clear marking bits for current cell.
3142 cells[cell_index] = 0; 3147 cells[cell_index] = 0;
3143 } 3148 }
3144 if (free_start != p->area_end()) { 3149 if (free_start != p->area_end()) {
3145 space->Free(free_start, static_cast<int>(p->area_end() - free_start)); 3150 space->Free(free_start, static_cast<int>(p->area_end() - free_start));
3151 #ifdef ENABLE_GDB_JIT_INTERFACE
3152 if (FLAG_gdbjit && space->identity() == CODE_SPACE) {
3153 GDBJITInterface::RemoveCodeRange(free_start, p->area_end());
3154 }
3155 #endif
3146 } 3156 }
3147 p->ResetLiveBytes(); 3157 p->ResetLiveBytes();
3148 if (FLAG_print_cumulative_gc_stat) { 3158 if (FLAG_print_cumulative_gc_stat) {
3149 space->heap()->AddSweepingTime(OS::TimeCurrentMillis() - start_time); 3159 space->heap()->AddSweepingTime(OS::TimeCurrentMillis() - start_time);
3150 } 3160 }
3151 } 3161 }
3152 3162
3153 3163
3154 static bool SetMarkBitsUnderInvalidatedCode(Code* code, bool value) { 3164 static bool SetMarkBitsUnderInvalidatedCode(Code* code, bool value) {
3155 Page* p = Page::FromAddress(code->address()); 3165 Page* p = Page::FromAddress(code->address());
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
4286 while (buffer != NULL) { 4296 while (buffer != NULL) {
4287 SlotsBuffer* next_buffer = buffer->next(); 4297 SlotsBuffer* next_buffer = buffer->next();
4288 DeallocateBuffer(buffer); 4298 DeallocateBuffer(buffer);
4289 buffer = next_buffer; 4299 buffer = next_buffer;
4290 } 4300 }
4291 *buffer_address = NULL; 4301 *buffer_address = NULL;
4292 } 4302 }
4293 4303
4294 4304
4295 } } // namespace v8::internal 4305 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/gdb-jit.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698