Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / js / src / jit / JSJitFrameIter-inl.h
blob58c56e4ae46071ab29c1be699138bb1e0ea078e2
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 jit_JSJitFrameIter_inl_h
8 #define jit_JSJitFrameIter_inl_h
10 #include "jit/JSJitFrameIter.h"
12 #include "jit/Bailouts.h"
13 #include "jit/BaselineFrame.h"
14 #include "jit/JitFrames.h"
15 #include "jit/ScriptFromCalleeToken.h"
17 namespace js {
18 namespace jit {
20 inline uint8_t* JSJitFrameIter::returnAddress() const {
21 CommonFrameLayout* current = (CommonFrameLayout*)current_;
22 return current->returnAddress();
25 inline FrameType JSJitFrameIter::prevType() const {
26 CommonFrameLayout* current = (CommonFrameLayout*)current_;
27 return current->prevType();
30 inline ExitFrameLayout* JSJitFrameIter::exitFrame() const {
31 MOZ_ASSERT(isExitFrame());
32 return (ExitFrameLayout*)fp();
35 inline JitFrameLayout* JSJitProfilingFrameIterator::framePtr() const {
36 MOZ_ASSERT(!done());
37 return (JitFrameLayout*)fp_;
40 inline JSScript* JSJitProfilingFrameIterator::frameScript() const {
41 return ScriptFromCalleeToken(framePtr()->calleeToken());
44 inline BaselineFrame* JSJitFrameIter::baselineFrame() const {
45 MOZ_ASSERT(isBaselineJS());
46 return (BaselineFrame*)(fp() - BaselineFrame::Size());
49 inline uint32_t JSJitFrameIter::baselineFrameNumValueSlots() const {
50 MOZ_ASSERT(isBaselineJS());
51 return baselineFrame()->numValueSlots(*baselineFrameSize_);
54 template <typename T>
55 bool JSJitFrameIter::isExitFrameLayout() const {
56 if (!isExitFrame()) {
57 return false;
59 return exitFrame()->is<T>();
62 } // namespace jit
63 } // namespace js
65 #endif /* jit_JSJitFrameIter_inl_h */