1 /*
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 
22 #include "interpreter/shadow_frame.h"
23 
24 namespace art {
25 
PushShadowFrame(ShadowFrame * new_top_frame)26 inline ShadowFrame* ManagedStack::PushShadowFrame(ShadowFrame* new_top_frame) {
27   DCHECK(!HasTopQuickFrame());
28   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 
PopShadowFrame()34 inline ShadowFrame* ManagedStack::PopShadowFrame() {
35   DCHECK(!HasTopQuickFrame());
36   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_
45