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

Side by Side Diff: src/x64/lithium-codegen-x64.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/x64/deoptimizer-x64.cc ('k') | src/x87/lithium-codegen-x87.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 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 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 bool LCodeGen::GenerateJumpTable() { 298 bool LCodeGen::GenerateJumpTable() {
299 Label needs_frame; 299 Label needs_frame;
300 if (jump_table_.length() > 0) { 300 if (jump_table_.length() > 0) {
301 Comment(";;; -------------------- Jump table --------------------"); 301 Comment(";;; -------------------- Jump table --------------------");
302 } 302 }
303 for (int i = 0; i < jump_table_.length(); i++) { 303 for (int i = 0; i < jump_table_.length(); i++) {
304 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i]; 304 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i];
305 __ bind(&table_entry->label); 305 __ bind(&table_entry->label);
306 Address entry = table_entry->address; 306 Address entry = table_entry->address;
307 DeoptComment(table_entry->reason); 307 DeoptComment(table_entry->deopt_info);
308 if (table_entry->needs_frame) { 308 if (table_entry->needs_frame) {
309 DCHECK(!info()->saves_caller_doubles()); 309 DCHECK(!info()->saves_caller_doubles());
310 __ Move(kScratchRegister, ExternalReference::ForDeoptEntry(entry)); 310 __ Move(kScratchRegister, ExternalReference::ForDeoptEntry(entry));
311 if (needs_frame.is_bound()) { 311 if (needs_frame.is_bound()) {
312 __ jmp(&needs_frame); 312 __ jmp(&needs_frame);
313 } else { 313 } else {
314 __ bind(&needs_frame); 314 __ bind(&needs_frame);
315 __ movp(rsi, MemOperand(rbp, StandardFrameConstants::kContextOffset)); 315 __ movp(rsi, MemOperand(rbp, StandardFrameConstants::kContextOffset));
316 __ pushq(rbp); 316 __ pushq(rbp);
317 __ movp(rbp, rsp); 317 __ movp(rbp, rsp);
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 761
762 if (info()->ShouldTrapOnDeopt()) { 762 if (info()->ShouldTrapOnDeopt()) {
763 Label done; 763 Label done;
764 if (cc != no_condition) { 764 if (cc != no_condition) {
765 __ j(NegateCondition(cc), &done, Label::kNear); 765 __ j(NegateCondition(cc), &done, Label::kNear);
766 } 766 }
767 __ int3(); 767 __ int3();
768 __ bind(&done); 768 __ bind(&done);
769 } 769 }
770 770
771 Deoptimizer::Reason reason(instr->hydrogen_value()->position().raw(), 771 Deoptimizer::DeoptInfo deopt_info(instr->hydrogen_value()->position().raw(),
772 instr->Mnemonic(), deopt_reason); 772 instr->Mnemonic(), deopt_reason);
773 DCHECK(info()->IsStub() || frame_is_built_); 773 DCHECK(info()->IsStub() || frame_is_built_);
774 // Go through jump table if we need to handle condition, build frame, or 774 // Go through jump table if we need to handle condition, build frame, or
775 // restore caller doubles. 775 // restore caller doubles.
776 if (cc == no_condition && frame_is_built_ && 776 if (cc == no_condition && frame_is_built_ &&
777 !info()->saves_caller_doubles()) { 777 !info()->saves_caller_doubles()) {
778 DeoptComment(reason); 778 DeoptComment(deopt_info);
779 __ call(entry, RelocInfo::RUNTIME_ENTRY); 779 __ call(entry, RelocInfo::RUNTIME_ENTRY);
780 } else { 780 } else {
781 Deoptimizer::JumpTableEntry table_entry(entry, reason, bailout_type, 781 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type,
782 !frame_is_built_); 782 !frame_is_built_);
783 // We often have several deopts to the same entry, reuse the last 783 // We often have several deopts to the same entry, reuse the last
784 // jump entry if this is the case. 784 // jump entry if this is the case.
785 if (jump_table_.is_empty() || 785 if (jump_table_.is_empty() ||
786 !table_entry.IsEquivalentTo(jump_table_.last())) { 786 !table_entry.IsEquivalentTo(jump_table_.last())) {
787 jump_table_.Add(table_entry, zone()); 787 jump_table_.Add(table_entry, zone());
788 } 788 }
789 if (cc == no_condition) { 789 if (cc == no_condition) {
790 __ jmp(&jump_table_.last().label); 790 __ jmp(&jump_table_.last().label);
791 } else { 791 } else {
(...skipping 5138 matching lines...) Expand 10 before | Expand all | Expand 10 after
5930 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5930 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5931 RecordSafepoint(Safepoint::kNoLazyDeopt); 5931 RecordSafepoint(Safepoint::kNoLazyDeopt);
5932 } 5932 }
5933 5933
5934 5934
5935 #undef __ 5935 #undef __
5936 5936
5937 } } // namespace v8::internal 5937 } } // namespace v8::internal
5938 5938
5939 #endif // V8_TARGET_ARCH_X64 5939 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/deoptimizer-x64.cc ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698