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 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 sub(scratch2, scratch2, Operand(fudge_factor)); | 2380 sub(scratch2, scratch2, Operand(fudge_factor)); |
2381 cmp(scratch2, Operand(non_smi_exponent - fudge_factor)); | 2381 cmp(scratch2, Operand(non_smi_exponent - fudge_factor)); |
2382 // If we have a match of the int32-but-not-Smi exponent then skip some | 2382 // If we have a match of the int32-but-not-Smi exponent then skip some |
2383 // logic. | 2383 // logic. |
2384 b(eq, &right_exponent); | 2384 b(eq, &right_exponent); |
2385 // If the exponent is higher than that then go to slow case. This catches | 2385 // If the exponent is higher than that then go to slow case. This catches |
2386 // numbers that don't fit in a signed int32, infinities and NaNs. | 2386 // numbers that don't fit in a signed int32, infinities and NaNs. |
2387 b(gt, not_int32); | 2387 b(gt, not_int32); |
2388 | 2388 |
2389 // We know the exponent is smaller than 30 (biased). If it is less than | 2389 // We know the exponent is smaller than 30 (biased). If it is less than |
2390 // 0 (biased) then the number is smaller in magnitude than 1.0 * 2^0, ie | 2390 // 0 (biased) then the number is smaller in magnitude than 1.0 * 2^0, i.e. |
2391 // it rounds to zero. | 2391 // it rounds to zero. |
2392 const uint32_t zero_exponent = HeapNumber::kExponentBias + 0; | 2392 const uint32_t zero_exponent = HeapNumber::kExponentBias + 0; |
2393 sub(scratch2, scratch2, Operand(zero_exponent - fudge_factor), SetCC); | 2393 sub(scratch2, scratch2, Operand(zero_exponent - fudge_factor), SetCC); |
2394 // Dest already has a Smi zero. | 2394 // Dest already has a Smi zero. |
2395 b(lt, &done); | 2395 b(lt, &done); |
2396 | 2396 |
2397 // We have an exponent between 0 and 30 in scratch2. Subtract from 30 to | 2397 // We have an exponent between 0 and 30 in scratch2. Subtract from 30 to |
2398 // get how much to shift down. | 2398 // get how much to shift down. |
2399 rsb(dest, scratch2, Operand(30)); | 2399 rsb(dest, scratch2, Operand(30)); |
2400 | 2400 |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3666 void CodePatcher::EmitCondition(Condition cond) { | 3666 void CodePatcher::EmitCondition(Condition cond) { |
3667 Instr instr = Assembler::instr_at(masm_.pc_); | 3667 Instr instr = Assembler::instr_at(masm_.pc_); |
3668 instr = (instr & ~kCondMask) | cond; | 3668 instr = (instr & ~kCondMask) | cond; |
3669 masm_.emit(instr); | 3669 masm_.emit(instr); |
3670 } | 3670 } |
3671 | 3671 |
3672 | 3672 |
3673 } } // namespace v8::internal | 3673 } } // namespace v8::internal |
3674 | 3674 |
3675 #endif // V8_TARGET_ARCH_ARM | 3675 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |