Bug 1011383 - Definitions/Declarations follow the order of RECOVER_OPCODE_LIST. r=bbouvier

This commit is contained in:
Nicolas B. Pierron 2014-05-21 12:57:10 -07:00
parent a5ca880488
commit 4c6c3cc31b
3 changed files with 130 additions and 128 deletions

View File

@ -130,6 +130,8 @@ for (i = 0; i < 100; i++) {
rbitnot_object(i);
rbitor_number(i);
rbitor_object(i);
rbitxor_number(i);
rbitxor_object(i);
rursh_number(i);
rursh_object(i);
radd_number(i);

View File

@ -138,6 +138,110 @@ RResumePoint::recover(JSContext *cx, SnapshotIterator &iter) const
MOZ_ASSUME_UNREACHABLE("This instruction is not recoverable.");
}
bool
MBitNot::writeRecoverData(CompactBufferWriter &writer) const
{
MOZ_ASSERT(canRecoverOnBailout());
writer.writeUnsigned(uint32_t(RInstruction::Recover_BitNot));
return true;
}
RBitNot::RBitNot(CompactBufferReader &reader)
{ }
bool
RBitNot::recover(JSContext *cx, SnapshotIterator &iter) const
{
RootedValue operand(cx, iter.read());
int32_t result;
if (!js::BitNot(cx, operand, &result))
return false;
RootedValue rootedResult(cx, js::Int32Value(result));
iter.storeInstructionResult(rootedResult);
return true;
}
bool
MBitOr::writeRecoverData(CompactBufferWriter &writer) const
{
MOZ_ASSERT(canRecoverOnBailout());
writer.writeUnsigned(uint32_t(RInstruction::Recover_BitOr));
return true;
}
RBitOr::RBitOr(CompactBufferReader &reader)
{}
bool
RBitOr::recover(JSContext *cx, SnapshotIterator &iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
int32_t result;
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
if (!js::BitOr(cx, lhs, rhs, &result))
return false;
RootedValue asValue(cx, js::Int32Value(result));
iter.storeInstructionResult(asValue);
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
MUrsh::writeRecoverData(CompactBufferWriter &writer) const
{
MOZ_ASSERT(canRecoverOnBailout());
writer.writeUnsigned(uint32_t(RInstruction::Recover_Ursh));
return true;
}
RUrsh::RUrsh(CompactBufferReader &reader)
{ }
bool
RUrsh::recover(JSContext *cx, SnapshotIterator &iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
RootedValue result(cx);
if (!js::UrshOperation(cx, lhs, rhs, &result))
return false;
iter.storeInstructionResult(result);
return true;
}
bool
MAdd::writeRecoverData(CompactBufferWriter &writer) const
{
@ -172,57 +276,6 @@ RAdd::recover(JSContext *cx, SnapshotIterator &iter) const
return true;
}
bool
MBitNot::writeRecoverData(CompactBufferWriter &writer) const
{
MOZ_ASSERT(canRecoverOnBailout());
writer.writeUnsigned(uint32_t(RInstruction::Recover_BitNot));
return true;
}
RBitNot::RBitNot(CompactBufferReader &reader)
{ }
bool
RBitNot::recover(JSContext *cx, SnapshotIterator &iter) const
{
RootedValue operand(cx, iter.read());
int32_t result;
if (!js::BitNot(cx, operand, &result))
return false;
RootedValue rootedResult(cx, js::Int32Value(result));
iter.storeInstructionResult(rootedResult);
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
{
@ -284,56 +337,3 @@ RNewDerivedTypedObject::recover(JSContext *cx, SnapshotIterator &iter) const
iter.storeInstructionResult(result);
return true;
}
bool
MBitOr::writeRecoverData(CompactBufferWriter &writer) const
{
MOZ_ASSERT(canRecoverOnBailout());
writer.writeUnsigned(uint32_t(RInstruction::Recover_BitOr));
return true;
}
RBitOr::RBitOr(CompactBufferReader &reader)
{}
bool
RBitOr::recover(JSContext *cx, SnapshotIterator &iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
int32_t result;
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
if (!js::BitOr(cx, lhs, rhs, &result))
return false;
RootedValue asValue(cx, js::Int32Value(result));
iter.storeInstructionResult(asValue);
return true;
}
bool
MUrsh::writeRecoverData(CompactBufferWriter &writer) const
{
MOZ_ASSERT(canRecoverOnBailout());
writer.writeUnsigned(uint32_t(RInstruction::Recover_Ursh));
return true;
}
RUrsh::RUrsh(CompactBufferReader &reader)
{ }
bool
RUrsh::recover(JSContext *cx, SnapshotIterator &iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
RootedValue result(cx);
if (!js::UrshOperation(cx, lhs, rhs, &result))
return false;
iter.storeInstructionResult(result);
return true;
}

View File

@ -104,6 +104,18 @@ class RBitNot MOZ_FINAL : public RInstruction
bool recover(JSContext *cx, SnapshotIterator &iter) const;
};
class RBitOr MOZ_FINAL : public RInstruction
{
public:
RINSTRUCTION_HEADER_(BitOr)
virtual uint32_t numOperands() const {
return 2;
}
bool recover(JSContext *cx, SnapshotIterator &iter) const;
};
class RBitXor MOZ_FINAL : public RInstruction
{
public:
@ -116,6 +128,18 @@ class RBitXor MOZ_FINAL : public RInstruction
bool recover(JSContext *cx, SnapshotIterator &iter) const;
};
class RUrsh MOZ_FINAL : public RInstruction
{
public:
RINSTRUCTION_HEADER_(Ursh)
virtual uint32_t numOperands() const {
return 2;
}
bool recover(JSContext *cx, SnapshotIterator &iter) const;
};
class RAdd MOZ_FINAL : public RInstruction
{
private:
@ -158,30 +182,6 @@ class RNewDerivedTypedObject MOZ_FINAL : public RInstruction
bool recover(JSContext *cx, SnapshotIterator &iter) const;
};
class RBitOr MOZ_FINAL : public RInstruction
{
public:
RINSTRUCTION_HEADER_(BitOr)
virtual uint32_t numOperands() const {
return 2;
}
bool recover(JSContext *cx, SnapshotIterator &iter) const;
};
class RUrsh MOZ_FINAL : public RInstruction
{
public:
RINSTRUCTION_HEADER_(Ursh)
virtual uint32_t numOperands() const {
return 2;
}
bool recover(JSContext *cx, SnapshotIterator &iter) const;
};
#undef RINSTRUCTION_HEADER_
const RResumePoint *