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

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

Issue 9361026: Count-based profiling for primitive functions (hidden behind a flag) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: more comments Created 8 years, 10 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/ic-inl.h ('k') | src/objects.h » ('j') | 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 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 2356
2357 // Remove object groups after marking phase. 2357 // Remove object groups after marking phase.
2358 heap()->isolate()->global_handles()->RemoveObjectGroups(); 2358 heap()->isolate()->global_handles()->RemoveObjectGroups();
2359 heap()->isolate()->global_handles()->RemoveImplicitRefGroups(); 2359 heap()->isolate()->global_handles()->RemoveImplicitRefGroups();
2360 2360
2361 // Flush code from collected candidates. 2361 // Flush code from collected candidates.
2362 if (is_code_flushing_enabled()) { 2362 if (is_code_flushing_enabled()) {
2363 code_flusher_->ProcessCandidates(); 2363 code_flusher_->ProcessCandidates();
2364 } 2364 }
2365 2365
2366 // Clean up dead objects from the runtime profiler. 2366 if (!FLAG_counting_profiler) {
2367 heap()->isolate()->runtime_profiler()->RemoveDeadSamples(); 2367 // Clean up dead objects from the runtime profiler.
2368 heap()->isolate()->runtime_profiler()->RemoveDeadSamples();
2369 }
2368 } 2370 }
2369 2371
2370 2372
2371 void MarkCompactCollector::ProcessMapCaches() { 2373 void MarkCompactCollector::ProcessMapCaches() {
2372 Object* raw_context = heap()->global_contexts_list_; 2374 Object* raw_context = heap()->global_contexts_list_;
2373 while (raw_context != heap()->undefined_value()) { 2375 while (raw_context != heap()->undefined_value()) {
2374 Context* context = reinterpret_cast<Context*>(raw_context); 2376 Context* context = reinterpret_cast<Context*>(raw_context);
2375 if (IsMarked(context)) { 2377 if (IsMarked(context)) {
2376 HeapObject* raw_map_cache = 2378 HeapObject* raw_map_cache =
2377 HeapObject::cast(context->get(Context::MAP_CACHE_INDEX)); 2379 HeapObject::cast(context->get(Context::MAP_CACHE_INDEX));
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 3366
3365 // Update pointer from the global contexts list. 3367 // Update pointer from the global contexts list.
3366 updating_visitor.VisitPointer(heap_->global_contexts_list_address()); 3368 updating_visitor.VisitPointer(heap_->global_contexts_list_address());
3367 3369
3368 heap_->symbol_table()->Iterate(&updating_visitor); 3370 heap_->symbol_table()->Iterate(&updating_visitor);
3369 3371
3370 // Update pointers from external string table. 3372 // Update pointers from external string table.
3371 heap_->UpdateReferencesInExternalStringTable( 3373 heap_->UpdateReferencesInExternalStringTable(
3372 &UpdateReferenceInExternalStringTableEntry); 3374 &UpdateReferenceInExternalStringTableEntry);
3373 3375
3374 // Update JSFunction pointers from the runtime profiler. 3376 if (!FLAG_counting_profiler) {
3375 heap()->isolate()->runtime_profiler()->UpdateSamplesAfterCompact( 3377 // Update JSFunction pointers from the runtime profiler.
3376 &updating_visitor); 3378 heap()->isolate()->runtime_profiler()->UpdateSamplesAfterCompact(
3379 &updating_visitor);
3380 }
3377 3381
3378 EvacuationWeakObjectRetainer evacuation_object_retainer; 3382 EvacuationWeakObjectRetainer evacuation_object_retainer;
3379 heap()->ProcessWeakReferences(&evacuation_object_retainer); 3383 heap()->ProcessWeakReferences(&evacuation_object_retainer);
3380 3384
3381 // Visit invalidated code (we ignored all slots on it) and clear mark-bits 3385 // Visit invalidated code (we ignored all slots on it) and clear mark-bits
3382 // under it. 3386 // under it.
3383 ProcessInvalidatedCode(&updating_visitor); 3387 ProcessInvalidatedCode(&updating_visitor);
3384 3388
3385 #ifdef DEBUG 3389 #ifdef DEBUG
3386 if (FLAG_verify_heap) { 3390 if (FLAG_verify_heap) {
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
4097 while (buffer != NULL) { 4101 while (buffer != NULL) {
4098 SlotsBuffer* next_buffer = buffer->next(); 4102 SlotsBuffer* next_buffer = buffer->next();
4099 DeallocateBuffer(buffer); 4103 DeallocateBuffer(buffer);
4100 buffer = next_buffer; 4104 buffer = next_buffer;
4101 } 4105 }
4102 *buffer_address = NULL; 4106 *buffer_address = NULL;
4103 } 4107 }
4104 4108
4105 4109
4106 } } // namespace v8::internal 4110 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic-inl.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698