EmitOperandSizeOverride();
EmitUint8(0xC7);
EmitOperand(0, dst);
- CHECK(imm.is_int16());
+ CHECK(imm.is_uint16() || imm.is_int16());
EmitUint8(imm.value() & 0xFF);
EmitUint8(imm.value() >> 8);
}
EmitOptionalRex32(dst);
EmitUint8(0xC7);
EmitOperand(Register::RAX, dst);
- CHECK(imm.is_int16());
+ CHECK(imm.is_uint16() || imm.is_int16());
EmitUint8(imm.value() & 0xFF);
EmitUint8(imm.value() >> 8);
}
chars[index] = 'd';
assertEquals('d', chars[index]);
+ chars[0] = 65535;
+ assertEquals(65535, chars[0]);
+ // Do an update between the two max value updates, to avoid
+ // optimizing the second away.
+ chars[index] = 0;
+ assertEquals(0, chars[index]);
+ chars[index] = 65535;
+ assertEquals(65535, chars[index]);
+
shorts[0] = -42;
assertEquals(-42, shorts[0]);
shorts[index] = -84;
Object o2 = new Object();
objects[index] = o2;
assertEquals(o2, objects[index]);
+ // Longs are initially not supported in the linear scan register allocator
+ // on 32bits. So we call out a long helper to ensure this method gets
+ // optimized.
+ $opt$testLongWrites(longs, index);
+ }
+ public static void $opt$testLongWrites(long[] longs, int index) {
long l = -21876876876876876L;
longs[0] = l;
assertEquals(l, longs[0]);