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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/ia32/deoptimizer-ia32.cc ('k') | src/lithium-codegen.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_IA32 7 #if V8_TARGET_ARCH_IA32
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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 bool LCodeGen::GenerateJumpTable() { 378 bool LCodeGen::GenerateJumpTable() {
379 Label needs_frame; 379 Label needs_frame;
380 if (jump_table_.length() > 0) { 380 if (jump_table_.length() > 0) {
381 Comment(";;; -------------------- Jump table --------------------"); 381 Comment(";;; -------------------- Jump table --------------------");
382 } 382 }
383 for (int i = 0; i < jump_table_.length(); i++) { 383 for (int i = 0; i < jump_table_.length(); i++) {
384 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i]; 384 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i];
385 __ bind(&table_entry->label); 385 __ bind(&table_entry->label);
386 Address entry = table_entry->address; 386 Address entry = table_entry->address;
387 DeoptComment(table_entry->reason); 387 DeoptComment(table_entry->deopt_info);
388 if (table_entry->needs_frame) { 388 if (table_entry->needs_frame) {
389 DCHECK(!info()->saves_caller_doubles()); 389 DCHECK(!info()->saves_caller_doubles());
390 __ push(Immediate(ExternalReference::ForDeoptEntry(entry))); 390 __ push(Immediate(ExternalReference::ForDeoptEntry(entry)));
391 if (needs_frame.is_bound()) { 391 if (needs_frame.is_bound()) {
392 __ jmp(&needs_frame); 392 __ jmp(&needs_frame);
393 } else { 393 } else {
394 __ bind(&needs_frame); 394 __ bind(&needs_frame);
395 __ push(MemOperand(ebp, StandardFrameConstants::kContextOffset)); 395 __ push(MemOperand(ebp, StandardFrameConstants::kContextOffset));
396 // This variant of deopt can only be used with stubs. Since we don't 396 // This variant of deopt can only be used with stubs. Since we don't
397 // have a function pointer to install in the stack frame that we're 397 // have a function pointer to install in the stack frame that we're
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 __ popfd(); 854 __ popfd();
855 } 855 }
856 856
857 if (info()->ShouldTrapOnDeopt()) { 857 if (info()->ShouldTrapOnDeopt()) {
858 Label done; 858 Label done;
859 if (cc != no_condition) __ j(NegateCondition(cc), &done, Label::kNear); 859 if (cc != no_condition) __ j(NegateCondition(cc), &done, Label::kNear);
860 __ int3(); 860 __ int3();
861 __ bind(&done); 861 __ bind(&done);
862 } 862 }
863 863
864 Deoptimizer::Reason reason(instr->hydrogen_value()->position().raw(), 864 Deoptimizer::DeoptInfo deopt_info(instr->hydrogen_value()->position().raw(),
865 instr->Mnemonic(), deopt_reason); 865 instr->Mnemonic(), deopt_reason);
866 DCHECK(info()->IsStub() || frame_is_built_); 866 DCHECK(info()->IsStub() || frame_is_built_);
867 if (cc == no_condition && frame_is_built_) { 867 if (cc == no_condition && frame_is_built_) {
868 DeoptComment(reason); 868 DeoptComment(deopt_info);
869 __ call(entry, RelocInfo::RUNTIME_ENTRY); 869 __ call(entry, RelocInfo::RUNTIME_ENTRY);
870 } else { 870 } else {
871 Deoptimizer::JumpTableEntry table_entry(entry, reason, bailout_type, 871 Deoptimizer::JumpTableEntry table_entry(entry, deopt_info, bailout_type,
872 !frame_is_built_); 872 !frame_is_built_);
873 // We often have several deopts to the same entry, reuse the last 873 // We often have several deopts to the same entry, reuse the last
874 // jump entry if this is the case. 874 // jump entry if this is the case.
875 if (jump_table_.is_empty() || 875 if (jump_table_.is_empty() ||
876 !table_entry.IsEquivalentTo(jump_table_.last())) { 876 !table_entry.IsEquivalentTo(jump_table_.last())) {
877 jump_table_.Add(table_entry, zone()); 877 jump_table_.Add(table_entry, zone());
878 } 878 }
879 if (cc == no_condition) { 879 if (cc == no_condition) {
880 __ jmp(&jump_table_.last().label); 880 __ jmp(&jump_table_.last().label);
881 } else { 881 } else {
(...skipping 4890 matching lines...) Expand 10 before | Expand all | Expand 10 after
5772 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5772 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5773 RecordSafepoint(Safepoint::kNoLazyDeopt); 5773 RecordSafepoint(Safepoint::kNoLazyDeopt);
5774 } 5774 }
5775 5775
5776 5776
5777 #undef __ 5777 #undef __
5778 5778
5779 } } // namespace v8::internal 5779 } } // namespace v8::internal
5780 5780
5781 #endif // V8_TARGET_ARCH_IA32 5781 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/lithium-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698