| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 __ orr(destination(), accumulator1(), Operand(accumulator0())); | 149 __ orr(destination(), accumulator1(), Operand(accumulator0())); |
| 150 } | 150 } |
| 151 } else if (destination().is(no_reg)) { | 151 } else if (destination().is(no_reg)) { |
| 152 // Result is not needed but do not clobber the operands in case of | 152 // Result is not needed but do not clobber the operands in case of |
| 153 // bailout. | 153 // bailout. |
| 154 __ orr(scratch0(), accumulator1(), Operand(accumulator0())); | 154 __ orr(scratch0(), accumulator1(), Operand(accumulator0())); |
| 155 __ BranchOnNotSmi(scratch0(), bailout()); | 155 __ BranchOnNotSmi(scratch0(), bailout()); |
| 156 } else { | 156 } else { |
| 157 // Preserve the destination operand in a scratch register in case of | 157 // Preserve the destination operand in a scratch register in case of |
| 158 // bailout. | 158 // bailout. |
| 159 Label done; | |
| 160 __ mov(scratch0(), destination()); | 159 __ mov(scratch0(), destination()); |
| 161 __ orr(destination(), accumulator1(), Operand(accumulator0())); | 160 __ orr(destination(), accumulator1(), Operand(accumulator0())); |
| 162 __ BranchOnSmi(destination(), &done); | 161 __ BranchOnNotSmi(destination(), bailout()); |
| 163 __ mov(destination(), scratch0()); | |
| 164 __ jmp(bailout()); | |
| 165 __ bind(&done); | |
| 166 } | 162 } |
| 167 | 163 |
| 168 // If we didn't bailout, the result (in fact, both inputs too) is known to | 164 // If we didn't bailout, the result (in fact, both inputs too) is known to |
| 169 // be a smi. | 165 // be a smi. |
| 170 set_as_smi(accumulator0()); | 166 set_as_smi(accumulator0()); |
| 171 set_as_smi(accumulator1()); | 167 set_as_smi(accumulator1()); |
| 172 } | 168 } |
| 173 | 169 |
| 174 | 170 |
| 175 void FastCodeGenerator::Generate(CompilationInfo* compilation_info) { | 171 void FastCodeGenerator::Generate(CompilationInfo* compilation_info) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 __ Jump(lr); | 219 __ Jump(lr); |
| 224 | 220 |
| 225 __ bind(&bailout_); | 221 __ bind(&bailout_); |
| 226 } | 222 } |
| 227 | 223 |
| 228 | 224 |
| 229 #undef __ | 225 #undef __ |
| 230 | 226 |
| 231 | 227 |
| 232 } } // namespace v8::internal | 228 } } // namespace v8::internal |
| OLD | NEW |