summaryrefslogtreecommitdiffstats
path: root/js/src/vm/PortableBaselineInterpret.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/PortableBaselineInterpret.cpp')
-rw-r--r--js/src/vm/PortableBaselineInterpret.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/js/src/vm/PortableBaselineInterpret.cpp b/js/src/vm/PortableBaselineInterpret.cpp
index 2588f12009..17310a325d 100644
--- a/js/src/vm/PortableBaselineInterpret.cpp
+++ b/js/src/vm/PortableBaselineInterpret.cpp
@@ -47,6 +47,7 @@
#include "vm/Opcodes.h"
#include "vm/PlainObject.h"
#include "vm/Shape.h"
+#include "vm/TypeofEqOperand.h" // TypeofEqOperand
#include "debugger/DebugAPI-inl.h"
#include "jit/BaselineFrame-inl.h"
@@ -1262,9 +1263,8 @@ ICInterpretOps(BaselineFrame* frame, VMFrameManager& frameMgr, State& state,
CACHEOP_CASE(GuardFunctionHasJitEntry) {
ObjOperandId funId = icregs.cacheIRReader.objOperandId();
- bool constructing = icregs.cacheIRReader.readBool();
JSObject* fun = reinterpret_cast<JSObject*>(icregs.icVals[funId.id()]);
- uint16_t flags = FunctionFlags::HasJitEntryFlags(constructing);
+ uint16_t flags = FunctionFlags::HasJitEntryFlags();
if (!fun->as<JSFunction>().flags().hasFlags(flags)) {
return ICInterpretOpResult::NextIC;
}
@@ -1274,7 +1274,7 @@ ICInterpretOps(BaselineFrame* frame, VMFrameManager& frameMgr, State& state,
CACHEOP_CASE(GuardFunctionHasNoJitEntry) {
ObjOperandId funId = icregs.cacheIRReader.objOperandId();
JSObject* fun = reinterpret_cast<JSObject*>(icregs.icVals[funId.id()]);
- uint16_t flags = FunctionFlags::HasJitEntryFlags(/*constructing =*/false);
+ uint16_t flags = FunctionFlags::HasJitEntryFlags();
if (fun->as<JSFunction>().flags().hasFlags(flags)) {
return ICInterpretOpResult::NextIC;
}
@@ -1714,6 +1714,7 @@ ICInterpretOps(BaselineFrame* frame, VMFrameManager& frameMgr, State& state,
v = Int32Value(rhs);
break;
+ case Scalar::Float16:
case Scalar::Float32:
case Scalar::Float64:
v = Value::fromRawBits(rhs);
@@ -2690,6 +2691,7 @@ ICInterpretOps(BaselineFrame* frame, VMFrameManager& frameMgr, State& state,
CACHEOP_CASE_UNIMPL(LoadConstantString)
CACHEOP_CASE_UNIMPL(LoadInstanceOfObjectResult)
CACHEOP_CASE_UNIMPL(LoadTypeOfObjectResult)
+ CACHEOP_CASE_UNIMPL(LoadTypeOfEqObjectResult)
CACHEOP_CASE_UNIMPL(DoubleAddResult)
CACHEOP_CASE_UNIMPL(DoubleSubResult)
CACHEOP_CASE_UNIMPL(DoubleMulResult)
@@ -2876,6 +2878,14 @@ DEFINE_IC(Typeof, 1, {
}
});
+DEFINE_IC(TypeofEq, 1, {
+ IC_LOAD_VAL(value0, 0);
+ PUSH_FALLBACK_IC_FRAME();
+ if (!DoTypeOfEqFallback(cx, frame, fallback, value0, &state.res)) {
+ goto error;
+ }
+});
+
DEFINE_IC(GetName, 1, {
IC_LOAD_OBJ(obj0, 0);
PUSH_FALLBACK_IC_FRAME();
@@ -3423,6 +3433,23 @@ PBIResult PortableBaselineInterpret(JSContext* cx_, State& state, Stack& stack,
END_OP(Typeof);
}
+ CASE(TypeofEq) {
+ if (kHybridICs) {
+ TypeofEqOperand operand = TypeofEqOperand::fromRawValue(GET_UINT8(pc));
+ bool result = js::TypeOfValue(Stack::handle(sp)) == operand.type();
+ if (operand.compareOp() == JSOp::Ne) {
+ result = !result;
+ }
+ sp[0] = StackVal(BooleanValue(result));
+ NEXT_IC();
+ } else {
+ IC_POP_ARG(0);
+ INVOKE_IC(TypeofEq);
+ IC_PUSH_RESULT();
+ }
+ END_OP(TypeofEq);
+ }
+
CASE(Pos) {
if (sp[0].asValue().isNumber()) {
// Nothing!