| 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 5360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5371 if (r2.is(r4)) return true; | 5371 if (r2.is(r4)) return true; |
| 5372 if (r3.is(r4)) return true; | 5372 if (r3.is(r4)) return true; |
| 5373 return false; | 5373 return false; |
| 5374 } | 5374 } |
| 5375 | 5375 |
| 5376 | 5376 |
| 5377 CodePatcher::CodePatcher(byte* address, int instructions) | 5377 CodePatcher::CodePatcher(byte* address, int instructions) |
| 5378 : address_(address), | 5378 : address_(address), |
| 5379 instructions_(instructions), | 5379 instructions_(instructions), |
| 5380 size_(instructions * Assembler::kInstrSize), | 5380 size_(instructions * Assembler::kInstrSize), |
| 5381 masm_(Isolate::Current(), address, size_ + Assembler::kGap) { | 5381 masm_(NULL, address, size_ + Assembler::kGap) { |
| 5382 // Create a new macro assembler pointing to the address of the code to patch. | 5382 // Create a new macro assembler pointing to the address of the code to patch. |
| 5383 // The size is adjusted with kGap on order for the assembler to generate size | 5383 // The size is adjusted with kGap on order for the assembler to generate size |
| 5384 // bytes of instructions without failing with buffer size constraints. | 5384 // bytes of instructions without failing with buffer size constraints. |
| 5385 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 5385 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 5386 } | 5386 } |
| 5387 | 5387 |
| 5388 | 5388 |
| 5389 CodePatcher::~CodePatcher() { | 5389 CodePatcher::~CodePatcher() { |
| 5390 // Indicate that code has changed. | 5390 // Indicate that code has changed. |
| 5391 CPU::FlushICache(address_, size_); | 5391 CPU::FlushICache(address_, size_); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5424 opcode == BGTZL); | 5424 opcode == BGTZL); |
| 5425 opcode = (cond == eq) ? BEQ : BNE; | 5425 opcode = (cond == eq) ? BEQ : BNE; |
| 5426 instr = (instr & ~kOpcodeMask) | opcode; | 5426 instr = (instr & ~kOpcodeMask) | opcode; |
| 5427 masm_.emit(instr); | 5427 masm_.emit(instr); |
| 5428 } | 5428 } |
| 5429 | 5429 |
| 5430 | 5430 |
| 5431 } } // namespace v8::internal | 5431 } } // namespace v8::internal |
| 5432 | 5432 |
| 5433 #endif // V8_TARGET_ARCH_MIPS | 5433 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |