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

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

Issue 16509005: Implemented function that returns code age. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « no previous file | 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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 next_candidate = GetNextCandidate(candidate); 997 next_candidate = GetNextCandidate(candidate);
998 ClearNextCandidate(candidate, undefined); 998 ClearNextCandidate(candidate, undefined);
999 999
1000 SharedFunctionInfo* shared = candidate->shared(); 1000 SharedFunctionInfo* shared = candidate->shared();
1001 1001
1002 Code* code = shared->code(); 1002 Code* code = shared->code();
1003 MarkBit code_mark = Marking::MarkBitFrom(code); 1003 MarkBit code_mark = Marking::MarkBitFrom(code);
1004 if (!code_mark.Get()) { 1004 if (!code_mark.Get()) {
1005 if (FLAG_trace_code_flushing && shared->is_compiled()) { 1005 if (FLAG_trace_code_flushing && shared->is_compiled()) {
1006 SmartArrayPointer<char> name = shared->DebugName()->ToCString(); 1006 SmartArrayPointer<char> name = shared->DebugName()->ToCString();
1007 PrintF("[code-flushing clears: %s]\n", *name); 1007 PrintF("[code-flushing clears: %s - age: %d]\n", *name, code->GetAge());
1008 } 1008 }
1009 shared->set_code(lazy_compile); 1009 shared->set_code(lazy_compile);
1010 candidate->set_code(lazy_compile); 1010 candidate->set_code(lazy_compile);
1011 } else { 1011 } else {
1012 candidate->set_code(code); 1012 candidate->set_code(code);
1013 } 1013 }
1014 1014
1015 // We are in the middle of a GC cycle so the write barrier in the code 1015 // We are in the middle of a GC cycle so the write barrier in the code
1016 // setter did not record the slot update and we have to do that manually. 1016 // setter did not record the slot update and we have to do that manually.
1017 Address slot = candidate->address() + JSFunction::kCodeEntryOffset; 1017 Address slot = candidate->address() + JSFunction::kCodeEntryOffset;
(...skipping 20 matching lines...) Expand all
1038 SharedFunctionInfo* next_candidate; 1038 SharedFunctionInfo* next_candidate;
1039 while (candidate != NULL) { 1039 while (candidate != NULL) {
1040 next_candidate = GetNextCandidate(candidate); 1040 next_candidate = GetNextCandidate(candidate);
1041 ClearNextCandidate(candidate); 1041 ClearNextCandidate(candidate);
1042 1042
1043 Code* code = candidate->code(); 1043 Code* code = candidate->code();
1044 MarkBit code_mark = Marking::MarkBitFrom(code); 1044 MarkBit code_mark = Marking::MarkBitFrom(code);
1045 if (!code_mark.Get()) { 1045 if (!code_mark.Get()) {
1046 if (FLAG_trace_code_flushing && candidate->is_compiled()) { 1046 if (FLAG_trace_code_flushing && candidate->is_compiled()) {
1047 SmartArrayPointer<char> name = candidate->DebugName()->ToCString(); 1047 SmartArrayPointer<char> name = candidate->DebugName()->ToCString();
1048 PrintF("[code-flushing clears: %s]\n", *name); 1048 PrintF("[code-flushing clears: %s - age: %d]\n", *name, code->GetAge());
1049 } 1049 }
1050 candidate->set_code(lazy_compile); 1050 candidate->set_code(lazy_compile);
1051 } 1051 }
1052 1052
1053 Object** code_slot = 1053 Object** code_slot =
1054 HeapObject::RawField(candidate, SharedFunctionInfo::kCodeOffset); 1054 HeapObject::RawField(candidate, SharedFunctionInfo::kCodeOffset);
1055 isolate_->heap()->mark_compact_collector()-> 1055 isolate_->heap()->mark_compact_collector()->
1056 RecordSlot(code_slot, code_slot, *code_slot); 1056 RecordSlot(code_slot, code_slot, *code_slot);
1057 1057
1058 candidate = next_candidate; 1058 candidate = next_candidate;
(...skipping 3206 matching lines...) Expand 10 before | Expand all | Expand 10 after
4265 while (buffer != NULL) { 4265 while (buffer != NULL) {
4266 SlotsBuffer* next_buffer = buffer->next(); 4266 SlotsBuffer* next_buffer = buffer->next();
4267 DeallocateBuffer(buffer); 4267 DeallocateBuffer(buffer);
4268 buffer = next_buffer; 4268 buffer = next_buffer;
4269 } 4269 }
4270 *buffer_address = NULL; 4270 *buffer_address = NULL;
4271 } 4271 }
4272 4272
4273 4273
4274 } } // namespace v8::internal 4274 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698