summaryrefslogtreecommitdiff
path: root/js/src/jit/Recover.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit/Recover.cpp')
-rw-r--r--js/src/jit/Recover.cpp55
1 files changed, 28 insertions, 27 deletions
diff --git a/js/src/jit/Recover.cpp b/js/src/jit/Recover.cpp
index 833ad871d0..0d6882f52c 100644
--- a/js/src/jit/Recover.cpp
+++ b/js/src/jit/Recover.cpp
@@ -164,13 +164,13 @@ bool
RBitNot::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedValue operand(cx, iter.read());
+ RootedValue result(cx);
- int32_t result;
- if (!js::BitNot(cx, operand, &result))
+ if (!js::BitNot(cx, &operand, &result)) {
return false;
+ }
- RootedValue rootedResult(cx, js::Int32Value(result));
- iter.storeInstructionResult(rootedResult);
+ iter.storeInstructionResult(result);
return true;
}
@@ -190,14 +190,14 @@ RBitAnd::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
- int32_t result;
+ RootedValue result(cx);
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
- if (!js::BitAnd(cx, lhs, rhs, &result))
+ if (!js::BitAnd(cx, &lhs, &rhs, &result)) {
return false;
+ }
- RootedValue rootedResult(cx, js::Int32Value(result));
- iter.storeInstructionResult(rootedResult);
+ iter.storeInstructionResult(result);
return true;
}
@@ -217,14 +217,14 @@ RBitOr::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
- int32_t result;
+ RootedValue result(cx);
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
- if (!js::BitOr(cx, lhs, rhs, &result))
+ if (!js::BitOr(cx, &lhs, &rhs, &result)) {
return false;
+ }
- RootedValue asValue(cx, js::Int32Value(result));
- iter.storeInstructionResult(asValue);
+ iter.storeInstructionResult(result);;
return true;
}
@@ -244,13 +244,13 @@ RBitXor::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
+ RootedValue result(cx);
- int32_t result;
- if (!js::BitXor(cx, lhs, rhs, &result))
+ if (!js::BitXor(cx, &lhs, &rhs, &result)) {
return false;
+ }
- RootedValue rootedResult(cx, js::Int32Value(result));
- iter.storeInstructionResult(rootedResult);
+ iter.storeInstructionResult(result);
return true;
}
@@ -270,14 +270,14 @@ RLsh::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
- int32_t result;
+ RootedValue result(cx);
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
- if (!js::BitLsh(cx, lhs, rhs, &result))
+ if (!js::BitLsh(cx, &lhs, &rhs, &result)) {
return false;
+ }
- RootedValue asValue(cx, js::Int32Value(result));
- iter.storeInstructionResult(asValue);
+ iter.storeInstructionResult(result);
return true;
}
@@ -297,14 +297,14 @@ RRsh::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedValue lhs(cx, iter.read());
RootedValue rhs(cx, iter.read());
+ RootedValue result(cx);
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
- int32_t result;
- if (!js::BitRsh(cx, lhs, rhs, &result))
+ if (!js::BitRsh(cx, &lhs, &rhs, &result)) {
return false;
+ }
- RootedValue rootedResult(cx, js::Int32Value(result));
- iter.storeInstructionResult(rootedResult);
+ iter.storeInstructionResult(result);
return true;
}
@@ -327,8 +327,9 @@ RUrsh::recover(JSContext* cx, SnapshotIterator& iter) const
MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());
RootedValue result(cx);
- if (!js::UrshOperation(cx, lhs, rhs, &result))
+ if (!js::UrshOperation(cx, &lhs, &rhs, &result)) {
return false;
+ }
iter.storeInstructionResult(result);
return true;
@@ -778,7 +779,7 @@ RPow::recover(JSContext* cx, SnapshotIterator& iter) const
RootedValue result(cx);
MOZ_ASSERT(base.isNumber() && power.isNumber());
- if (!js::math_pow_handle(cx, base, power, &result))
+ if (!js::PowValues(cx, &base, &power, &result))
return false;
iter.storeInstructionResult(result);
@@ -805,7 +806,7 @@ RPowHalf::recover(JSContext* cx, SnapshotIterator& iter) const
power.setNumber(0.5);
MOZ_ASSERT(base.isNumber());
- if (!js::math_pow_handle(cx, base, power, &result))
+ if (!js::PowValues(cx, &base, &power, &result))
return false;
iter.storeInstructionResult(result);