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

Side by Side Diff: src/heap.cc

Issue 13457002: Isolatify CPU profiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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/cpu-profiler.cc ('k') | src/isolate.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 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 1851
1852 // Set the forwarding address. 1852 // Set the forwarding address.
1853 source->set_map_word(MapWord::FromForwardingAddress(target)); 1853 source->set_map_word(MapWord::FromForwardingAddress(target));
1854 1854
1855 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { 1855 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) {
1856 // Update NewSpace stats if necessary. 1856 // Update NewSpace stats if necessary.
1857 RecordCopiedObject(heap, target); 1857 RecordCopiedObject(heap, target);
1858 HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address())); 1858 HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address()));
1859 Isolate* isolate = heap->isolate(); 1859 Isolate* isolate = heap->isolate();
1860 if (isolate->logger()->is_logging_code_events() || 1860 if (isolate->logger()->is_logging_code_events() ||
1861 CpuProfiler::is_profiling(isolate)) { 1861 isolate->cpu_profiler()->is_profiling()) {
1862 if (target->IsSharedFunctionInfo()) { 1862 if (target->IsSharedFunctionInfo()) {
1863 PROFILE(isolate, SharedFunctionInfoMoveEvent( 1863 PROFILE(isolate, SharedFunctionInfoMoveEvent(
1864 source->address(), target->address())); 1864 source->address(), target->address()));
1865 } 1865 }
1866 } 1866 }
1867 } 1867 }
1868 1868
1869 if (marks_handling == TRANSFER_MARKS) { 1869 if (marks_handling == TRANSFER_MARKS) {
1870 if (Marking::TransferColor(source, target)) { 1870 if (Marking::TransferColor(source, target)) {
1871 MemoryChunk::IncrementLiveBytesFromGC(target->address(), size); 1871 MemoryChunk::IncrementLiveBytesFromGC(target->address(), size);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_DISABLED>::Initialize(); 2107 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_DISABLED>::Initialize();
2108 ScavengingVisitor<TRANSFER_MARKS, 2108 ScavengingVisitor<TRANSFER_MARKS,
2109 LOGGING_AND_PROFILING_ENABLED>::Initialize(); 2109 LOGGING_AND_PROFILING_ENABLED>::Initialize();
2110 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize(); 2110 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize();
2111 } 2111 }
2112 2112
2113 2113
2114 void Heap::SelectScavengingVisitorsTable() { 2114 void Heap::SelectScavengingVisitorsTable() {
2115 bool logging_and_profiling = 2115 bool logging_and_profiling =
2116 isolate()->logger()->is_logging() || 2116 isolate()->logger()->is_logging() ||
2117 CpuProfiler::is_profiling(isolate()) || 2117 isolate()->cpu_profiler()->is_profiling() ||
2118 (isolate()->heap_profiler() != NULL && 2118 (isolate()->heap_profiler() != NULL &&
2119 isolate()->heap_profiler()->is_profiling()); 2119 isolate()->heap_profiler()->is_profiling());
2120 2120
2121 if (!incremental_marking()->IsMarking()) { 2121 if (!incremental_marking()->IsMarking()) {
2122 if (!logging_and_profiling) { 2122 if (!logging_and_profiling) {
2123 scavenging_visitors_table_.CopyFrom( 2123 scavenging_visitors_table_.CopyFrom(
2124 ScavengingVisitor<IGNORE_MARKS, 2124 ScavengingVisitor<IGNORE_MARKS,
2125 LOGGING_AND_PROFILING_DISABLED>::GetTable()); 2125 LOGGING_AND_PROFILING_DISABLED>::GetTable());
2126 } else { 2126 } else {
2127 scavenging_visitors_table_.CopyFrom( 2127 scavenging_visitors_table_.CopyFrom(
(...skipping 5692 matching lines...) Expand 10 before | Expand all | Expand 10 after
7820 static_cast<int>(object_sizes_last_time_[index])); 7820 static_cast<int>(object_sizes_last_time_[index]));
7821 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7821 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7822 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7822 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7823 7823
7824 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7824 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7825 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7825 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7826 ClearObjectStats(); 7826 ClearObjectStats();
7827 } 7827 }
7828 7828
7829 } } // namespace v8::internal 7829 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/cpu-profiler.cc ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698