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

Side by Side Diff: src/heap.cc

Issue 12475016: Maintain API compatibility with older versions of V8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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/execution.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 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 1847
1848 // Set the forwarding address. 1848 // Set the forwarding address.
1849 source->set_map_word(MapWord::FromForwardingAddress(target)); 1849 source->set_map_word(MapWord::FromForwardingAddress(target));
1850 1850
1851 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { 1851 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) {
1852 // Update NewSpace stats if necessary. 1852 // Update NewSpace stats if necessary.
1853 RecordCopiedObject(heap, target); 1853 RecordCopiedObject(heap, target);
1854 HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address())); 1854 HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address()));
1855 Isolate* isolate = heap->isolate(); 1855 Isolate* isolate = heap->isolate();
1856 if (isolate->logger()->is_logging_code_events() || 1856 if (isolate->logger()->is_logging_code_events() ||
1857 isolate->cpu_profiler()->is_profiling()) { 1857 CpuProfiler::is_profiling(isolate)) {
1858 if (target->IsSharedFunctionInfo()) { 1858 if (target->IsSharedFunctionInfo()) {
1859 PROFILE(isolate, SharedFunctionInfoMoveEvent( 1859 PROFILE(isolate, SharedFunctionInfoMoveEvent(
1860 source->address(), target->address())); 1860 source->address(), target->address()));
1861 } 1861 }
1862 } 1862 }
1863 } 1863 }
1864 1864
1865 if (marks_handling == TRANSFER_MARKS) { 1865 if (marks_handling == TRANSFER_MARKS) {
1866 if (Marking::TransferColor(source, target)) { 1866 if (Marking::TransferColor(source, target)) {
1867 MemoryChunk::IncrementLiveBytesFromGC(target->address(), size); 1867 MemoryChunk::IncrementLiveBytesFromGC(target->address(), size);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_DISABLED>::Initialize(); 2103 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_DISABLED>::Initialize();
2104 ScavengingVisitor<TRANSFER_MARKS, 2104 ScavengingVisitor<TRANSFER_MARKS,
2105 LOGGING_AND_PROFILING_ENABLED>::Initialize(); 2105 LOGGING_AND_PROFILING_ENABLED>::Initialize();
2106 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize(); 2106 ScavengingVisitor<IGNORE_MARKS, LOGGING_AND_PROFILING_ENABLED>::Initialize();
2107 } 2107 }
2108 2108
2109 2109
2110 void Heap::SelectScavengingVisitorsTable() { 2110 void Heap::SelectScavengingVisitorsTable() {
2111 bool logging_and_profiling = 2111 bool logging_and_profiling =
2112 isolate()->logger()->is_logging() || 2112 isolate()->logger()->is_logging() ||
2113 isolate()->cpu_profiler()->is_profiling() || 2113 CpuProfiler::is_profiling(isolate()) ||
2114 (isolate()->heap_profiler() != NULL && 2114 (isolate()->heap_profiler() != NULL &&
2115 isolate()->heap_profiler()->is_profiling()); 2115 isolate()->heap_profiler()->is_profiling());
2116 2116
2117 if (!incremental_marking()->IsMarking()) { 2117 if (!incremental_marking()->IsMarking()) {
2118 if (!logging_and_profiling) { 2118 if (!logging_and_profiling) {
2119 scavenging_visitors_table_.CopyFrom( 2119 scavenging_visitors_table_.CopyFrom(
2120 ScavengingVisitor<IGNORE_MARKS, 2120 ScavengingVisitor<IGNORE_MARKS,
2121 LOGGING_AND_PROFILING_DISABLED>::GetTable()); 2121 LOGGING_AND_PROFILING_DISABLED>::GetTable());
2122 } else { 2122 } else {
2123 scavenging_visitors_table_.CopyFrom( 2123 scavenging_visitors_table_.CopyFrom(
(...skipping 5688 matching lines...) Expand 10 before | Expand all | Expand 10 after
7812 static_cast<int>(object_sizes_last_time_[index])); 7812 static_cast<int>(object_sizes_last_time_[index]));
7813 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7813 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7814 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7814 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7815 7815
7816 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7816 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7817 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7817 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7818 ClearObjectStats(); 7818 ClearObjectStats();
7819 } 7819 }
7820 7820
7821 } } // namespace v8::internal 7821 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | src/heap-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698