From 39b6eddb12fafda4ba7dd193808d1333c3238e21 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 18 Sep 2014 18:28:55 +0200 Subject: [PATCH] Bug 1062869 part 4 - Add an invalidate function to IonScript. r=h4writer --- js/src/jit/Ion.cpp | 11 +++++++++++ js/src/jit/IonCode.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 2ba5bdb7178..dfd9c0483d8 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -2900,6 +2900,17 @@ jit::Invalidate(JSContext *cx, const Vector &invalid, bool cancelOffThread); } +bool +jit::IonScript::invalidate(JSContext *cx, bool resetUses, const char *reason) +{ + JitSpew(JitSpew_IonInvalidate, " Invalidate IonScript %p: %s", this, reason); + Vector list(cx); + if (!list.append(recompileInfo())) + return false; + Invalidate(cx, list, resetUses, true); + return true; +} + bool jit::Invalidate(JSContext *cx, JSScript *script, ExecutionMode mode, bool resetUses, bool cancelOffThread) diff --git a/js/src/jit/IonCode.h b/js/src/jit/IonCode.h index cfab3a599f6..df2b5d19a05 100644 --- a/js/src/jit/IonCode.h +++ b/js/src/jit/IonCode.h @@ -581,6 +581,10 @@ struct IonScript bool invalidated() const { return refcount_ != 0; } + + // Invalidate the current compilation. + bool invalidate(JSContext *cx, bool resetUses, const char *reason); + size_t refcount() const { return refcount_; }