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

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

Issue 12223053: Fix bugs in DeoptimizeIf when lazy deopt is requested. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Allow continuation after the int3 trap. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 ASSERT(info()->IsOptimizing() || info()->IsStub()); 712 ASSERT(info()->IsOptimizing() || info()->IsStub());
713 Deoptimizer::BailoutType bailout_type = info()->IsStub() 713 Deoptimizer::BailoutType bailout_type = info()->IsStub()
714 ? Deoptimizer::LAZY 714 ? Deoptimizer::LAZY
715 : Deoptimizer::EAGER; 715 : Deoptimizer::EAGER;
716 Address entry = Deoptimizer::GetDeoptimizationEntry(id, bailout_type); 716 Address entry = Deoptimizer::GetDeoptimizationEntry(id, bailout_type);
717 if (entry == NULL) { 717 if (entry == NULL) {
718 Abort("bailout was not prepared"); 718 Abort("bailout was not prepared");
719 return; 719 return;
720 } 720 }
721 721
722 ASSERT(FLAG_deopt_every_n_times == 0); // Not yet implemented on x64.
723
724 if (FLAG_trap_on_deopt) {
725 Label done;
726 if (cc != no_condition) {
727 __ j(NegateCondition(cc), &done, Label::kNear);
728 }
729 __ int3();
730 __ bind(&done);
731 }
732
722 ASSERT(info()->IsStub() || frame_is_built_); 733 ASSERT(info()->IsStub() || frame_is_built_);
723 bool lazy_deopt = info()->IsStub(); 734 bool needs_lazy_deopt = info()->IsStub();
724 if (cc == no_condition) { 735 if (cc == no_condition && frame_is_built_) {
725 if (lazy_deopt) { 736 if (needs_lazy_deopt) {
726 __ Call(entry, RelocInfo::RUNTIME_ENTRY); 737 __ Call(entry, RelocInfo::RUNTIME_ENTRY);
727 } else { 738 } else {
728 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); 739 __ Jump(entry, RelocInfo::RUNTIME_ENTRY);
729 } 740 }
730 } else { 741 } else {
731 // We often have several deopts to the same entry, reuse the last 742 // We often have several deopts to the same entry, reuse the last
732 // jump entry if this is the case. 743 // jump entry if this is the case.
733 if (jump_table_.is_empty() || 744 if (jump_table_.is_empty() ||
734 jump_table_.last().address != entry || 745 jump_table_.last().address != entry ||
735 jump_table_.last().needs_frame != !frame_is_built_ || 746 jump_table_.last().needs_frame != !frame_is_built_ ||
736 jump_table_.last().is_lazy_deopt != lazy_deopt) { 747 jump_table_.last().is_lazy_deopt != needs_lazy_deopt) {
737 JumpTableEntry table_entry(entry, !frame_is_built_, lazy_deopt); 748 JumpTableEntry table_entry(entry, !frame_is_built_, needs_lazy_deopt);
738 jump_table_.Add(table_entry, zone()); 749 jump_table_.Add(table_entry, zone());
739 } 750 }
740 __ j(cc, &jump_table_.last().label); 751 if (cc == no_condition) {
752 __ jmp(&jump_table_.last().label);
753 } else {
754 __ j(cc, &jump_table_.last().label);
755 }
741 } 756 }
742 } 757 }
743 758
744 759
745 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { 760 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
746 int length = deoptimizations_.length(); 761 int length = deoptimizations_.length();
747 if (length == 0) return; 762 if (length == 0) return;
748 Handle<DeoptimizationInputData> data = 763 Handle<DeoptimizationInputData> data =
749 factory()->NewDeoptimizationInputData(length, TENURED); 764 factory()->NewDeoptimizationInputData(length, TENURED);
750 765
(...skipping 4983 matching lines...) Expand 10 before | Expand all | Expand 10 after
5734 FixedArray::kHeaderSize - kPointerSize)); 5749 FixedArray::kHeaderSize - kPointerSize));
5735 __ bind(&done); 5750 __ bind(&done);
5736 } 5751 }
5737 5752
5738 5753
5739 #undef __ 5754 #undef __
5740 5755
5741 } } // namespace v8::internal 5756 } } // namespace v8::internal
5742 5757
5743 #endif // V8_TARGET_ARCH_X64 5758 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698