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 3692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3703 b(ne, call_runtime); | 3703 b(ne, call_runtime); |
3704 | 3704 |
3705 // Load the prototype from the map and loop if non-null. | 3705 // Load the prototype from the map and loop if non-null. |
3706 bind(&check_prototype); | 3706 bind(&check_prototype); |
3707 ldr(r1, FieldMemOperand(r2, Map::kPrototypeOffset)); | 3707 ldr(r1, FieldMemOperand(r2, Map::kPrototypeOffset)); |
3708 cmp(r1, null_value); | 3708 cmp(r1, null_value); |
3709 b(ne, &next); | 3709 b(ne, &next); |
3710 } | 3710 } |
3711 | 3711 |
3712 | 3712 |
3713 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { | 3713 #ifdef DEBUG |
3714 if (r1.is(r2)) return true; | 3714 bool AreAliased(Register reg1, |
3715 if (r1.is(r3)) return true; | 3715 Register reg2, |
3716 if (r1.is(r4)) return true; | 3716 Register reg3, |
3717 if (r2.is(r3)) return true; | 3717 Register reg4, |
3718 if (r2.is(r4)) return true; | 3718 Register reg5, |
3719 if (r3.is(r4)) return true; | 3719 Register reg6) { |
3720 return false; | 3720 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + |
| 3721 reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid(); |
| 3722 |
| 3723 RegList regs = 0; |
| 3724 if (reg1.is_valid()) regs |= reg1.bit(); |
| 3725 if (reg2.is_valid()) regs |= reg2.bit(); |
| 3726 if (reg3.is_valid()) regs |= reg3.bit(); |
| 3727 if (reg4.is_valid()) regs |= reg4.bit(); |
| 3728 if (reg5.is_valid()) regs |= reg5.bit(); |
| 3729 if (reg6.is_valid()) regs |= reg6.bit(); |
| 3730 int n_of_non_aliasing_regs = NumRegs(regs); |
| 3731 |
| 3732 return n_of_valid_regs != n_of_non_aliasing_regs; |
3721 } | 3733 } |
| 3734 #endif |
3722 | 3735 |
3723 | 3736 |
3724 CodePatcher::CodePatcher(byte* address, int instructions) | 3737 CodePatcher::CodePatcher(byte* address, int instructions) |
3725 : address_(address), | 3738 : address_(address), |
3726 instructions_(instructions), | 3739 instructions_(instructions), |
3727 size_(instructions * Assembler::kInstrSize), | 3740 size_(instructions * Assembler::kInstrSize), |
3728 masm_(Isolate::Current(), address, size_ + Assembler::kGap) { | 3741 masm_(Isolate::Current(), address, size_ + Assembler::kGap) { |
3729 // Create a new macro assembler pointing to the address of the code to patch. | 3742 // Create a new macro assembler pointing to the address of the code to patch. |
3730 // The size is adjusted with kGap on order for the assembler to generate size | 3743 // The size is adjusted with kGap on order for the assembler to generate size |
3731 // bytes of instructions without failing with buffer size constraints. | 3744 // bytes of instructions without failing with buffer size constraints. |
(...skipping 24 matching lines...) Expand all Loading... |
3756 void CodePatcher::EmitCondition(Condition cond) { | 3769 void CodePatcher::EmitCondition(Condition cond) { |
3757 Instr instr = Assembler::instr_at(masm_.pc_); | 3770 Instr instr = Assembler::instr_at(masm_.pc_); |
3758 instr = (instr & ~kCondMask) | cond; | 3771 instr = (instr & ~kCondMask) | cond; |
3759 masm_.emit(instr); | 3772 masm_.emit(instr); |
3760 } | 3773 } |
3761 | 3774 |
3762 | 3775 |
3763 } } // namespace v8::internal | 3776 } } // namespace v8::internal |
3764 | 3777 |
3765 #endif // V8_TARGET_ARCH_ARM | 3778 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |