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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 return DoArithmeticT(op, instr); | 801 return DoArithmeticT(op, instr); |
802 } | 802 } |
803 } | 803 } |
804 | 804 |
805 | 805 |
806 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, | 806 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, |
807 HArithmeticBinaryOperation* instr) { | 807 HArithmeticBinaryOperation* instr) { |
808 ASSERT(instr->representation().IsDouble()); | 808 ASSERT(instr->representation().IsDouble()); |
809 ASSERT(instr->left()->representation().IsDouble()); | 809 ASSERT(instr->left()->representation().IsDouble()); |
810 ASSERT(instr->right()->representation().IsDouble()); | 810 ASSERT(instr->right()->representation().IsDouble()); |
811 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 811 if (op == Token::MOD) { |
812 LOperand* right = UseRegisterAtStart(instr->BetterRightOperand()); | 812 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
813 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); | 813 LOperand* right = UseRegisterAtStart(instr->BetterRightOperand()); |
814 if (op == Token::MOD) return MarkAsCall(DefineSameAsFirst(result), instr); | 814 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); |
815 return DefineSameAsFirst(result); | 815 return MarkAsCall(DefineSameAsFirst(result), instr); |
| 816 } else { |
| 817 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
| 818 LOperand* right = UseRegisterAtStart(instr->BetterRightOperand()); |
| 819 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); |
| 820 return DefineSameAsFirst(result); |
| 821 } |
816 } | 822 } |
817 | 823 |
818 | 824 |
819 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, | 825 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |
820 HBinaryOperation* instr) { | 826 HBinaryOperation* instr) { |
821 HValue* left = instr->left(); | 827 HValue* left = instr->left(); |
822 HValue* right = instr->right(); | 828 HValue* right = instr->right(); |
823 ASSERT(left->representation().IsTagged()); | 829 ASSERT(left->representation().IsTagged()); |
824 ASSERT(right->representation().IsTagged()); | 830 ASSERT(right->representation().IsTagged()); |
825 LOperand* context = UseFixed(instr->context(), esi); | 831 LOperand* context = UseFixed(instr->context(), esi); |
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2714 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2720 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2715 LOperand* object = UseRegister(instr->object()); | 2721 LOperand* object = UseRegister(instr->object()); |
2716 LOperand* index = UseTempRegister(instr->index()); | 2722 LOperand* index = UseTempRegister(instr->index()); |
2717 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2723 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2718 } | 2724 } |
2719 | 2725 |
2720 | 2726 |
2721 } } // namespace v8::internal | 2727 } } // namespace v8::internal |
2722 | 2728 |
2723 #endif // V8_TARGET_ARCH_IA32 | 2729 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |