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_BaselineFrameInfo_inl_h
8 : #define jit_BaselineFrameInfo_inl_h
9 :
10 : namespace js {
11 : namespace jit {
12 :
13 : void
14 42479 : FrameInfo::pop(StackAdjustment adjust)
15 : {
16 42479 : spIndex--;
17 42479 : StackValue* popped = &stack[spIndex];
18 :
19 42479 : if (adjust == AdjustStack && popped->kind() == StackValue::Stack)
20 3690 : masm.addToStackPtr(Imm32(sizeof(Value)));
21 : // Assert when anything uses this value.
22 42479 : popped->reset();
23 42479 : }
24 :
25 : void
26 3551 : FrameInfo::popn(uint32_t n, StackAdjustment adjust)
27 : {
28 3551 : uint32_t poppedStack = 0;
29 15492 : for (uint32_t i = 0; i < n; i++) {
30 11941 : if (peek(-1)->kind() == StackValue::Stack)
31 11941 : poppedStack++;
32 11941 : pop(DontAdjustStack);
33 : }
34 3551 : if (adjust == AdjustStack && poppedStack > 0)
35 3551 : masm.addToStackPtr(Imm32(sizeof(Value) * poppedStack));
36 3551 : }
37 :
38 : } // namespace jit
39 : } // namespace js
40 :
41 : #endif /* jit_BaselineFrameInfo_inl_h */
|