| OLD | NEW |
| 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/profiler/cpu-profiler.h" | 8 #include "src/profiler/cpu-profiler.h" |
| 9 #include "src/profiler/profile-generator-inl.h" | 9 #include "src/profiler/profile-generator-inl.h" |
| 10 #include "src/source-position-table.h" | 10 #include "src/source-position-table.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 rec->bailout_reason = GetBailoutReason(shared->disable_optimization_reason()); | 148 rec->bailout_reason = GetBailoutReason(shared->disable_optimization_reason()); |
| 149 DispatchCodeEvent(evt_rec); | 149 DispatchCodeEvent(evt_rec); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void ProfilerListener::CodeDeoptEvent(Code* code, Address pc, | 152 void ProfilerListener::CodeDeoptEvent(Code* code, Address pc, |
| 153 int fp_to_sp_delta) { | 153 int fp_to_sp_delta) { |
| 154 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT); | 154 CodeEventsContainer evt_rec(CodeEventRecord::CODE_DEOPT); |
| 155 CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_; | 155 CodeDeoptEventRecord* rec = &evt_rec.CodeDeoptEventRecord_; |
| 156 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, pc); | 156 Deoptimizer::DeoptInfo info = Deoptimizer::GetDeoptInfo(code, pc); |
| 157 rec->start = code->address(); | 157 rec->start = code->address(); |
| 158 rec->deopt_reason = Deoptimizer::GetDeoptReason(info.deopt_reason); | 158 rec->deopt_reason = DeoptimizeReasonToString(info.deopt_reason); |
| 159 rec->position = info.position; | 159 rec->position = info.position; |
| 160 rec->deopt_id = info.deopt_id; | 160 rec->deopt_id = info.deopt_id; |
| 161 rec->pc = reinterpret_cast<void*>(pc); | 161 rec->pc = reinterpret_cast<void*>(pc); |
| 162 rec->fp_to_sp_delta = fp_to_sp_delta; | 162 rec->fp_to_sp_delta = fp_to_sp_delta; |
| 163 DispatchCodeEvent(evt_rec); | 163 DispatchCodeEvent(evt_rec); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void ProfilerListener::GetterCallbackEvent(Name* name, Address entry_point) { | 166 void ProfilerListener::GetterCallbackEvent(Name* name, Address entry_point) { |
| 167 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); | 167 CodeEventsContainer evt_rec(CodeEventRecord::CODE_CREATION); |
| 168 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; | 168 CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 318 } |
| 319 | 319 |
| 320 void ProfilerListener::RemoveObserver(CodeEventObserver* observer) { | 320 void ProfilerListener::RemoveObserver(CodeEventObserver* observer) { |
| 321 auto it = std::find(observers_.begin(), observers_.end(), observer); | 321 auto it = std::find(observers_.begin(), observers_.end(), observer); |
| 322 if (it == observers_.end()) return; | 322 if (it == observers_.end()) return; |
| 323 observers_.erase(it); | 323 observers_.erase(it); |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // namespace internal | 326 } // namespace internal |
| 327 } // namespace v8 | 327 } // namespace v8 |
| OLD | NEW |