| 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 ASSERT(environment->HasBeenRegistered()); | 731 ASSERT(environment->HasBeenRegistered()); |
| 732 int id = environment->deoptimization_index(); | 732 int id = environment->deoptimization_index(); |
| 733 ASSERT(info()->IsOptimizing() || info()->IsStub()); | 733 ASSERT(info()->IsOptimizing() || info()->IsStub()); |
| 734 Address entry = | 734 Address entry = |
| 735 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); | 735 Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type); |
| 736 if (entry == NULL) { | 736 if (entry == NULL) { |
| 737 Abort(kBailoutWasNotPrepared); | 737 Abort(kBailoutWasNotPrepared); |
| 738 return; | 738 return; |
| 739 } | 739 } |
| 740 | 740 |
| 741 ASSERT(FLAG_deopt_every_n_times < 2); // Other values not supported on MIPS. | 741 if (FLAG_deopt_every_n_times != 0 && !info()->IsStub()) { |
| 742 if (FLAG_deopt_every_n_times == 1 && | 742 Register scratch = scratch0(); |
| 743 !info()->IsStub() && | 743 ExternalReference count = ExternalReference::stress_deopt_count(isolate()); |
| 744 info()->opt_count() == id) { | 744 Label no_deopt; |
| 745 ASSERT(frame_is_built_); | 745 __ Push(a1, scratch); |
| 746 __ li(scratch, Operand(count)); |
| 747 __ lw(a1, MemOperand(scratch)); |
| 748 __ Subu(a1, a1, Operand(1)); |
| 749 __ Branch(&no_deopt, ne, a1, Operand(zero_reg)); |
| 750 __ li(a1, Operand(FLAG_deopt_every_n_times)); |
| 751 __ sw(a1, MemOperand(scratch)); |
| 752 __ Pop(a1, scratch); |
| 753 |
| 746 __ Call(entry, RelocInfo::RUNTIME_ENTRY); | 754 __ Call(entry, RelocInfo::RUNTIME_ENTRY); |
| 747 return; | 755 __ bind(&no_deopt); |
| 756 __ sw(a1, MemOperand(scratch)); |
| 757 __ Pop(a1, scratch); |
| 748 } | 758 } |
| 749 | 759 |
| 750 if (info()->ShouldTrapOnDeopt()) { | 760 if (info()->ShouldTrapOnDeopt()) { |
| 751 Label skip; | 761 Label skip; |
| 752 if (condition != al) { | 762 if (condition != al) { |
| 753 __ Branch(&skip, NegateCondition(condition), src1, src2); | 763 __ Branch(&skip, NegateCondition(condition), src1, src2); |
| 754 } | 764 } |
| 755 __ stop("trap_on_deopt"); | 765 __ stop("trap_on_deopt"); |
| 756 __ bind(&skip); | 766 __ bind(&skip); |
| 757 } | 767 } |
| (...skipping 5093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5851 __ Subu(scratch, result, scratch); | 5861 __ Subu(scratch, result, scratch); |
| 5852 __ lw(result, FieldMemOperand(scratch, | 5862 __ lw(result, FieldMemOperand(scratch, |
| 5853 FixedArray::kHeaderSize - kPointerSize)); | 5863 FixedArray::kHeaderSize - kPointerSize)); |
| 5854 __ bind(&done); | 5864 __ bind(&done); |
| 5855 } | 5865 } |
| 5856 | 5866 |
| 5857 | 5867 |
| 5858 #undef __ | 5868 #undef __ |
| 5859 | 5869 |
| 5860 } } // namespace v8::internal | 5870 } } // namespace v8::internal |
| OLD | NEW |