From a30a8a0d938078192f4b8d73ddbe2465c164fe18 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 8 Jul 2013 23:03:03 -0700 Subject: [PATCH] Bug 891215 (part 11) - Remove PcScriptCache-inl.h. r=terrence. --HG-- extra : rebase_source : 50b2fa3ce2e18d90cce94dfa7aafd34cc2377d1b --- js/src/ion/IonFrames.cpp | 1 - js/src/ion/PcScriptCache-inl.h | 39 ---------------------------------- js/src/ion/PcScriptCache.h | 19 +++++++++++++++-- 3 files changed, 17 insertions(+), 42 deletions(-) delete mode 100644 js/src/ion/PcScriptCache-inl.h diff --git a/js/src/ion/IonFrames.cpp b/js/src/ion/IonFrames.cpp index f6b643b4e78f..3fdfc97e08c7 100644 --- a/js/src/ion/IonFrames.cpp +++ b/js/src/ion/IonFrames.cpp @@ -26,7 +26,6 @@ #include "ion/IonFrameIterator-inl.h" #include "ion/IonFrames-inl.h" -#include "ion/PcScriptCache-inl.h" #include "vm/Probes-inl.h" namespace js { diff --git a/js/src/ion/PcScriptCache-inl.h b/js/src/ion/PcScriptCache-inl.h deleted file mode 100644 index 0a3b126488d4..000000000000 --- a/js/src/ion/PcScriptCache-inl.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sts=4 et sw=4 tw=99: - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef ion_PcScriptCache_inl_h -#define ion_PcScriptCache_inl_h - -#include "ion/PcScriptCache.h" - -namespace js { -namespace ion { - -// Get a value from the cache. May perform lazy allocation. -bool -PcScriptCache::get(JSRuntime *rt, uint32_t hash, uint8_t *addr, - JSScript **scriptRes, jsbytecode **pcRes) -{ - // If a GC occurred, lazily clear the cache now. - if (gcNumber != rt->gcNumber) { - clear(rt->gcNumber); - return false; - } - - if (entries[hash].returnAddress != addr) - return false; - - *scriptRes = entries[hash].script; - if (pcRes) - *pcRes = entries[hash].pc; - - return true; -} - -} // namespace ion -} // namespace js - -#endif /* ion_PcScriptCache_inl_h */ diff --git a/js/src/ion/PcScriptCache.h b/js/src/ion/PcScriptCache.h index 81fceb7e0c47..6158dadbd985 100644 --- a/js/src/ion/PcScriptCache.h +++ b/js/src/ion/PcScriptCache.h @@ -41,9 +41,24 @@ struct PcScriptCache } // Get a value from the cache. May perform lazy allocation. - // Defined in PcScriptCache-inl.h. bool get(JSRuntime *rt, uint32_t hash, uint8_t *addr, - JSScript **scriptRes, jsbytecode **pcRes); + JSScript **scriptRes, jsbytecode **pcRes) + { + // If a GC occurred, lazily clear the cache now. + if (gcNumber != rt->gcNumber) { + clear(rt->gcNumber); + return false; + } + + if (entries[hash].returnAddress != addr) + return false; + + *scriptRes = entries[hash].script; + if (pcRes) + *pcRes = entries[hash].pc; + + return true; + } void add(uint32_t hash, uint8_t *addr, jsbytecode *pc, JSScript *script) { entries[hash].returnAddress = addr;