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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 ? AssignEnvironment(DefineSameAsFirst(result)) | 863 ? AssignEnvironment(DefineSameAsFirst(result)) |
864 : DefineSameAsFirst(result); | 864 : DefineSameAsFirst(result); |
865 } | 865 } |
866 | 866 |
867 | 867 |
868 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, | 868 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, |
869 HArithmeticBinaryOperation* instr) { | 869 HArithmeticBinaryOperation* instr) { |
870 ASSERT(instr->representation().IsDouble()); | 870 ASSERT(instr->representation().IsDouble()); |
871 ASSERT(instr->left()->representation().IsDouble()); | 871 ASSERT(instr->left()->representation().IsDouble()); |
872 ASSERT(instr->right()->representation().IsDouble()); | 872 ASSERT(instr->right()->representation().IsDouble()); |
873 LOperand* left = UseRegisterAtStart(instr->left()); | 873 if (op == Token::MOD) { |
874 LOperand* right = UseRegisterAtStart(instr->right()); | 874 LOperand* left = UseFixedDouble(instr->left(), xmm2); |
875 LArithmeticD* result = new LArithmeticD(op, left, right); | 875 LOperand* right = UseFixedDouble(instr->right(), xmm1); |
876 return DefineSameAsFirst(result); | 876 LArithmeticD* result = new LArithmeticD(op, left, right); |
| 877 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); |
| 878 |
| 879 } else { |
| 880 LOperand* left = UseRegisterAtStart(instr->left()); |
| 881 LOperand* right = UseRegisterAtStart(instr->right()); |
| 882 LArithmeticD* result = new LArithmeticD(op, left, right); |
| 883 return DefineSameAsFirst(result); |
| 884 } |
877 } | 885 } |
878 | 886 |
879 | 887 |
880 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, | 888 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |
881 HArithmeticBinaryOperation* instr) { | 889 HArithmeticBinaryOperation* instr) { |
882 ASSERT(op == Token::ADD || | 890 ASSERT(op == Token::ADD || |
883 op == Token::DIV || | 891 op == Token::DIV || |
884 op == Token::MOD || | 892 op == Token::MOD || |
885 op == Token::MUL || | 893 op == Token::MUL || |
886 op == Token::SUB); | 894 op == Token::SUB); |
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2087 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
2080 HEnvironment* outer = current_block_->last_environment()->outer(); | 2088 HEnvironment* outer = current_block_->last_environment()->outer(); |
2081 current_block_->UpdateEnvironment(outer); | 2089 current_block_->UpdateEnvironment(outer); |
2082 return NULL; | 2090 return NULL; |
2083 } | 2091 } |
2084 | 2092 |
2085 | 2093 |
2086 } } // namespace v8::internal | 2094 } } // namespace v8::internal |
2087 | 2095 |
2088 #endif // V8_TARGET_ARCH_IA32 | 2096 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |