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

Side by Side Diff: src/arm64/lithium-codegen-arm64.cc

Issue 910773002: Propagate Deopt reason to cpu-profiler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments addressed Created 5 years, 10 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/arm64/deoptimizer-arm64.cc ('k') | src/cpu-profiler.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/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 849
850 UseScratchRegisterScope temps(masm()); 850 UseScratchRegisterScope temps(masm());
851 Register entry_offset = temps.AcquireX(); 851 Register entry_offset = temps.AcquireX();
852 852
853 int length = jump_table_.length(); 853 int length = jump_table_.length();
854 for (int i = 0; i < length; i++) { 854 for (int i = 0; i < length; i++) {
855 Deoptimizer::JumpTableEntry* table_entry = jump_table_[i]; 855 Deoptimizer::JumpTableEntry* table_entry = jump_table_[i];
856 __ Bind(&table_entry->label); 856 __ Bind(&table_entry->label);
857 857
858 Address entry = table_entry->address; 858 Address entry = table_entry->address;
859 DeoptComment(table_entry->reason); 859 DeoptComment(table_entry->deopt_info);
860 860
861 // Second-level deopt table entries are contiguous and small, so instead 861 // Second-level deopt table entries are contiguous and small, so instead
862 // of loading the full, absolute address of each one, load the base 862 // of loading the full, absolute address of each one, load the base
863 // address and add an immediate offset. 863 // address and add an immediate offset.
864 __ Mov(entry_offset, entry - base); 864 __ Mov(entry_offset, entry - base);
865 865
866 // The last entry can fall through into `call_deopt_entry`, avoiding a 866 // The last entry can fall through into `call_deopt_entry`, avoiding a
867 // branch. 867 // branch.
868 bool last_entry = (i + 1) == length; 868 bool last_entry = (i + 1) == length;
869 869
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 __ Pop(x2, x1, x0); 1050 __ Pop(x2, x1, x0);
1051 } 1051 }
1052 1052
1053 if (info()->ShouldTrapOnDeopt()) { 1053 if (info()->ShouldTrapOnDeopt()) {
1054 Label dont_trap; 1054 Label dont_trap;
1055 __ B(&dont_trap, InvertBranchType(branch_type), reg, bit); 1055 __ B(&dont_trap, InvertBranchType(branch_type), reg, bit);
1056 __ Debug("trap_on_deopt", __LINE__, BREAK); 1056 __ Debug("trap_on_deopt", __LINE__, BREAK);
1057 __ Bind(&dont_trap); 1057 __ Bind(&dont_trap);
1058 } 1058 }
1059 1059
1060 Deoptimizer::Reason reason(instr->hydrogen_value()->position().raw(), 1060 Deoptimizer::DeoptInfo deopt_info(instr->hydrogen_value()->position().raw(),
1061 instr->Mnemonic(), deopt_reason); 1061 instr->Mnemonic(), deopt_reason);
1062 DCHECK(info()->IsStub() || frame_is_built_); 1062 DCHECK(info()->IsStub() || frame_is_built_);
1063 // Go through jump table if we need to build frame, or restore caller doubles. 1063 // Go through jump table if we need to build frame, or restore caller doubles.
1064 if (branch_type == always && 1064 if (branch_type == always &&
1065 frame_is_built_ && !info()->saves_caller_doubles()) { 1065 frame_is_built_ && !info()->saves_caller_doubles()) {
1066 DeoptComment(reason); 1066 DeoptComment(deopt_info);
1067 __ Call(entry, RelocInfo::RUNTIME_ENTRY); 1067 __ Call(entry, RelocInfo::RUNTIME_ENTRY);
1068 } else { 1068 } else {
1069 Deoptimizer::JumpTableEntry* table_entry = 1069 Deoptimizer::JumpTableEntry* table_entry =
1070 new (zone()) Deoptimizer::JumpTableEntry(entry, reason, bailout_type, 1070 new (zone()) Deoptimizer::JumpTableEntry(
1071 !frame_is_built_); 1071 entry, deopt_info, bailout_type, !frame_is_built_);
1072 // We often have several deopts to the same entry, reuse the last 1072 // We often have several deopts to the same entry, reuse the last
1073 // jump entry if this is the case. 1073 // jump entry if this is the case.
1074 if (jump_table_.is_empty() || 1074 if (jump_table_.is_empty() ||
1075 !table_entry->IsEquivalentTo(*jump_table_.last())) { 1075 !table_entry->IsEquivalentTo(*jump_table_.last())) {
1076 jump_table_.Add(table_entry, zone()); 1076 jump_table_.Add(table_entry, zone());
1077 } 1077 }
1078 __ B(&jump_table_.last()->label, branch_type, reg, bit); 1078 __ B(&jump_table_.last()->label, branch_type, reg, bit);
1079 } 1079 }
1080 } 1080 }
1081 1081
(...skipping 5014 matching lines...) Expand 10 before | Expand all | Expand 10 after
6096 Handle<ScopeInfo> scope_info = instr->scope_info(); 6096 Handle<ScopeInfo> scope_info = instr->scope_info();
6097 __ Push(scope_info); 6097 __ Push(scope_info);
6098 __ Push(ToRegister(instr->function())); 6098 __ Push(ToRegister(instr->function()));
6099 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6099 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6100 RecordSafepoint(Safepoint::kNoLazyDeopt); 6100 RecordSafepoint(Safepoint::kNoLazyDeopt);
6101 } 6101 }
6102 6102
6103 6103
6104 6104
6105 } } // namespace v8::internal 6105 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/deoptimizer-arm64.cc ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698