| 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 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 // Correct the sign of the result is the constant is negative. | 1005 // Correct the sign of the result is the constant is negative. |
| 1006 if (constant < 0) { | 1006 if (constant < 0) { |
| 1007 __ Subu(result, zero_reg, result); | 1007 __ Subu(result, zero_reg, result); |
| 1008 } | 1008 } |
| 1009 | 1009 |
| 1010 } else { | 1010 } else { |
| 1011 // Generate standard code. | 1011 // Generate standard code. |
| 1012 __ li(at, constant); | 1012 __ li(at, constant); |
| 1013 __ mul(result, left, at); | 1013 __ Mul(result, left, at); |
| 1014 } | 1014 } |
| 1015 } | 1015 } |
| 1016 | 1016 |
| 1017 } else { | 1017 } else { |
| 1018 Register right = EmitLoadRegister(right_op, scratch); | 1018 Register right = EmitLoadRegister(right_op, scratch); |
| 1019 if (bailout_on_minus_zero) { | 1019 if (bailout_on_minus_zero) { |
| 1020 __ Or(ToRegister(instr->TempAt(0)), left, right); | 1020 __ Or(ToRegister(instr->TempAt(0)), left, right); |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 if (can_overflow) { | 1023 if (can_overflow) { |
| 1024 // hi:lo = left * right. | 1024 // hi:lo = left * right. |
| 1025 __ mult(left, right); | 1025 __ mult(left, right); |
| 1026 __ mfhi(scratch); | 1026 __ mfhi(scratch); |
| 1027 __ mflo(result); | 1027 __ mflo(result); |
| 1028 __ sra(at, result, 31); | 1028 __ sra(at, result, 31); |
| 1029 DeoptimizeIf(ne, instr->environment(), scratch, Operand(at)); | 1029 DeoptimizeIf(ne, instr->environment(), scratch, Operand(at)); |
| 1030 } else { | 1030 } else { |
| 1031 __ mul(result, left, right); | 1031 __ Mul(result, left, right); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 if (bailout_on_minus_zero) { | 1034 if (bailout_on_minus_zero) { |
| 1035 // Bail out if the result is supposed to be negative zero. | 1035 // Bail out if the result is supposed to be negative zero. |
| 1036 Label done; | 1036 Label done; |
| 1037 __ Branch(&done, ne, result, Operand(zero_reg)); | 1037 __ Branch(&done, ne, result, Operand(zero_reg)); |
| 1038 DeoptimizeIf(lt, | 1038 DeoptimizeIf(lt, |
| 1039 instr->environment(), | 1039 instr->environment(), |
| 1040 ToRegister(instr->TempAt(0)), | 1040 ToRegister(instr->TempAt(0)), |
| 1041 Operand(zero_reg)); | 1041 Operand(zero_reg)); |
| (...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2609 Register result = ToRegister(instr->result()); | 2609 Register result = ToRegister(instr->result()); |
| 2610 | 2610 |
| 2611 // Check if the calling frame is an arguments adaptor frame. | 2611 // Check if the calling frame is an arguments adaptor frame. |
| 2612 Label done, adapted; | 2612 Label done, adapted; |
| 2613 __ lw(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2613 __ lw(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2614 __ lw(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); | 2614 __ lw(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); |
| 2615 __ Xor(temp, result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 2615 __ Xor(temp, result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 2616 | 2616 |
| 2617 // Result is the frame pointer for the frame if not adapted and for the real | 2617 // Result is the frame pointer for the frame if not adapted and for the real |
| 2618 // frame below the adaptor frame if adapted. | 2618 // frame below the adaptor frame if adapted. |
| 2619 __ movn(result, fp, temp); // move only if temp is not equal to zero (ne) | 2619 __ Movn(result, fp, temp); // Move only if temp is not equal to zero (ne). |
| 2620 __ movz(result, scratch, temp); // move only if temp is equal to zero (eq) | 2620 __ Movz(result, scratch, temp); // Move only if temp is equal to zero (eq). |
| 2621 } | 2621 } |
| 2622 | 2622 |
| 2623 | 2623 |
| 2624 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 2624 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
| 2625 Register elem = ToRegister(instr->InputAt(0)); | 2625 Register elem = ToRegister(instr->InputAt(0)); |
| 2626 Register result = ToRegister(instr->result()); | 2626 Register result = ToRegister(instr->result()); |
| 2627 | 2627 |
| 2628 Label done; | 2628 Label done; |
| 2629 | 2629 |
| 2630 // If no arguments adaptor frame the number of arguments is fixed. | 2630 // If no arguments adaptor frame the number of arguments is fixed. |
| (...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4786 ASSERT(!environment->HasBeenRegistered()); | 4786 ASSERT(!environment->HasBeenRegistered()); |
| 4787 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4787 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 4788 ASSERT(osr_pc_offset_ == -1); | 4788 ASSERT(osr_pc_offset_ == -1); |
| 4789 osr_pc_offset_ = masm()->pc_offset(); | 4789 osr_pc_offset_ = masm()->pc_offset(); |
| 4790 } | 4790 } |
| 4791 | 4791 |
| 4792 | 4792 |
| 4793 #undef __ | 4793 #undef __ |
| 4794 | 4794 |
| 4795 } } // namespace v8::internal | 4795 } } // namespace v8::internal |
| OLD | NEW |