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_BaselineFrameInfo_inl_h
8 #define jit_BaselineFrameInfo_inl_h
10 #include "jit/BaselineFrameInfo.h"
12 #include "jit/MacroAssembler-inl.h"
17 void CompilerFrameInfo::pop(StackAdjustment adjust
) {
19 StackValue
* popped
= &stack
[spIndex
];
21 if (adjust
== AdjustStack
&& popped
->kind() == StackValue::Stack
) {
22 masm
.addToStackPtr(Imm32(sizeof(Value
)));
24 // Assert when anything uses this value.
28 void CompilerFrameInfo::popn(uint32_t n
, StackAdjustment adjust
) {
29 uint32_t poppedStack
= 0;
30 for (uint32_t i
= 0; i
< n
; i
++) {
31 if (peek(-1)->kind() == StackValue::Stack
) {
36 if (adjust
== AdjustStack
&& poppedStack
> 0) {
37 masm
.addToStackPtr(Imm32(sizeof(Value
) * poppedStack
));
41 void InterpreterFrameInfo::pop() { popn(1); }
43 void InterpreterFrameInfo::popn(uint32_t n
) {
44 masm
.addToStackPtr(Imm32(n
* sizeof(Value
)));
50 #endif /* jit_BaselineFrameInfo_inl_h */