Activation.cpp (1023B)
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/. */ 6 7 #include "vm/Activation-inl.h" 8 9 #include "mozilla/Assertions.h" // MOZ_ASSERT 10 11 #include "vm/JSContext.h" // JSContext, js::TlsContext 12 13 using namespace js; 14 15 void Activation::registerProfiling() { 16 MOZ_ASSERT(isProfiling()); 17 cx_->profilingActivation_ = this; 18 } 19 20 void Activation::unregisterProfiling() { 21 MOZ_ASSERT(isProfiling()); 22 MOZ_ASSERT(cx_->profilingActivation_ == this); 23 cx_->profilingActivation_ = prevProfiling_; 24 } 25 26 ActivationIterator::ActivationIterator(JSContext* cx) 27 : activation_(cx->activation_) { 28 MOZ_ASSERT(cx == TlsContext.get()); 29 } 30 31 ActivationIterator& ActivationIterator::operator++() { 32 MOZ_ASSERT(activation_); 33 activation_ = activation_->prev(); 34 return *this; 35 }