| 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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
| 9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 // condition code uses at the patched jump. | 844 // condition code uses at the patched jump. |
| 845 int delta = Assembler::GetCmpImmediateRawImmediate(instr); | 845 int delta = Assembler::GetCmpImmediateRawImmediate(instr); |
| 846 delta += Assembler::GetCmpImmediateRegister(instr).code() * kOff16Mask; | 846 delta += Assembler::GetCmpImmediateRegister(instr).code() * kOff16Mask; |
| 847 // If the delta is 0 the instruction is cmp r0, #0 which also signals that | 847 // If the delta is 0 the instruction is cmp r0, #0 which also signals that |
| 848 // nothing was inlined. | 848 // nothing was inlined. |
| 849 if (delta == 0) { | 849 if (delta == 0) { |
| 850 return; | 850 return; |
| 851 } | 851 } |
| 852 | 852 |
| 853 if (FLAG_trace_ic) { | 853 if (FLAG_trace_ic) { |
| 854 PrintF("[ patching ic at %p, cmp=%p, delta=%d\n", address, | 854 PrintF("[ patching ic at %p, cmp=%p, delta=%d\n", |
| 855 cmp_instruction_address, delta); | 855 static_cast<void*>(address), |
| 856 static_cast<void*>(cmp_instruction_address), delta); |
| 856 } | 857 } |
| 857 | 858 |
| 858 Address patch_address = | 859 Address patch_address = |
| 859 cmp_instruction_address - delta * Instruction::kInstrSize; | 860 cmp_instruction_address - delta * Instruction::kInstrSize; |
| 860 Instr instr_at_patch = Assembler::instr_at(patch_address); | 861 Instr instr_at_patch = Assembler::instr_at(patch_address); |
| 861 Instr branch_instr = | 862 Instr branch_instr = |
| 862 Assembler::instr_at(patch_address + Instruction::kInstrSize); | 863 Assembler::instr_at(patch_address + Instruction::kInstrSize); |
| 863 // This is patching a conditional "jump if not smi/jump if smi" site. | 864 // This is patching a conditional "jump if not smi/jump if smi" site. |
| 864 // Enabling by changing from | 865 // Enabling by changing from |
| 865 // cmp cr0, rx, rx | 866 // cmp cr0, rx, rx |
| (...skipping 20 matching lines...) Expand all Loading... |
| 886 patcher.EmitCondition(ne); | 887 patcher.EmitCondition(ne); |
| 887 } else { | 888 } else { |
| 888 DCHECK(Assembler::GetCondition(branch_instr) == ne); | 889 DCHECK(Assembler::GetCondition(branch_instr) == ne); |
| 889 patcher.EmitCondition(eq); | 890 patcher.EmitCondition(eq); |
| 890 } | 891 } |
| 891 } | 892 } |
| 892 } // namespace internal | 893 } // namespace internal |
| 893 } // namespace v8 | 894 } // namespace v8 |
| 894 | 895 |
| 895 #endif // V8_TARGET_ARCH_PPC | 896 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |