| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 379 } |
| 380 | 380 |
| 381 | 381 |
| 382 void Assembler::emit(Instr x) { | 382 void Assembler::emit(Instr x) { |
| 383 CheckBuffer(); | 383 CheckBuffer(); |
| 384 *reinterpret_cast<Instr*>(pc_) = x; | 384 *reinterpret_cast<Instr*>(pc_) = x; |
| 385 pc_ += kInstrSize; | 385 pc_ += kInstrSize; |
| 386 } | 386 } |
| 387 | 387 |
| 388 | 388 |
| 389 void Assembler::emit16(Instr16 x, bool check_buffer) { |
| 390 if (check_buffer) { |
| 391 CheckBuffer(); |
| 392 } |
| 393 *reinterpret_cast<Instr16*>(pc_) = x; |
| 394 pc_ += 2; |
| 395 } |
| 396 |
| 397 |
| 389 Address Assembler::target_pointer_address_at(Address pc) { | 398 Address Assembler::target_pointer_address_at(Address pc) { |
| 390 Address target_pc = pc; | 399 Address target_pc = pc; |
| 391 Instr instr = Memory::int32_at(target_pc); | 400 Instr instr = Memory::int32_at(target_pc); |
| 392 // If we have a bx instruction, the instruction before the bx is | 401 // If we have a bx instruction, the instruction before the bx is |
| 393 // what we need to patch. | 402 // what we need to patch. |
| 394 static const int32_t kBxInstMask = 0x0ffffff0; | 403 static const int32_t kBxInstMask = 0x0ffffff0; |
| 395 static const int32_t kBxInstPattern = 0x012fff10; | 404 static const int32_t kBxInstPattern = 0x012fff10; |
| 396 if ((instr & kBxInstMask) == kBxInstPattern) { | 405 if ((instr & kBxInstMask) == kBxInstPattern) { |
| 397 target_pc -= kInstrSize; | 406 target_pc -= kInstrSize; |
| 398 instr = Memory::int32_at(target_pc); | 407 instr = Memory::int32_at(target_pc); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 525 |
| 517 | 526 |
| 518 void Assembler::set_target_address_at(Address pc, Address target) { | 527 void Assembler::set_target_address_at(Address pc, Address target) { |
| 519 set_target_pointer_at(pc, target); | 528 set_target_pointer_at(pc, target); |
| 520 } | 529 } |
| 521 | 530 |
| 522 | 531 |
| 523 } } // namespace v8::internal | 532 } } // namespace v8::internal |
| 524 | 533 |
| 525 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ | 534 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ |
| OLD | NEW |