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

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

Issue 2753543006: [profiler] Web UI: add summary of opts/deopts. (Closed)
Patch Set: Address reviewer comments Created 3 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
« no previous file with comments | « src/profiler/profiler-listener.h ('k') | test/cctest/test-log.cc » ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/profiler/profiler-listener.h" 5 #include "src/profiler/profiler-listener.h"
6 6
7 #include "src/deoptimizer.h" 7 #include "src/deoptimizer.h"
8 #include "src/objects-inl.h" 8 #include "src/objects-inl.h"
9 #include "src/profiler/cpu-profiler.h" 9 #include "src/profiler/cpu-profiler.h"
10 #include "src/profiler/profile-generator-inl.h" 10 #include "src/profiler/profile-generator-inl.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 void ProfilerListener::CodeDisableOptEvent(AbstractCode* code, 139 void ProfilerListener::CodeDisableOptEvent(AbstractCode* code,
140 SharedFunctionInfo* shared) { 140 SharedFunctionInfo* shared) {
141 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DISABLE_OPT); 141 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DISABLE_OPT);
142 CodeDisableOptEventRecord* rec = &evt_rec.CodeDisableOptEventRecord_; 142 CodeDisableOptEventRecord* rec = &evt_rec.CodeDisableOptEventRecord_;
143 rec->start = code->address(); 143 rec->start = code->address();
144 rec->bailout_reason = GetBailoutReason(shared->disable_optimization_reason()); 144 rec->bailout_reason = GetBailoutReason(shared->disable_optimization_reason());
145 DispatchCodeEvent(evt_rec); 145 DispatchCodeEvent(evt_rec);
146 } 146 }
147 147
148 void ProfilerListener::CodeDeoptEvent(Code* code, Address pc, 148 void ProfilerListener::CodeDeoptEvent(Code* code, DeoptKind kind, Address pc,
149 int fp_to_sp_delta) { 149 int fp_to_sp_delta) {
150 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT); 150 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT);
151 CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_; 151 CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_;
152 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, pc); 152 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, pc);
153 rec->start = code->address(); 153 rec->start = code->address();
154 rec->deopt_reason = DeoptimizeReasonToString(info.deopt_reason); 154 rec->deopt_reason = DeoptimizeReasonToString(info.deopt_reason);
155 rec->deopt_id = info.deopt_id; 155 rec->deopt_id = info.deopt_id;
156 rec->pc = reinterpret_cast<void*>(pc); 156 rec->pc = reinterpret_cast<void*>(pc);
157 rec->fp_to_sp_delta = fp_to_sp_delta; 157 rec->fp_to_sp_delta = fp_to_sp_delta;
158 DispatchCodeEvent(evt_rec); 158 DispatchCodeEvent(evt_rec);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 void ProfilerListener::RemoveObserver(CodeEventObserver* observer) { 305 void ProfilerListener::RemoveObserver(CodeEventObserver* observer) {
306 base::LockGuard<base::Mutex> guard(&mutex_); 306 base::LockGuard<base::Mutex> guard(&mutex_);
307 auto it = std::find(observers_.begin(), observers_.end(), observer); 307 auto it = std::find(observers_.begin(), observers_.end(), observer);
308 if (it == observers_.end()) return; 308 if (it == observers_.end()) return;
309 observers_.erase(it); 309 observers_.erase(it);
310 } 310 }
311 311
312 } // namespace internal 312 } // namespace internal
313 } // namespace v8 313 } // namespace v8
OLDNEW
« no previous file with comments | « src/profiler/profiler-listener.h ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698