Chromium Code Reviews| Index: src/arm/macro-assembler-arm.h |
| =================================================================== |
| --- src/arm/macro-assembler-arm.h (revision 5874) |
| +++ src/arm/macro-assembler-arm.h (working copy) |
| @@ -319,7 +319,38 @@ |
| Register scratch, |
| Label* miss); |
| + inline void MarkCode(NopMarkerTypes type) { |
| + nop(type); |
| + } |
| + // Check if the given instruction is a 'type' marker. |
| + // ie. check if is is a mov r<type>, r<type> (referenced as nop(type)) |
| + // These instructions are generated to mark special location in the code, |
| + // like some special IC code. |
| + static inline bool IsMarkedCode(Instr instr, int type) { |
| + ASSERT((FIRST_IC_MARKER <= type) && (type < LAST_CODE_MARKER)); |
| + return IsNop(instr, type); |
| + } |
| + |
| + |
| + static inline int GetCodeMarker(Instr instr) { |
| + int dst_reg_offset = 12; |
| + int dst_mask = 0xf << dst_reg_offset; |
| + int src_mask = 0xf; |
| + int dst_reg = (instr & dst_mask) >> dst_reg_offset; |
| + int src_reg = instr & src_mask; |
| + uint32_t non_register_mask = ~(dst_mask | src_mask); |
| + uint32_t mov_mask = al | 13 << 21; |
| + |
| + // Return <n> if we have a mov rn rn, else return -1. |
|
Søren Thygesen Gjesse
2010/11/23 14:00:37
How about assigning this to a local variable type
Alexandre
2010/11/23 17:32:59
Added a local variable and assert.
Retrieving the
|
| + return ((instr & non_register_mask) == mov_mask) && |
| + (dst_reg == src_reg) && |
| + (FIRST_IC_MARKER <= dst_reg) && (dst_reg < LAST_CODE_MARKER) |
| + ? src_reg |
| + : -1; |
| + } |
| + |
| + |
| // --------------------------------------------------------------------------- |
| // Allocation support |