Bug 1865597 - Add error checking when initializing parallel marking and disable on...
[gecko.git] / js / src / jit / BaselineFrameInfo-inl.h
blobcd79a8fb64dc8dd9836061eaff024acb2d98a10e
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"
14 namespace js {
15 namespace jit {
17 void CompilerFrameInfo::pop(StackAdjustment adjust) {
18 spIndex--;
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.
25 popped->reset();
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) {
32 poppedStack++;
34 pop(DontAdjustStack);
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)));
47 } // namespace jit
48 } // namespace js
50 #endif /* jit_BaselineFrameInfo_inl_h */