1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef vm_FrameIter_inl_h
8 #define vm_FrameIter_inl_h
10 #include "vm/FrameIter.h"
12 #include "mozilla/Assertions.h" // MOZ_ASSERT, MOZ_CRASH
14 #include "jit/JSJitFrameIter.h" // js::jit::{InlineFrameIterator,MaybeReadFallback,ReadFrame_Actuals}
16 #include "vm/Stack-inl.h" // js::InterpreterFrame::unaliasedForEachActual
21 inline void FrameIter::unaliasedForEachActual(JSContext
* cx
, Op op
) {
22 switch (data_
.state_
) {
26 interpFrame()->unaliasedForEachActual(op
);
29 MOZ_ASSERT(isJSJit());
30 if (jsJitFrame().isIonJS()) {
31 jit::MaybeReadFallback
recover(cx
, activation()->asJit(),
33 ionInlineFrames_
.unaliasedForEachActual(cx
, op
, recover
);
34 } else if (jsJitFrame().isBailoutJS()) {
35 // :TODO: (Bug 1070962) If we are introspecting the frame which is
36 // being bailed, then we might be in the middle of recovering
37 // instructions. Stacking computeInstructionResults implies that we
38 // might be recovering result twice. In the mean time, to avoid
39 // that, we just return Undefined values for instruction results
40 // which are not yet recovered.
41 jit::MaybeReadFallback fallback
;
42 ionInlineFrames_
.unaliasedForEachActual(cx
, op
, fallback
);
44 MOZ_ASSERT(jsJitFrame().isBaselineJS());
45 jsJitFrame().unaliasedForEachActual(op
);
49 MOZ_CRASH("Unexpected state");
54 #endif // vm_FrameIter_inl_h