Bug 1467273 - JitActivation owns the rematerialized frames of the activation. r=anba

This commit is contained in:
Nicolas B. Pierron 2018-07-25 12:04:39 +00:00
Родитель b8bea43ef3
Коммит 923cdafe51
2 изменённых файлов: 5 добавлений и 5 удалений

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

@ -1580,7 +1580,7 @@ jit::JitActivation::JitActivation(JSContext* cx)
packedExitFP_(nullptr),
encodedWasmExitReason_(0),
prevJitActivation_(cx->jitActivation),
rematerializedFrames_(nullptr),
rematerializedFrames_(),
ionRecovery_(cx),
bailoutData_(nullptr),
lastProfilingFrame_(nullptr),
@ -1607,7 +1607,6 @@ jit::JitActivation::~JitActivation()
MOZ_ASSERT(!isWasmTrapping());
clearRematerializedFrames();
js_delete(rematerializedFrames_);
}
void
@ -1656,11 +1655,11 @@ jit::JitActivation::getRematerializedFrame(JSContext* cx, const JSJitFrameIter&
MOZ_ASSERT(iter.isIonScripted());
if (!rematerializedFrames_) {
rematerializedFrames_ = cx->new_<RematerializedFrameTable>(cx);
rematerializedFrames_ = cx->make_unique<RematerializedFrameTable>(cx);
if (!rematerializedFrames_)
return nullptr;
if (!rematerializedFrames_->init()) {
rematerializedFrames_ = nullptr;
rematerializedFrames_.reset();
ReportOutOfMemory(cx);
return nullptr;
}

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

@ -23,6 +23,7 @@
#include "jit/JSJitFrameIter.h"
#include "js/RootingAPI.h"
#include "js/TypeDecls.h"
#include "js/UniquePtr.h"
#include "vm/ArgumentsObject.h"
#include "vm/JSFunction.h"
#include "vm/JSScript.h"
@ -1634,7 +1635,7 @@ class JitActivation : public Activation
// This table is lazily initialized by calling getRematerializedFrame.
typedef GCVector<RematerializedFrame*> RematerializedFrameVector;
typedef HashMap<uint8_t*, RematerializedFrameVector> RematerializedFrameTable;
RematerializedFrameTable* rematerializedFrames_;
js::UniquePtr<RematerializedFrameTable> rematerializedFrames_;
// This vector is used to remember the outcome of the evaluation of recover
// instructions.