Debian Codegraph @

js/src/jit/JSJitFrameIter-inl.h

raw
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/. */
6
7 #ifndef jit_JSJitFrameIter_inl_h
8 #define jit_JSJitFrameIter_inl_h
9
10 #include "jit/JSJitFrameIter.h"
11
12 #include "jit/Bailouts.h"
13 #include "jit/BaselineFrame.h"
14 #include "jit/JitFrames.h"
15 #include "jit/ScriptFromCalleeToken.h"
16
17 namespace js {
18 namespace jit {
19
20 inline uint8_t* JSJitFrameIter::returnAddress() const {
21 CommonFrameLayout* current = (CommonFrameLayout*)current_;
22 return current->returnAddress();
23 }
24
25 inline FrameType JSJitFrameIter::prevType() const {
26 CommonFrameLayout* current = (CommonFrameLayout*)current_;
27 return current->prevType();
28 }
29
30 inline ExitFrameLayout* JSJitFrameIter::exitFrame() const {
31 MOZ_ASSERT(isExitFrame());
32 return (ExitFrameLayout*)fp();
33 }
34
35 inline JitFrameLayout* JSJitProfilingFrameIterator::framePtr() const {
36 MOZ_ASSERT(!done());
37 return (JitFrameLayout*)fp_;
38 }
39
40 inline JSScript* JSJitProfilingFrameIterator::frameScript() const {
41 return ScriptFromCalleeToken(framePtr()->calleeToken());
42 }
43
44 inline BaselineFrame* JSJitFrameIter::baselineFrame() const {
45 MOZ_ASSERT(isBaselineJS());
46 return (BaselineFrame*)(fp() - BaselineFrame::Size());
47 }
48
49 inline uint32_t JSJitFrameIter::baselineFrameNumValueSlots() const {
50 MOZ_ASSERT(isBaselineJS());
51 return baselineFrame()->numValueSlots(*baselineFrameSize_);
52 }
53
54 template <typename T>
55 bool JSJitFrameIter::isExitFrameLayout() const {
56 if (!isExitFrame()) {
57 return false;
58 }
59 return exitFrame()->is<T>();
60 }
61
62 } // namespace jit
63 } // namespace js
64
65 #endif /* jit_JSJitFrameIter_inl_h */