| 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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1634   // condition code uses at the patched jump. | 1634   // condition code uses at the patched jump. | 
| 1635   int delta = Assembler::GetCmpImmediateRawImmediate(instr); | 1635   int delta = Assembler::GetCmpImmediateRawImmediate(instr); | 
| 1636   delta += | 1636   delta += | 
| 1637       Assembler::GetCmpImmediateRegister(instr).code() * kOff12Mask; | 1637       Assembler::GetCmpImmediateRegister(instr).code() * kOff12Mask; | 
| 1638   // If the delta is 0 the instruction is cmp r0, #0 which also signals that | 1638   // If the delta is 0 the instruction is cmp r0, #0 which also signals that | 
| 1639   // nothing was inlined. | 1639   // nothing was inlined. | 
| 1640   if (delta == 0) { | 1640   if (delta == 0) { | 
| 1641     return; | 1641     return; | 
| 1642   } | 1642   } | 
| 1643 | 1643 | 
| 1644 #ifdef DEBUG |  | 
| 1645   if (FLAG_trace_ic) { | 1644   if (FLAG_trace_ic) { | 
| 1646     PrintF("[  patching ic at %p, cmp=%p, delta=%d\n", | 1645     PrintF("[  patching ic at %p, cmp=%p, delta=%d\n", | 
| 1647            address, cmp_instruction_address, delta); | 1646            address, cmp_instruction_address, delta); | 
| 1648   } | 1647   } | 
| 1649 #endif |  | 
| 1650 | 1648 | 
| 1651   Address patch_address = | 1649   Address patch_address = | 
| 1652       cmp_instruction_address - delta * Instruction::kInstrSize; | 1650       cmp_instruction_address - delta * Instruction::kInstrSize; | 
| 1653   Instr instr_at_patch = Assembler::instr_at(patch_address); | 1651   Instr instr_at_patch = Assembler::instr_at(patch_address); | 
| 1654   Instr branch_instr = | 1652   Instr branch_instr = | 
| 1655       Assembler::instr_at(patch_address + Instruction::kInstrSize); | 1653       Assembler::instr_at(patch_address + Instruction::kInstrSize); | 
| 1656   // This is patching a conditional "jump if not smi/jump if smi" site. | 1654   // This is patching a conditional "jump if not smi/jump if smi" site. | 
| 1657   // Enabling by changing from | 1655   // Enabling by changing from | 
| 1658   //   cmp rx, rx | 1656   //   cmp rx, rx | 
| 1659   //   b eq/ne, <target> | 1657   //   b eq/ne, <target> | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
| 1679   } else { | 1677   } else { | 
| 1680     ASSERT(Assembler::GetCondition(branch_instr) == ne); | 1678     ASSERT(Assembler::GetCondition(branch_instr) == ne); | 
| 1681     patcher.EmitCondition(eq); | 1679     patcher.EmitCondition(eq); | 
| 1682   } | 1680   } | 
| 1683 } | 1681 } | 
| 1684 | 1682 | 
| 1685 | 1683 | 
| 1686 } }  // namespace v8::internal | 1684 } }  // namespace v8::internal | 
| 1687 | 1685 | 
| 1688 #endif  // V8_TARGET_ARCH_ARM | 1686 #endif  // V8_TARGET_ARCH_ARM | 
| OLD | NEW | 
|---|