OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 640 } |
641 | 641 |
642 ASSERT(FLAG_deopt_every_n_times < 2); // Other values not supported on ARM. | 642 ASSERT(FLAG_deopt_every_n_times < 2); // Other values not supported on ARM. |
643 | 643 |
644 if (FLAG_deopt_every_n_times == 1 && | 644 if (FLAG_deopt_every_n_times == 1 && |
645 info_->shared_info()->opt_count() == id) { | 645 info_->shared_info()->opt_count() == id) { |
646 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 646 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
647 return; | 647 return; |
648 } | 648 } |
649 | 649 |
650 if (cc == kNoCondition) { | 650 if (cc == al) { |
651 if (FLAG_trap_on_deopt) __ stop("trap_on_deopt"); | 651 if (FLAG_trap_on_deopt) __ stop("trap_on_deopt"); |
652 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 652 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
653 } else { | 653 } else { |
654 if (FLAG_trap_on_deopt) { | 654 if (FLAG_trap_on_deopt) { |
655 Label done; | 655 Label done; |
656 __ b(&done, NegateCondition(cc)); | 656 __ b(&done, NegateCondition(cc)); |
657 __ stop("trap_on_deopt"); | 657 __ stop("trap_on_deopt"); |
658 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 658 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
659 __ bind(&done); | 659 __ bind(&done); |
660 } else { | 660 } else { |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 } else { | 1181 } else { |
1182 __ mul(left, left, right); | 1182 __ mul(left, left, right); |
1183 } | 1183 } |
1184 | 1184 |
1185 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1185 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
1186 // Bail out if the result is supposed to be negative zero. | 1186 // Bail out if the result is supposed to be negative zero. |
1187 Label done; | 1187 Label done; |
1188 __ tst(left, Operand(left)); | 1188 __ tst(left, Operand(left)); |
1189 __ b(ne, &done); | 1189 __ b(ne, &done); |
1190 if (instr->InputAt(1)->IsConstantOperand()) { | 1190 if (instr->InputAt(1)->IsConstantOperand()) { |
1191 if (ToInteger32(LConstantOperand::cast(instr->InputAt(1))) < 0) { | 1191 if (ToInteger32(LConstantOperand::cast(instr->InputAt(1))) <= 0) { |
1192 DeoptimizeIf(kNoCondition, instr->environment()); | 1192 DeoptimizeIf(al, instr->environment()); |
1193 } | 1193 } |
1194 } else { | 1194 } else { |
1195 // Test the non-zero operand for negative sign. | 1195 // Test the non-zero operand for negative sign. |
1196 __ cmp(ToRegister(instr->TempAt(0)), Operand(0)); | 1196 __ cmp(ToRegister(instr->TempAt(0)), Operand(0)); |
1197 DeoptimizeIf(mi, instr->environment()); | 1197 DeoptimizeIf(mi, instr->environment()); |
1198 } | 1198 } |
1199 __ bind(&done); | 1199 __ bind(&done); |
1200 } | 1200 } |
1201 } | 1201 } |
1202 | 1202 |
(...skipping 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3771 } else { | 3771 } else { |
3772 final_branch_condition = ne; | 3772 final_branch_condition = ne; |
3773 __ b(false_label); | 3773 __ b(false_label); |
3774 // A dead branch instruction will be generated after this point. | 3774 // A dead branch instruction will be generated after this point. |
3775 } | 3775 } |
3776 | 3776 |
3777 return final_branch_condition; | 3777 return final_branch_condition; |
3778 } | 3778 } |
3779 | 3779 |
3780 | 3780 |
| 3781 void LCodeGen::DoIsConstructCall(LIsConstructCall* instr) { |
| 3782 Register result = ToRegister(instr->result()); |
| 3783 Label true_label; |
| 3784 Label false_label; |
| 3785 Label done; |
| 3786 |
| 3787 EmitIsConstructCall(result, scratch0()); |
| 3788 __ b(eq, &true_label); |
| 3789 |
| 3790 __ LoadRoot(result, Heap::kFalseValueRootIndex); |
| 3791 __ b(&done); |
| 3792 |
| 3793 |
| 3794 __ bind(&true_label); |
| 3795 __ LoadRoot(result, Heap::kTrueValueRootIndex); |
| 3796 |
| 3797 __ bind(&done); |
| 3798 } |
| 3799 |
| 3800 |
| 3801 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
| 3802 Register temp1 = ToRegister(instr->TempAt(0)); |
| 3803 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 3804 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 3805 |
| 3806 EmitIsConstructCall(temp1, scratch0()); |
| 3807 EmitBranch(true_block, false_block, eq); |
| 3808 } |
| 3809 |
| 3810 |
| 3811 void LCodeGen::EmitIsConstructCall(Register temp1, Register temp2) { |
| 3812 ASSERT(!temp1.is(temp2)); |
| 3813 // Get the frame pointer for the calling frame. |
| 3814 __ ldr(temp1, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 3815 |
| 3816 // Skip the arguments adaptor frame if it exists. |
| 3817 Label check_frame_marker; |
| 3818 __ ldr(temp2, MemOperand(temp1, StandardFrameConstants::kContextOffset)); |
| 3819 __ cmp(temp2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 3820 __ b(ne, &check_frame_marker); |
| 3821 __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); |
| 3822 |
| 3823 // Check the marker in the calling frame. |
| 3824 __ bind(&check_frame_marker); |
| 3825 __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); |
| 3826 __ cmp(temp1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); |
| 3827 } |
| 3828 |
| 3829 |
3781 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { | 3830 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { |
3782 // No code for lazy bailout instruction. Used to capture environment after a | 3831 // No code for lazy bailout instruction. Used to capture environment after a |
3783 // call for populating the safepoint data with deoptimization data. | 3832 // call for populating the safepoint data with deoptimization data. |
3784 } | 3833 } |
3785 | 3834 |
3786 | 3835 |
3787 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { | 3836 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { |
3788 DeoptimizeIf(kNoCondition, instr->environment()); | 3837 DeoptimizeIf(al, instr->environment()); |
3789 } | 3838 } |
3790 | 3839 |
3791 | 3840 |
3792 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { | 3841 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { |
3793 Register object = ToRegister(instr->object()); | 3842 Register object = ToRegister(instr->object()); |
3794 Register key = ToRegister(instr->key()); | 3843 Register key = ToRegister(instr->key()); |
3795 __ Push(object, key); | 3844 __ Push(object, key); |
3796 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); | 3845 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); |
3797 LPointerMap* pointers = instr->pointer_map(); | 3846 LPointerMap* pointers = instr->pointer_map(); |
3798 LEnvironment* env = instr->deoptimization_environment(); | 3847 LEnvironment* env = instr->deoptimization_environment(); |
(...skipping 19 matching lines...) Expand all Loading... |
3818 | 3867 |
3819 | 3868 |
3820 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 3869 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
3821 Abort("DoOsrEntry unimplemented."); | 3870 Abort("DoOsrEntry unimplemented."); |
3822 } | 3871 } |
3823 | 3872 |
3824 | 3873 |
3825 #undef __ | 3874 #undef __ |
3826 | 3875 |
3827 } } // namespace v8::internal | 3876 } } // namespace v8::internal |
OLD | NEW |