| 96 | } |
| 97 | |
| 98 | size_t Instruction::SizeInCodeUnitsComplexOpcode() const { |
| 99 | const uint16_t* insns = reinterpret_cast<const uint16_t*>(this); |
| 100 | // Handle special NOP encoded variable length sequences. |
| 101 | switch (*insns) { |
| 102 | case kPackedSwitchSignature: |
| 103 | return (4 + insns[1] * 2); |
| 104 | case kSparseSwitchSignature: |
| 105 | return (2 + insns[1] * 4); |
| 106 | case kArrayDataSignature: { |
| 107 | uint16_t element_size = insns[1]; |
| 108 | uint32_t length = insns[2] | (((uint32_t)insns[3]) << 16); |
| 109 | // The plus 1 is to round up for odd size and width. |
| 110 | return (4 + (element_size * length + 1) / 2); |
| 111 | } |
| 112 | default: |
| 113 | if ((*insns & 0xFF) == 0) { |
| 114 | return 1; // NOP. |
| 115 | } else { |
| 116 | LOG(FATAL) << "Unreachable: " << DumpString(nullptr); |
| 117 | UNREACHABLE(); |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | size_t Instruction::CodeUnitsRequiredForSizeOfComplexOpcode() const { |
| 123 | const uint16_t* insns = reinterpret_cast<const uint16_t*>(this); |
nothing calls this directly
no outgoing calls
no test coverage detected