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

Side by Side Diff: src/heap.cc

Issue 94993004: Move heap profiler state flags to HeapProfiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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/builtins.cc ('k') | src/heap-profiler.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 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 heap->CopyBlock(target->address(), source->address(), size); 2189 heap->CopyBlock(target->address(), source->address(), size);
2190 2190
2191 // Set the forwarding address. 2191 // Set the forwarding address.
2192 source->set_map_word(MapWord::FromForwardingAddress(target)); 2192 source->set_map_word(MapWord::FromForwardingAddress(target));
2193 2193
2194 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { 2194 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) {
2195 // Update NewSpace stats if necessary. 2195 // Update NewSpace stats if necessary.
2196 RecordCopiedObject(heap, target); 2196 RecordCopiedObject(heap, target);
2197 Isolate* isolate = heap->isolate(); 2197 Isolate* isolate = heap->isolate();
2198 HeapProfiler* heap_profiler = isolate->heap_profiler(); 2198 HeapProfiler* heap_profiler = isolate->heap_profiler();
2199 if (heap_profiler->is_profiling()) { 2199 if (heap_profiler->is_tracking_object_moves()) {
2200 heap_profiler->ObjectMoveEvent(source->address(), target->address(), 2200 heap_profiler->ObjectMoveEvent(source->address(), target->address(),
2201 size); 2201 size);
2202 } 2202 }
2203 if (isolate->logger()->is_logging_code_events() || 2203 if (isolate->logger()->is_logging_code_events() ||
2204 isolate->cpu_profiler()->is_profiling()) { 2204 isolate->cpu_profiler()->is_profiling()) {
2205 if (target->IsSharedFunctionInfo()) { 2205 if (target->IsSharedFunctionInfo()) {
2206 PROFILE(isolate, SharedFunctionInfoMoveEvent( 2206 PROFILE(isolate, SharedFunctionInfoMoveEvent(
2207 source->address(), target->address())); 2207 source->address(), target->address()));
2208 } 2208 }
2209 } 2209 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2440 LOGGING_AND_PROFILING_ENABLED>::Initialize(); 2440 LOGGING_AND_PROFILING_ENABLED>::Initialize();
2441 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize(); 2441 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize();
2442 } 2442 }
2443 2443
2444 2444
2445 void Heap::SelectScavengingVisitorsTable() { 2445 void Heap::SelectScavengingVisitorsTable() {
2446 bool logging_and_profiling = 2446 bool logging_and_profiling =
2447 isolate()->logger()->is_logging() || 2447 isolate()->logger()->is_logging() ||
2448 isolate()->cpu_profiler()->is_profiling() || 2448 isolate()->cpu_profiler()->is_profiling() ||
2449 (isolate()->heap_profiler() != NULL && 2449 (isolate()->heap_profiler() != NULL &&
2450 isolate()->heap_profiler()->is_profiling()); 2450 isolate()->heap_profiler()->is_tracking_object_moves());
2451 2451
2452 if (!incremental_marking()->IsMarking()) { 2452 if (!incremental_marking()->IsMarking()) {
2453 if (!logging_and_profiling) { 2453 if (!logging_and_profiling) {
2454 scavenging_visitors_table_.CopyFrom( 2454 scavenging_visitors_table_.CopyFrom(
2455 ScavengingVisitor<IGNORE_MARKS, 2455 ScavengingVisitor<IGNORE_MARKS,
2456 LOGGING_AND_PROFILING_DISABLED>::GetTable()); 2456 LOGGING_AND_PROFILING_DISABLED>::GetTable());
2457 } else { 2457 } else {
2458 scavenging_visitors_table_.CopyFrom( 2458 scavenging_visitors_table_.CopyFrom(
2459 ScavengingVisitor<IGNORE_MARKS, 2459 ScavengingVisitor<IGNORE_MARKS,
2460 LOGGING_AND_PROFILING_ENABLED>::GetTable()); 2460 LOGGING_AND_PROFILING_ENABLED>::GetTable());
(...skipping 5534 matching lines...) Expand 10 before | Expand all | Expand 10 after
7995 static_cast<int>(object_sizes_last_time_[index])); 7995 static_cast<int>(object_sizes_last_time_[index]));
7996 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7996 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7997 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7997 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7998 7998
7999 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7999 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
8000 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 8000 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
8001 ClearObjectStats(); 8001 ClearObjectStats();
8002 } 8002 }
8003 8003
8004 } } // namespace v8::internal 8004 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/heap-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698