blob: 678be8e0982303075e21a799fde4df1a7567cfc8 [file] [log] [blame]
Andreas Gampe513061a2017-06-01 09:17:34 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ART_RUNTIME_MANAGED_STACK_INL_H_
18#define ART_RUNTIME_MANAGED_STACK_INL_H_
19
20#include "managed_stack.h"
21
Andreas Gampe36a296f2017-06-13 14:11:11 -070022#include "interpreter/shadow_frame.h"
Andreas Gampe513061a2017-06-01 09:17:34 -070023
24namespace art {
25
26inline ShadowFrame* ManagedStack::PushShadowFrame(ShadowFrame* new_top_frame) {
Vladimir Markoe7441632017-11-29 13:00:56 +000027 DCHECK(!HasTopQuickFrame());
Andreas Gampe513061a2017-06-01 09:17:34 -070028 ShadowFrame* old_frame = top_shadow_frame_;
29 top_shadow_frame_ = new_top_frame;
30 new_top_frame->SetLink(old_frame);
31 return old_frame;
32}
33
34inline ShadowFrame* ManagedStack::PopShadowFrame() {
Vladimir Markoe7441632017-11-29 13:00:56 +000035 DCHECK(!HasTopQuickFrame());
Andreas Gampe513061a2017-06-01 09:17:34 -070036 CHECK(top_shadow_frame_ != nullptr);
37 ShadowFrame* frame = top_shadow_frame_;
38 top_shadow_frame_ = frame->GetLink();
39 return frame;
40}
41
42} // namespace art
43
44#endif // ART_RUNTIME_MANAGED_STACK_INL_H_