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

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

Issue 27023003: Add histograms to track fraction of heap spaces and percentage of crankshaft code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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
« src/heap.h ('K') | « src/heap.cc ('k') | src/v8-counters.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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 JSFunction* next_candidate; 999 JSFunction* next_candidate;
1000 while (candidate != NULL) { 1000 while (candidate != NULL) {
1001 next_candidate = GetNextCandidate(candidate); 1001 next_candidate = GetNextCandidate(candidate);
1002 ClearNextCandidate(candidate, undefined); 1002 ClearNextCandidate(candidate, undefined);
1003 1003
1004 SharedFunctionInfo* shared = candidate->shared(); 1004 SharedFunctionInfo* shared = candidate->shared();
1005 1005
1006 Code* code = shared->code(); 1006 Code* code = shared->code();
1007 MarkBit code_mark = Marking::MarkBitFrom(code); 1007 MarkBit code_mark = Marking::MarkBitFrom(code);
1008 if (!code_mark.Get()) { 1008 if (!code_mark.Get()) {
1009 if (FLAG_trace_code_flushing && shared->is_compiled()) { 1009 if (shared->is_compiled()) {
1010 PrintF("[code-flushing clears: "); 1010 isolate_->heap()->DecrementCodeGeneratedBytes(
Michael Starzinger 2013/10/14 09:18:37 IIUC, this tries to keep the new code-bytes counte
rmcilroy 2013/10/14 11:24:14 Ahh right - I thought code would be added to this
1011 shared->ShortPrint(); 1011 code->is_crankshafted(), code->instruction_size());
1012 PrintF(" - age: %d]\n", code->GetAge()); 1012 if (FLAG_trace_code_flushing) {
1013 PrintF("[code-flushing clears: ");
1014 shared->ShortPrint();
1015 PrintF(" - age: %d]\n", code->GetAge());
1016 }
1013 } 1017 }
1014 shared->set_code(lazy_compile); 1018 shared->set_code(lazy_compile);
1015 candidate->set_code(lazy_compile); 1019 candidate->set_code(lazy_compile);
1016 } else { 1020 } else {
1017 candidate->set_code(code); 1021 candidate->set_code(code);
1018 } 1022 }
1019 1023
1020 // We are in the middle of a GC cycle so the write barrier in the code 1024 // We are in the middle of a GC cycle so the write barrier in the code
1021 // setter did not record the slot update and we have to do that manually. 1025 // setter did not record the slot update and we have to do that manually.
1022 Address slot = candidate->address() + JSFunction::kCodeEntryOffset; 1026 Address slot = candidate->address() + JSFunction::kCodeEntryOffset;
(...skipping 23 matching lines...) Expand all
1046 ClearNextCandidate(candidate); 1050 ClearNextCandidate(candidate);
1047 1051
1048 Code* code = candidate->code(); 1052 Code* code = candidate->code();
1049 MarkBit code_mark = Marking::MarkBitFrom(code); 1053 MarkBit code_mark = Marking::MarkBitFrom(code);
1050 if (!code_mark.Get()) { 1054 if (!code_mark.Get()) {
1051 if (FLAG_trace_code_flushing && candidate->is_compiled()) { 1055 if (FLAG_trace_code_flushing && candidate->is_compiled()) {
1052 PrintF("[code-flushing clears: "); 1056 PrintF("[code-flushing clears: ");
1053 candidate->ShortPrint(); 1057 candidate->ShortPrint();
1054 PrintF(" - age: %d]\n", code->GetAge()); 1058 PrintF(" - age: %d]\n", code->GetAge());
1055 } 1059 }
1060 if (candidate->is_compiled()) {
1061 isolate_->heap()->DecrementCodeGeneratedBytes(
1062 code->is_crankshafted(), code->instruction_size());
1063 }
1056 candidate->set_code(lazy_compile); 1064 candidate->set_code(lazy_compile);
1057 } 1065 }
1058 1066
1059 Object** code_slot = 1067 Object** code_slot =
1060 HeapObject::RawField(candidate, SharedFunctionInfo::kCodeOffset); 1068 HeapObject::RawField(candidate, SharedFunctionInfo::kCodeOffset);
1061 isolate_->heap()->mark_compact_collector()-> 1069 isolate_->heap()->mark_compact_collector()->
1062 RecordSlot(code_slot, code_slot, *code_slot); 1070 RecordSlot(code_slot, code_slot, *code_slot);
1063 1071
1064 candidate = next_candidate; 1072 candidate = next_candidate;
1065 } 1073 }
(...skipping 3288 matching lines...) Expand 10 before | Expand all | Expand 10 after
4354 while (buffer != NULL) { 4362 while (buffer != NULL) {
4355 SlotsBuffer* next_buffer = buffer->next(); 4363 SlotsBuffer* next_buffer = buffer->next();
4356 DeallocateBuffer(buffer); 4364 DeallocateBuffer(buffer);
4357 buffer = next_buffer; 4365 buffer = next_buffer;
4358 } 4366 }
4359 *buffer_address = NULL; 4367 *buffer_address = NULL;
4360 } 4368 }
4361 4369
4362 4370
4363 } } // namespace v8::internal 4371 } } // namespace v8::internal
OLDNEW
« src/heap.h ('K') | « src/heap.cc ('k') | src/v8-counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698