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

Unified Diff: src/deoptimizer.cc

Issue 984773003: CpuProfiler: fix for GetDeoptReason code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments addressed Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/deoptimizer.h ('k') | src/log.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index d45ca228fd5752686fca1ddf8bbfb2c4ec6cf72d..a8de06ee5850f82949b63ba1146865aba7cd3536 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -610,8 +610,7 @@ Deoptimizer::Deoptimizer(Isolate* isolate,
disallow_heap_allocation_ = new DisallowHeapAllocation();
#endif // DEBUG
if (compiled_code_->kind() == Code::OPTIMIZED_FUNCTION) {
- PROFILE(isolate_, CodeDeoptEvent(compiled_code_, bailout_id_, from_,
- fp_to_sp_delta_));
+ PROFILE(isolate_, CodeDeoptEvent(compiled_code_, from_, fp_to_sp_delta_));
}
unsigned size = ComputeInputFrameSize();
input_ = new(size) FrameDescription(size, function);
@@ -770,7 +769,7 @@ void Deoptimizer::DoComputeOutputFrames() {
fp_to_sp_delta_);
if (bailout_type_ == EAGER || bailout_type_ == SOFT ||
(compiled_code_->is_hydrogen_stub())) {
- compiled_code_->PrintDeoptLocation(trace_scope_->file(), bailout_id_);
+ compiled_code_->PrintDeoptLocation(trace_scope_->file(), from_);
}
}
@@ -3649,34 +3648,20 @@ const char* Deoptimizer::GetDeoptReason(DeoptReason deopt_reason) {
}
-Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, int bailout_id) {
+Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) {
SourcePosition last_position = SourcePosition::Unknown();
- Isolate* isolate = code->GetIsolate();
Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason;
int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) |
- RelocInfo::ModeMask(RelocInfo::POSITION) |
- RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
+ RelocInfo::ModeMask(RelocInfo::POSITION);
for (RelocIterator it(code, mask); !it.done(); it.next()) {
RelocInfo* info = it.rinfo();
+ if (info->pc() >= pc) return DeoptInfo(last_position, NULL, last_reason);
if (info->rmode() == RelocInfo::POSITION) {
int raw_position = static_cast<int>(info->data());
last_position = raw_position ? SourcePosition::FromRaw(raw_position)
: SourcePosition::Unknown();
} else if (info->rmode() == RelocInfo::DEOPT_REASON) {
last_reason = static_cast<Deoptimizer::DeoptReason>(info->data());
- } else if (last_reason != Deoptimizer::kNoReason) {
- if ((bailout_id ==
- Deoptimizer::GetDeoptimizationId(isolate, info->target_address(),
- Deoptimizer::EAGER)) ||
- (bailout_id ==
- Deoptimizer::GetDeoptimizationId(isolate, info->target_address(),
- Deoptimizer::SOFT)) ||
- (bailout_id ==
- Deoptimizer::GetDeoptimizationId(isolate, info->target_address(),
- Deoptimizer::LAZY))) {
- CHECK(RelocInfo::IsRuntimeEntry(info->rmode()));
- return DeoptInfo(last_position, NULL, last_reason);
- }
}
}
return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason);
« no previous file with comments | « src/deoptimizer.h ('k') | src/log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698