diff --git a/js/src/jit/BaselineFrame.h b/js/src/jit/BaselineFrame.h index 70f5b01b89ba..d95ebb74adcf 100644 --- a/js/src/jit/BaselineFrame.h +++ b/js/src/jit/BaselineFrame.h @@ -193,17 +193,6 @@ class BaselineFrame { ArrayObject* dest) const; public: - Value newTarget() const { - MOZ_ASSERT(isFunctionFrame()); - MOZ_ASSERT(!callee()->isArrow()); - if (isConstructing()) { - return *(Value*)(reinterpret_cast(this) + - BaselineFrame::Size() + - offsetOfArg(std::max(numFormalArgs(), numActualArgs()))); - } - return UndefinedValue(); - } - void prepareForBaselineInterpreterToJitOSR() { // Clearing the RUNNING_IN_INTERPRETER flag is sufficient, but we also null // out the interpreter fields to ensure we don't use stale values. diff --git a/js/src/jit/JSJitFrameIter.h b/js/src/jit/JSJitFrameIter.h index 41b33b9f28c5..126c05bccb10 100644 --- a/js/src/jit/JSJitFrameIter.h +++ b/js/src/jit/JSJitFrameIter.h @@ -682,8 +682,7 @@ class InlineFrameIterator { void readFrameArgsAndLocals(JSContext* cx, ArgOp& argOp, LocalOp& localOp, JSObject** envChain, bool* hasInitialEnv, Value* rval, ArgumentsObject** argsObj, - Value* thisv, Value* newTarget, - ReadFrameArgsBehavior behavior, + Value* thisv, ReadFrameArgsBehavior behavior, MaybeReadFallback& fallback) const { SnapshotIterator s(si_); @@ -703,13 +702,6 @@ class InlineFrameIterator { s.skip(); } - if (newTarget) { - // For now, only support reading new.target when we are reading - // overflown arguments. - MOZ_ASSERT(behavior != ReadFrame_Formals); - newTarget->setUndefined(); - } - // Read arguments, which only function frames have. if (isFunctionFrame()) { unsigned nactual = numActualArgs(); @@ -756,9 +748,6 @@ class InlineFrameIterator { parent_s.skip(); // return value parent_s.readFunctionFrameArgs(argOp, nullptr, nullptr, nformal, nactual, it.script(), fallback); - if (newTarget && isConstructing()) { - *newTarget = parent_s.maybeRead(fallback); - } } else { // There is no parent frame to this inlined frame, we can read // from the frame's Value vector directly. @@ -766,9 +755,6 @@ class InlineFrameIterator { for (unsigned i = nformal; i < nactual; i++) { argOp(argv[i]); } - if (newTarget && isConstructing()) { - *newTarget = argv[nactual]; - } } } } @@ -786,7 +772,7 @@ class InlineFrameIterator { MaybeReadFallback& fallback) const { Nop nop; readFrameArgsAndLocals(cx, op, nop, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, behavior, fallback); + nullptr, behavior, fallback); } JSScript* script() const { return script_; } diff --git a/js/src/jit/RematerializedFrame.cpp b/js/src/jit/RematerializedFrame.cpp index c5cb05ec7b4d..552d9504b2fa 100644 --- a/js/src/jit/RematerializedFrame.cpp +++ b/js/src/jit/RematerializedFrame.cpp @@ -52,7 +52,7 @@ RematerializedFrame::RematerializedFrame(JSContext* cx, uint8_t* top, CopyValueToRematerializedFrame op(slots_); iter.readFrameArgsAndLocals(cx, op, op, &envChain_, &hasInitialEnv_, &returnValue_, &argsObj_, &thisArgument_, - &newTarget_, ReadFrame_Actuals, fallback); + ReadFrame_Actuals, fallback); } /* static */ @@ -145,7 +145,6 @@ void RematerializedFrame::trace(JSTracer* trc) { } TraceRoot(trc, &returnValue_, "remat ion frame return value"); TraceRoot(trc, &thisArgument_, "remat ion frame this"); - TraceRoot(trc, &newTarget_, "remat ion frame newTarget"); TraceRootRange(trc, numArgSlots() + script_->nfixed(), slots_, "remat ion frame stack"); } diff --git a/js/src/jit/RematerializedFrame.h b/js/src/jit/RematerializedFrame.h index 610209f2bd1d..d5c51df2b656 100644 --- a/js/src/jit/RematerializedFrame.h +++ b/js/src/jit/RematerializedFrame.h @@ -87,7 +87,6 @@ class RematerializedFrame { Value returnValue_; Value thisArgument_; - Value newTarget_; Value slots_[1]; RematerializedFrame(JSContext* cx, uint8_t* top, unsigned numActualArgs, @@ -207,13 +206,6 @@ class RematerializedFrame { return argv()[i]; } - Value newTarget() { - MOZ_ASSERT(isFunctionFrame()); - MOZ_ASSERT(!callee()->isArrow()); - MOZ_ASSERT_IF(!isConstructing(), newTarget_.isUndefined()); - return newTarget_; - } - void setReturnValue(const Value& value) { returnValue_ = value; } Value& returnValue() { return returnValue_; } diff --git a/js/src/vm/FrameIter.cpp b/js/src/vm/FrameIter.cpp index a3e33900a0e8..ba1d31cc26b0 100644 --- a/js/src/vm/FrameIter.cpp +++ b/js/src/vm/FrameIter.cpp @@ -947,19 +947,6 @@ Value FrameIter::thisArgument(JSContext* cx) const { MOZ_CRASH("Unexpected state"); } -Value FrameIter::newTarget() const { - switch (data_.state_) { - case DONE: - break; - case INTERP: - return interpFrame()->newTarget(); - case JIT: - MOZ_ASSERT(jsJitFrame().isBaselineJS()); - return jsJitFrame().baselineFrame()->newTarget(); - } - MOZ_CRASH("Unexpected state"); -} - Value FrameIter::returnValue() const { switch (data_.state_) { case DONE: diff --git a/js/src/vm/FrameIter.h b/js/src/vm/FrameIter.h index 84a4d30d7582..b83f80b66025 100644 --- a/js/src/vm/FrameIter.h +++ b/js/src/vm/FrameIter.h @@ -353,8 +353,6 @@ class FrameIter { // primitives). JS::Value thisArgument(JSContext* cx) const; - JS::Value newTarget() const; - JS::Value returnValue() const; void setReturnValue(const JS::Value& v); diff --git a/js/src/vm/Stack-inl.h b/js/src/vm/Stack-inl.h index adf3d3018f96..8c6ada80bb5e 100644 --- a/js/src/vm/Stack-inl.h +++ b/js/src/vm/Stack-inl.h @@ -809,16 +809,6 @@ inline Value& AbstractFramePtr::thisArgument() const { return asRematerializedFrame()->thisArgument(); } -inline Value AbstractFramePtr::newTarget() const { - if (isInterpreterFrame()) { - return asInterpreterFrame()->newTarget(); - } - if (isBaselineFrame()) { - return asBaselineFrame()->newTarget(); - } - return asRematerializedFrame()->newTarget(); -} - inline bool AbstractFramePtr::debuggerNeedsCheckPrimitiveReturn() const { if (isWasmDebugFrame()) { return false; diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h index 604e9116a227..12ddcedda695 100644 --- a/js/src/vm/Stack.h +++ b/js/src/vm/Stack.h @@ -210,7 +210,6 @@ class AbstractFramePtr { inline Value& thisArgument() const; inline bool isConstructing() const; - inline Value newTarget() const; inline bool debuggerNeedsCheckPrimitiveReturn() const;