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

Side by Side Diff: src/deoptimizer.cc

Issue 959203002: CpuProfiler: replace raw position with SourcePosition for DeoptReason (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix for win32 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 unified diff | Download patch
« no previous file with comments | « src/deoptimizer.h ('k') | src/hydrogen-instructions.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/cpu-profiler.h" 9 #include "src/cpu-profiler.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 3632 matching lines...) Expand 10 before | Expand all | Expand 10 after
3643 DCHECK(deopt_reason < kLastDeoptReason); 3643 DCHECK(deopt_reason < kLastDeoptReason);
3644 #define DEOPT_MESSAGES_TEXTS(C, T) T, 3644 #define DEOPT_MESSAGES_TEXTS(C, T) T,
3645 static const char* deopt_messages_[] = { 3645 static const char* deopt_messages_[] = {
3646 DEOPT_MESSAGES_LIST(DEOPT_MESSAGES_TEXTS)}; 3646 DEOPT_MESSAGES_LIST(DEOPT_MESSAGES_TEXTS)};
3647 #undef DEOPT_MESSAGES_TEXTS 3647 #undef DEOPT_MESSAGES_TEXTS
3648 return deopt_messages_[deopt_reason]; 3648 return deopt_messages_[deopt_reason];
3649 } 3649 }
3650 3650
3651 3651
3652 Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, int bailout_id) { 3652 Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, int bailout_id) {
3653 int last_position = 0; 3653 SourcePosition last_position = SourcePosition::Unknown();
3654 Isolate* isolate = code->GetIsolate(); 3654 Isolate* isolate = code->GetIsolate();
3655 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason; 3655 Deoptimizer::DeoptReason last_reason = Deoptimizer::kNoReason;
3656 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) | 3656 int mask = RelocInfo::ModeMask(RelocInfo::DEOPT_REASON) |
3657 RelocInfo::ModeMask(RelocInfo::POSITION) | 3657 RelocInfo::ModeMask(RelocInfo::POSITION) |
3658 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 3658 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
3659 for (RelocIterator it(code, mask); !it.done(); it.next()) { 3659 for (RelocIterator it(code, mask); !it.done(); it.next()) {
3660 RelocInfo* info = it.rinfo(); 3660 RelocInfo* info = it.rinfo();
3661 if (info->rmode() == RelocInfo::POSITION) { 3661 if (info->rmode() == RelocInfo::POSITION) {
3662 last_position = static_cast<int>(info->data()); 3662 int raw_position = static_cast<int>(info->data());
3663 last_position = raw_position ? SourcePosition::FromRaw(raw_position)
3664 : SourcePosition::Unknown();
3663 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { 3665 } else if (info->rmode() == RelocInfo::DEOPT_REASON) {
3664 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); 3666 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data());
3665 } else if (last_reason != Deoptimizer::kNoReason) { 3667 } else if (last_reason != Deoptimizer::kNoReason) {
3666 if ((bailout_id == 3668 if ((bailout_id ==
3667 Deoptimizer::GetDeoptimizationId(isolate, info->target_address(), 3669 Deoptimizer::GetDeoptimizationId(isolate, info->target_address(),
3668 Deoptimizer::EAGER)) || 3670 Deoptimizer::EAGER)) ||
3669 (bailout_id == 3671 (bailout_id ==
3670 Deoptimizer::GetDeoptimizationId(isolate, info->target_address(), 3672 Deoptimizer::GetDeoptimizationId(isolate, info->target_address(),
3671 Deoptimizer::SOFT)) || 3673 Deoptimizer::SOFT)) ||
3672 (bailout_id == 3674 (bailout_id ==
3673 Deoptimizer::GetDeoptimizationId(isolate, info->target_address(), 3675 Deoptimizer::GetDeoptimizationId(isolate, info->target_address(),
3674 Deoptimizer::LAZY))) { 3676 Deoptimizer::LAZY))) {
3675 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); 3677 CHECK(RelocInfo::IsRuntimeEntry(info->rmode()));
3676 return DeoptInfo(last_position, NULL, last_reason); 3678 return DeoptInfo(last_position, NULL, last_reason);
3677 } 3679 }
3678 } 3680 }
3679 } 3681 }
3680 return DeoptInfo(0, NULL, Deoptimizer::kNoReason); 3682 return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason);
3681 } 3683 }
3682 } } // namespace v8::internal 3684 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698