mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1009967 - Add recover functionality for BitXor; r=nbp
This commit is contained in:
parent
71e55c99d7
commit
5ced94863a
@ -50,6 +50,25 @@ function rbitor_object(i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
var uceFault_bitxor_number = eval(uneval(uceFault).replace('uceFault', 'uceFault_bitxor_number'));
|
||||
function rbitxor_number(i) {
|
||||
var x = 1 ^ i;
|
||||
if (uceFault_bitxor_number(i) || uceFault_bitxor_number(i))
|
||||
assertEq(x, 98 /* = 1 XOR 99 */);
|
||||
return i;
|
||||
}
|
||||
|
||||
var uceFault_bitxor_object = eval(uneval(uceFault).replace('uceFault', 'uceFault_bitxor_object'));
|
||||
function rbitxor_object(i) {
|
||||
var t = i;
|
||||
var o = { valueOf: function () { return t; } };
|
||||
var x = 1 ^ o; /* computed with t == i, not 1000 */
|
||||
t = 1000;
|
||||
if (uceFault_bitxor_object(i) || uceFault_bitxor_object(i))
|
||||
assertEq(x, 98 /* = 1 XOR 99 */);
|
||||
return i;
|
||||
}
|
||||
|
||||
var uceFault_add_number = eval(uneval(uceFault).replace('uceFault', 'uceFault_add_number'));
|
||||
function radd_number(i) {
|
||||
var x = 1 + i;
|
||||
|
@ -3536,6 +3536,11 @@ class MBitXor : public MBinaryBitwiseInstruction
|
||||
return this;
|
||||
}
|
||||
void computeRange(TempAllocator &alloc);
|
||||
|
||||
bool writeRecoverData(CompactBufferWriter &writer) const;
|
||||
bool canRecoverOnBailout() const {
|
||||
return specialization_ < MIRType_Object;
|
||||
}
|
||||
};
|
||||
|
||||
class MShiftInstruction
|
||||
|
@ -197,6 +197,32 @@ RBitNot::recover(JSContext *cx, SnapshotIterator &iter) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
MBitXor::writeRecoverData(CompactBufferWriter &writer) const
|
||||
{
|
||||
MOZ_ASSERT(canRecoverOnBailout());
|
||||
writer.writeUnsigned(uint32_t(RInstruction::Recover_BitXor));
|
||||
return true;
|
||||
}
|
||||
|
||||
RBitXor::RBitXor(CompactBufferReader &reader)
|
||||
{ }
|
||||
|
||||
bool
|
||||
RBitXor::recover(JSContext *cx, SnapshotIterator &iter) const
|
||||
{
|
||||
RootedValue lhs(cx, iter.read());
|
||||
RootedValue rhs(cx, iter.read());
|
||||
|
||||
int32_t result;
|
||||
if (!js::BitXor(cx, lhs, rhs, &result))
|
||||
return false;
|
||||
|
||||
RootedValue rootedResult(cx, js::Int32Value(result));
|
||||
iter.storeInstructionResult(rootedResult);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
MNewObject::writeRecoverData(CompactBufferWriter &writer) const
|
||||
{
|
||||
|
@ -20,6 +20,7 @@ namespace jit {
|
||||
_(ResumePoint) \
|
||||
_(BitNot) \
|
||||
_(BitOr) \
|
||||
_(BitXor) \
|
||||
_(Add) \
|
||||
_(NewObject) \
|
||||
_(NewDerivedTypedObject)
|
||||
@ -102,6 +103,18 @@ class RBitNot MOZ_FINAL : public RInstruction
|
||||
bool recover(JSContext *cx, SnapshotIterator &iter) const;
|
||||
};
|
||||
|
||||
class RBitXor MOZ_FINAL : public RInstruction
|
||||
{
|
||||
public:
|
||||
RINSTRUCTION_HEADER_(BitXor)
|
||||
|
||||
virtual uint32_t numOperands() const {
|
||||
return 2;
|
||||
}
|
||||
|
||||
bool recover(JSContext *cx, SnapshotIterator &iter) const;
|
||||
};
|
||||
|
||||
class RAdd MOZ_FINAL : public RInstruction
|
||||
{
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user