OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 j(negative, on_not_smi_result); | 1220 j(negative, on_not_smi_result); |
1221 } | 1221 } |
1222 shr(dst, Immediate(shift_value + kSmiShift)); | 1222 shr(dst, Immediate(shift_value + kSmiShift)); |
1223 shl(dst, Immediate(kSmiShift)); | 1223 shl(dst, Immediate(kSmiShift)); |
1224 } | 1224 } |
1225 } | 1225 } |
1226 | 1226 |
1227 | 1227 |
1228 void MacroAssembler::SmiShiftLeftConstant(Register dst, | 1228 void MacroAssembler::SmiShiftLeftConstant(Register dst, |
1229 Register src, | 1229 Register src, |
1230 int shift_value, | 1230 int shift_value) { |
1231 Label* on_not_smi_result) { | |
1232 if (!dst.is(src)) { | 1231 if (!dst.is(src)) { |
1233 movq(dst, src); | 1232 movq(dst, src); |
1234 } | 1233 } |
1235 if (shift_value > 0) { | 1234 if (shift_value > 0) { |
1236 shl(dst, Immediate(shift_value)); | 1235 shl(dst, Immediate(shift_value)); |
1237 } | 1236 } |
1238 } | 1237 } |
1239 | 1238 |
1240 | 1239 |
1241 void MacroAssembler::SmiShiftLeft(Register dst, | 1240 void MacroAssembler::SmiShiftLeft(Register dst, |
1242 Register src1, | 1241 Register src1, |
1243 Register src2, | 1242 Register src2) { |
1244 Label* on_not_smi_result) { | |
1245 ASSERT(!dst.is(rcx)); | 1243 ASSERT(!dst.is(rcx)); |
1246 Label result_ok; | 1244 Label result_ok; |
1247 // Untag shift amount. | 1245 // Untag shift amount. |
1248 if (!dst.is(src1)) { | 1246 if (!dst.is(src1)) { |
1249 movq(dst, src1); | 1247 movq(dst, src1); |
1250 } | 1248 } |
1251 SmiToInteger32(rcx, src2); | 1249 SmiToInteger32(rcx, src2); |
1252 // Shift amount specified by lower 5 bits, not six as the shl opcode. | 1250 // Shift amount specified by lower 5 bits, not six as the shl opcode. |
1253 and_(rcx, Immediate(0x1f)); | 1251 and_(rcx, Immediate(0x1f)); |
1254 shl_cl(dst); | 1252 shl_cl(dst); |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2756 CodePatcher::~CodePatcher() { | 2754 CodePatcher::~CodePatcher() { |
2757 // Indicate that code has changed. | 2755 // Indicate that code has changed. |
2758 CPU::FlushICache(address_, size_); | 2756 CPU::FlushICache(address_, size_); |
2759 | 2757 |
2760 // Check that the code was patched as expected. | 2758 // Check that the code was patched as expected. |
2761 ASSERT(masm_.pc_ == address_ + size_); | 2759 ASSERT(masm_.pc_ == address_ + size_); |
2762 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2760 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2763 } | 2761 } |
2764 | 2762 |
2765 } } // namespace v8::internal | 2763 } } // namespace v8::internal |
OLD | NEW |