Bug 1444604: Part 6: Add LiveSavedFrameCache::findWithoutInvalidation. r=jorendorff

--HG--
extra : rebase_source : bbe26f26f0ae8e0f30e6505e1614c3ae4a320300
extra : histedit_source : fa29282837885902c7a5413cce34ef71e8b444d3
This commit is contained in:
Jim Blandy 2018-03-15 16:26:09 -07:00
Родитель a6797c105e
Коммит 2776d2837b
2 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -156,6 +156,24 @@ LiveSavedFrameCache::find(JSContext* cx, FramePtr& framePtr, const jsbytecode* p
frame.set(frames->back().savedFrame);
}
void
LiveSavedFrameCache::findWithoutInvalidation(const FramePtr& framePtr,
MutableHandleSavedFrame frame) const
{
MOZ_ASSERT(initialized());
MOZ_ASSERT(framePtr.hasCachedSavedFrame());
Key key(framePtr);
for (auto& entry : (*frames)) {
if (entry.key == key) {
frame.set(entry.savedFrame);
return;
}
}
frame.set(nullptr);
}
struct SavedFrame::Lookup {
Lookup(JSAtom* source, uint32_t line, uint32_t column,
JSAtom* functionDisplayName, JSAtom* asyncCause, SavedFrame* parent,

Просмотреть файл

@ -1357,6 +1357,11 @@ class LiveSavedFrameCache
void find(JSContext* cx, FramePtr& framePtr, const jsbytecode* pc,
MutableHandleSavedFrame frame) const;
// Search the cache for a frame matching |framePtr|, without removing any
// entries. Return the matching saved frame, or nullptr if none is found.
// This is used for resolving |evalInFramePrev| links.
void findWithoutInvalidation(const FramePtr& framePtr, MutableHandleSavedFrame frame) const;
// Push a cache entry mapping |framePtr| and |pc| to |savedFrame| on the top
// of the cache's stack. You must insert entries for frames from oldest to
// youngest. They must all be younger than the frame that the |find| method