Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 : * vim: set ts=8 sts=4 et sw=4 tw=99:
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_JitFrames_inl_h
8 : #define jit_JitFrames_inl_h
9 :
10 : #include "jit/JitFrames.h"
11 :
12 : #include "jit/JitFrameIterator.h"
13 : #include "jit/LIR.h"
14 :
15 : #include "jit/JitFrameIterator-inl.h"
16 :
17 : namespace js {
18 : namespace jit {
19 :
20 : inline void
21 43 : SafepointIndex::resolve()
22 : {
23 43 : MOZ_ASSERT(!resolved);
24 43 : safepointOffset_ = safepoint_->offset();
25 : #ifdef DEBUG
26 43 : resolved = true;
27 : #endif
28 43 : }
29 :
30 : inline uint8_t*
31 0 : JitFrameIterator::returnAddress() const
32 : {
33 0 : CommonFrameLayout* current = (CommonFrameLayout*) current_;
34 0 : return current->returnAddress();
35 : }
36 :
37 : inline size_t
38 23230 : JitFrameIterator::prevFrameLocalSize() const
39 : {
40 23230 : CommonFrameLayout* current = (CommonFrameLayout*) current_;
41 23230 : return current->prevFrameLocalSize();
42 : }
43 :
44 : inline FrameType
45 0 : JitFrameIterator::prevType() const
46 : {
47 0 : CommonFrameLayout* current = (CommonFrameLayout*) current_;
48 0 : return current->prevType();
49 : }
50 :
51 : inline ExitFrameLayout*
52 213 : JitFrameIterator::exitFrame() const
53 : {
54 213 : MOZ_ASSERT(isExitFrame());
55 213 : return (ExitFrameLayout*) fp();
56 : }
57 :
58 : inline BaselineFrame*
59 0 : GetTopBaselineFrame(JSContext* cx)
60 : {
61 0 : JitFrameIterator iter(cx);
62 0 : MOZ_ASSERT(iter.type() == JitFrame_Exit);
63 0 : ++iter;
64 0 : if (iter.isBaselineStub())
65 0 : ++iter;
66 0 : MOZ_ASSERT(iter.isBaselineJS());
67 0 : return iter.baselineFrame();
68 : }
69 :
70 : } // namespace jit
71 : } // namespace js
72 :
73 : #endif /* jit_JitFrames_inl_h */
|