зеркало из https://github.com/mozilla/gecko-dev.git
Bug 891215 (part 11) - Remove PcScriptCache-inl.h. r=terrence.
--HG-- extra : rebase_source : 50b2fa3ce2e18d90cce94dfa7aafd34cc2377d1b
This commit is contained in:
Родитель
5f57c5cc00
Коммит
a30a8a0d93
|
@ -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 {
|
||||
|
|
|
@ -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 */
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче