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

Side by Side Diff: src/cpu-profiler.cc

Issue 7864017: Eliminate the need for code delete events in CPU profiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed test-log/EquivalenceOfLoggingAndTraversal Created 9 years, 3 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 CodeEventsContainer evt_rec; 130 CodeEventsContainer evt_rec;
131 CodeMoveEventRecord* rec = &evt_rec.CodeMoveEventRecord_; 131 CodeMoveEventRecord* rec = &evt_rec.CodeMoveEventRecord_;
132 rec->type = CodeEventRecord::CODE_MOVE; 132 rec->type = CodeEventRecord::CODE_MOVE;
133 rec->order = ++enqueue_order_; 133 rec->order = ++enqueue_order_;
134 rec->from = from; 134 rec->from = from;
135 rec->to = to; 135 rec->to = to;
136 events_buffer_.Enqueue(evt_rec); 136 events_buffer_.Enqueue(evt_rec);
137 } 137 }
138 138
139 139
140 void ProfilerEventsProcessor::CodeDeleteEvent(Address from) {
141 CodeEventsContainer evt_rec;
142 CodeDeleteEventRecord* rec = &evt_rec.CodeDeleteEventRecord_;
143 rec->type = CodeEventRecord::CODE_DELETE;
144 rec->order = ++enqueue_order_;
145 rec->start = from;
146 events_buffer_.Enqueue(evt_rec);
147 }
148
149
150 void ProfilerEventsProcessor::SharedFunctionInfoMoveEvent(Address from, 140 void ProfilerEventsProcessor::SharedFunctionInfoMoveEvent(Address from,
151 Address to) { 141 Address to) {
152 CodeEventsContainer evt_rec; 142 CodeEventsContainer evt_rec;
153 SharedFunctionInfoMoveEventRecord* rec = 143 SharedFunctionInfoMoveEventRecord* rec =
154 &evt_rec.SharedFunctionInfoMoveEventRecord_; 144 &evt_rec.SharedFunctionInfoMoveEventRecord_;
155 rec->type = CodeEventRecord::SHARED_FUNC_MOVE; 145 rec->type = CodeEventRecord::SHARED_FUNC_MOVE;
156 rec->order = ++enqueue_order_; 146 rec->order = ++enqueue_order_;
157 rec->from = from; 147 rec->from = from;
158 rec->to = to; 148 rec->to = to;
159 events_buffer_.Enqueue(evt_rec); 149 events_buffer_.Enqueue(evt_rec);
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 code->ExecutableSize()); 408 code->ExecutableSize());
419 } 409 }
420 410
421 411
422 void CpuProfiler::CodeMoveEvent(Address from, Address to) { 412 void CpuProfiler::CodeMoveEvent(Address from, Address to) {
423 Isolate::Current()->cpu_profiler()->processor_->CodeMoveEvent(from, to); 413 Isolate::Current()->cpu_profiler()->processor_->CodeMoveEvent(from, to);
424 } 414 }
425 415
426 416
427 void CpuProfiler::CodeDeleteEvent(Address from) { 417 void CpuProfiler::CodeDeleteEvent(Address from) {
428 Isolate::Current()->cpu_profiler()->processor_->CodeDeleteEvent(from);
429 } 418 }
430 419
431 420
432 void CpuProfiler::SharedFunctionInfoMoveEvent(Address from, Address to) { 421 void CpuProfiler::SharedFunctionInfoMoveEvent(Address from, Address to) {
433 CpuProfiler* profiler = Isolate::Current()->cpu_profiler(); 422 CpuProfiler* profiler = Isolate::Current()->cpu_profiler();
434 profiler->processor_->SharedFunctionInfoMoveEvent(from, to); 423 profiler->processor_->SharedFunctionInfoMoveEvent(from, to);
435 } 424 }
436 425
437 426
438 void CpuProfiler::GetterCallbackEvent(String* name, Address entry_point) { 427 void CpuProfiler::GetterCallbackEvent(String* name, Address entry_point) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 572
584 void CpuProfiler::TearDown() { 573 void CpuProfiler::TearDown() {
585 Isolate* isolate = Isolate::Current(); 574 Isolate* isolate = Isolate::Current();
586 if (isolate->cpu_profiler() != NULL) { 575 if (isolate->cpu_profiler() != NULL) {
587 delete isolate->cpu_profiler(); 576 delete isolate->cpu_profiler();
588 } 577 }
589 isolate->set_cpu_profiler(NULL); 578 isolate->set_cpu_profiler(NULL);
590 } 579 }
591 580
592 } } // namespace v8::internal 581 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/cpu-profiler.h ('k') | src/cpu-profiler-inl.h » ('j') | src/log.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698