| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 // and vice-versa to be disabled again. | 867 // and vice-versa to be disabled again. |
| 868 CodePatcher patcher(patch_address, 2); | 868 CodePatcher patcher(patch_address, 2); |
| 869 Register reg = Assembler::GetRA(instr_at_patch); | 869 Register reg = Assembler::GetRA(instr_at_patch); |
| 870 if (check == ENABLE_INLINED_SMI_CHECK) { | 870 if (check == ENABLE_INLINED_SMI_CHECK) { |
| 871 DCHECK(Assembler::IsCmpRegister(instr_at_patch)); | 871 DCHECK(Assembler::IsCmpRegister(instr_at_patch)); |
| 872 DCHECK_EQ(Assembler::GetRA(instr_at_patch).code(), | 872 DCHECK_EQ(Assembler::GetRA(instr_at_patch).code(), |
| 873 Assembler::GetRB(instr_at_patch).code()); | 873 Assembler::GetRB(instr_at_patch).code()); |
| 874 patcher.masm()->TestIfSmi(reg, r0); | 874 patcher.masm()->TestIfSmi(reg, r0); |
| 875 } else { | 875 } else { |
| 876 DCHECK(check == DISABLE_INLINED_SMI_CHECK); | 876 DCHECK(check == DISABLE_INLINED_SMI_CHECK); |
| 877 #if V8_TARGET_ARCH_PPC64 | 877 DCHECK(Assembler::IsAndi(instr_at_patch)); |
| 878 DCHECK(Assembler::IsRldicl(instr_at_patch)); | |
| 879 #else | |
| 880 DCHECK(Assembler::IsRlwinm(instr_at_patch)); | |
| 881 #endif | |
| 882 patcher.masm()->cmp(reg, reg, cr0); | 878 patcher.masm()->cmp(reg, reg, cr0); |
| 883 } | 879 } |
| 884 DCHECK(Assembler::IsBranch(branch_instr)); | 880 DCHECK(Assembler::IsBranch(branch_instr)); |
| 885 | 881 |
| 886 // Invert the logic of the branch | 882 // Invert the logic of the branch |
| 887 if (Assembler::GetCondition(branch_instr) == eq) { | 883 if (Assembler::GetCondition(branch_instr) == eq) { |
| 888 patcher.EmitCondition(ne); | 884 patcher.EmitCondition(ne); |
| 889 } else { | 885 } else { |
| 890 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 886 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
| 891 patcher.EmitCondition(eq); | 887 patcher.EmitCondition(eq); |
| 892 } | 888 } |
| 893 } | 889 } |
| 894 } // namespace internal | 890 } // namespace internal |
| 895 } // namespace v8 | 891 } // namespace v8 |
| 896 | 892 |
| 897 #endif // V8_TARGET_ARCH_PPC | 893 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |