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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 j(negative, on_not_smi_result); | 729 j(negative, on_not_smi_result); |
730 bind(&non_zero_result); | 730 bind(&non_zero_result); |
731 } | 731 } |
732 | 732 |
733 | 733 |
734 void MacroAssembler::SmiTryAddConstant(Register dst, | 734 void MacroAssembler::SmiTryAddConstant(Register dst, |
735 Register src, | 735 Register src, |
736 int32_t constant, | 736 int32_t constant, |
737 Label* on_not_smi_result) { | 737 Label* on_not_smi_result) { |
738 // Does not assume that src is a smi. | 738 // Does not assume that src is a smi. |
739 ASSERT_EQ(1, kSmiTagMask); | 739 ASSERT_EQ(static_cast<intptr_t>(1), kSmiTagMask); |
740 ASSERT_EQ(0, kSmiTag); | 740 ASSERT_EQ(0, kSmiTag); |
741 ASSERT(Smi::IsValid(constant)); | 741 ASSERT(Smi::IsValid(constant)); |
742 | 742 |
743 Register tmp = (src.is(dst) ? kScratchRegister : dst); | 743 Register tmp = (src.is(dst) ? kScratchRegister : dst); |
744 movl(tmp, src); | 744 movl(tmp, src); |
745 addl(tmp, Immediate(Smi::FromInt(constant))); | 745 addl(tmp, Immediate(Smi::FromInt(constant))); |
746 if (tmp.is(kScratchRegister)) { | 746 if (tmp.is(kScratchRegister)) { |
747 j(overflow, on_not_smi_result); | 747 j(overflow, on_not_smi_result); |
748 testl(tmp, Immediate(kSmiTagMask)); | 748 testl(tmp, Immediate(kSmiTagMask)); |
749 j(not_zero, on_not_smi_result); | 749 j(not_zero, on_not_smi_result); |
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 // Indicate that code has changed. | 2155 // Indicate that code has changed. |
2156 CPU::FlushICache(address_, size_); | 2156 CPU::FlushICache(address_, size_); |
2157 | 2157 |
2158 // Check that the code was patched as expected. | 2158 // Check that the code was patched as expected. |
2159 ASSERT(masm_.pc_ == address_ + size_); | 2159 ASSERT(masm_.pc_ == address_ + size_); |
2160 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2160 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2161 } | 2161 } |
2162 | 2162 |
2163 | 2163 |
2164 } } // namespace v8::internal | 2164 } } // namespace v8::internal |
OLD | NEW |