OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5065 if (!initialized) { | 5065 if (!initialized) { |
5066 PatchingAssembler patcher(old, length); | 5066 PatchingAssembler patcher(old, length); |
5067 MacroAssembler::EmitCodeAgeSequence(&patcher, NULL); | 5067 MacroAssembler::EmitCodeAgeSequence(&patcher, NULL); |
5068 initialized = true; | 5068 initialized = true; |
5069 } | 5069 } |
5070 return memcmp(sequence, old, kCodeAgeStubEntryOffset) == 0; | 5070 return memcmp(sequence, old, kCodeAgeStubEntryOffset) == 0; |
5071 } | 5071 } |
5072 #endif | 5072 #endif |
5073 | 5073 |
5074 | 5074 |
5075 void MacroAssembler::FlooringDiv(Register result, | 5075 void MacroAssembler::TruncatingDiv(Register result, |
5076 Register dividend, | 5076 Register dividend, |
5077 int32_t divisor) { | 5077 int32_t divisor) { |
5078 ASSERT(!AreAliased(result, dividend)); | 5078 ASSERT(!AreAliased(result, dividend)); |
5079 ASSERT(result.Is32Bits() && dividend.Is32Bits()); | 5079 ASSERT(result.Is32Bits() && dividend.Is32Bits()); |
5080 MultiplierAndShift ms(divisor); | 5080 MultiplierAndShift ms(divisor); |
5081 Mov(result, Operand(ms.multiplier())); | 5081 Mov(result, Operand(ms.multiplier())); |
5082 Smull(result.X(), dividend, result); | 5082 Smull(result.X(), dividend, result); |
5083 Asr(result.X(), result.X(), 32); | 5083 Asr(result.X(), result.X(), 32); |
5084 if (divisor > 0 && ms.multiplier() < 0) Add(result, result, dividend); | 5084 if (divisor > 0 && ms.multiplier() < 0) Add(result, result, dividend); |
5085 if (divisor < 0 && ms.multiplier() > 0) Sub(result, result, dividend); | 5085 if (divisor < 0 && ms.multiplier() > 0) Sub(result, result, dividend); |
5086 if (ms.shift() > 0) Asr(result, result, ms.shift()); | 5086 if (ms.shift() > 0) Asr(result, result, ms.shift()); |
| 5087 Add(result, result, Operand(dividend, LSR, 31)); |
5087 } | 5088 } |
5088 | 5089 |
5089 | 5090 |
5090 #undef __ | 5091 #undef __ |
5091 | 5092 |
5092 | 5093 |
5093 UseScratchRegisterScope::~UseScratchRegisterScope() { | 5094 UseScratchRegisterScope::~UseScratchRegisterScope() { |
5094 available_->set_list(old_available_); | 5095 available_->set_list(old_available_); |
5095 availablefp_->set_list(old_availablefp_); | 5096 availablefp_->set_list(old_availablefp_); |
5096 } | 5097 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5161 } | 5162 } |
5162 } | 5163 } |
5163 | 5164 |
5164 | 5165 |
5165 #undef __ | 5166 #undef __ |
5166 | 5167 |
5167 | 5168 |
5168 } } // namespace v8::internal | 5169 } } // namespace v8::internal |
5169 | 5170 |
5170 #endif // V8_TARGET_ARCH_A64 | 5171 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |