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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } else if (destination().is(no_reg)) { | 158 } else if (destination().is(no_reg)) { |
159 // Result is not needed but do not clobber the operands in case of | 159 // Result is not needed but do not clobber the operands in case of |
160 // bailout. | 160 // bailout. |
161 __ mov(scratch0(), accumulator1()); | 161 __ mov(scratch0(), accumulator1()); |
162 __ or_(scratch0(), Operand(accumulator0())); | 162 __ or_(scratch0(), Operand(accumulator0())); |
163 __ test(scratch0(), Immediate(kSmiTagMask)); | 163 __ test(scratch0(), Immediate(kSmiTagMask)); |
164 __ j(not_zero, bailout(), not_taken); | 164 __ j(not_zero, bailout(), not_taken); |
165 } else { | 165 } else { |
166 // Preserve the destination operand in a scratch register in case of | 166 // Preserve the destination operand in a scratch register in case of |
167 // bailout. | 167 // bailout. |
168 Label done; | |
169 __ mov(scratch0(), destination()); | 168 __ mov(scratch0(), destination()); |
170 __ or_(destination(), Operand(other_accumulator(destination()))); | 169 __ or_(destination(), Operand(other_accumulator(destination()))); |
171 __ test(destination(), Immediate(kSmiTagMask)); | 170 __ test(destination(), Immediate(kSmiTagMask)); |
172 __ j(zero, &done, taken); | 171 __ j(not_zero, bailout(), not_taken); |
173 __ mov(destination(), scratch0()); | |
174 __ jmp(bailout()); | |
175 __ bind(&done); | |
176 } | 172 } |
177 | 173 |
178 // If we didn't bailout, the result (in fact, both inputs too) is known to | 174 // If we didn't bailout, the result (in fact, both inputs too) is known to |
179 // be a smi. | 175 // be a smi. |
180 set_as_smi(accumulator0()); | 176 set_as_smi(accumulator0()); |
181 set_as_smi(accumulator1()); | 177 set_as_smi(accumulator1()); |
182 } | 178 } |
183 | 179 |
184 | 180 |
185 void FastCodeGenerator::Generate(CompilationInfo* compilation_info) { | 181 void FastCodeGenerator::Generate(CompilationInfo* compilation_info) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 __ ret((scope()->num_parameters() + 1) * kPointerSize); | 229 __ ret((scope()->num_parameters() + 1) * kPointerSize); |
234 | 230 |
235 __ bind(&bailout_); | 231 __ bind(&bailout_); |
236 } | 232 } |
237 | 233 |
238 | 234 |
239 #undef __ | 235 #undef __ |
240 | 236 |
241 | 237 |
242 } } // namespace v8::internal | 238 } } // namespace v8::internal |
OLD | NEW |