OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); | 853 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); |
854 | 854 |
855 __ bind(&no_deopt); | 855 __ bind(&no_deopt); |
856 __ mov(FieldOperand(ebx, SharedFunctionInfo::kStressDeoptCounterOffset), | 856 __ mov(FieldOperand(ebx, SharedFunctionInfo::kStressDeoptCounterOffset), |
857 eax); | 857 eax); |
858 __ pop(ebx); | 858 __ pop(ebx); |
859 __ pop(eax); | 859 __ pop(eax); |
860 __ popfd(); | 860 __ popfd(); |
861 } | 861 } |
862 | 862 |
| 863 if (FLAG_trap_on_deopt) { |
| 864 Label done; |
| 865 if (cc != no_condition) { |
| 866 __ j(NegateCondition(cc), &done, Label::kNear); |
| 867 } |
| 868 __ int3(); |
| 869 __ bind(&done); |
| 870 } |
| 871 |
863 ASSERT(info()->IsStub() || frame_is_built_); | 872 ASSERT(info()->IsStub() || frame_is_built_); |
864 bool lazy_deopt_needed = info()->IsStub(); | 873 bool needs_lazy_deopt = info()->IsStub(); |
865 if (cc == no_condition) { | 874 if (cc == no_condition && frame_is_built_) { |
866 if (FLAG_trap_on_deopt) __ int3(); | 875 if (needs_lazy_deopt) { |
867 if (lazy_deopt_needed) { | |
868 __ call(entry, RelocInfo::RUNTIME_ENTRY); | 876 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
869 } else { | 877 } else { |
870 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); | 878 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); |
871 } | 879 } |
872 } else { | 880 } else { |
873 Label done; | 881 // We often have several deopts to the same entry, reuse the last |
874 if (FLAG_trap_on_deopt) { | 882 // jump entry if this is the case. |
875 __ j(NegateCondition(cc), &done, Label::kNear); | 883 if (jump_table_.is_empty() || |
876 __ int3(); | 884 jump_table_.last().address != entry || |
| 885 jump_table_.last().needs_frame != !frame_is_built_ || |
| 886 jump_table_.last().is_lazy_deopt != needs_lazy_deopt) { |
| 887 JumpTableEntry table_entry(entry, !frame_is_built_, needs_lazy_deopt); |
| 888 jump_table_.Add(table_entry, zone()); |
877 } | 889 } |
878 if (!lazy_deopt_needed && frame_is_built_) { | 890 if (cc == no_condition) { |
879 if (FLAG_trap_on_deopt) { | 891 __ jmp(&jump_table_.last().label); |
880 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); | |
881 } else { | |
882 __ j(cc, entry, RelocInfo::RUNTIME_ENTRY); | |
883 } | |
884 } else { | 892 } else { |
885 // We often have several deopts to the same entry, reuse the last | 893 __ j(cc, &jump_table_.last().label); |
886 // jump entry if this is the case. | |
887 if (jump_table_.is_empty() || | |
888 jump_table_.last().address != entry || | |
889 jump_table_.last().needs_frame != !frame_is_built_ || | |
890 jump_table_.last().is_lazy_deopt != lazy_deopt_needed) { | |
891 JumpTableEntry table_entry(entry, !frame_is_built_, lazy_deopt_needed); | |
892 jump_table_.Add(table_entry, zone()); | |
893 } | |
894 if (FLAG_trap_on_deopt) { | |
895 __ jmp(&jump_table_.last().label); | |
896 } else { | |
897 __ j(cc, &jump_table_.last().label); | |
898 } | |
899 } | 894 } |
900 __ bind(&done); | |
901 } | 895 } |
902 } | 896 } |
903 | 897 |
904 | 898 |
905 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 899 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
906 int length = deoptimizations_.length(); | 900 int length = deoptimizations_.length(); |
907 if (length == 0) return; | 901 if (length == 0) return; |
908 Handle<DeoptimizationInputData> data = | 902 Handle<DeoptimizationInputData> data = |
909 factory()->NewDeoptimizationInputData(length, TENURED); | 903 factory()->NewDeoptimizationInputData(length, TENURED); |
910 | 904 |
(...skipping 5257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6168 FixedArray::kHeaderSize - kPointerSize)); | 6162 FixedArray::kHeaderSize - kPointerSize)); |
6169 __ bind(&done); | 6163 __ bind(&done); |
6170 } | 6164 } |
6171 | 6165 |
6172 | 6166 |
6173 #undef __ | 6167 #undef __ |
6174 | 6168 |
6175 } } // namespace v8::internal | 6169 } } // namespace v8::internal |
6176 | 6170 |
6177 #endif // V8_TARGET_ARCH_IA32 | 6171 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |