Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: src/arm/assembler-arm-inl.h

Issue 23560010: Thumb2 Backend: 16-bit instruction encoding helper methods Base URL: HEAD^
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) {
rmcilroy_google 2013/09/17 17:28:16 Why do you need the check_buffer parameter? There
rkrithiv 2013/09/27 21:40:49 This is used in later patches. On 2013/09/17 17:2
rmcilroy 2013/10/01 10:26:04 Please just do always do the CheckBuffer() here an
390 if (check_buffer) {
391 CheckBuffer();
392 }
393 *reinterpret_cast<Instr16*>(pc_) = x;
394 pc_ += 2;
rmcilroy_google 2013/09/17 17:28:16 Please make this a constant (e.g., kThumb2InstrSiz
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698