From c7e069d8a82c0967ea6caaafe3904b9d1a7251c1 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Fri, 22 Mar 2013 14:44:52 -0700 Subject: [PATCH] Bug 831349 - Reset Ion cache flags when flushed. r=dvander --- js/src/ion/IonCaches.cpp | 15 +++++++++++++++ js/src/ion/IonCaches.h | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/js/src/ion/IonCaches.cpp b/js/src/ion/IonCaches.cpp index c32cab82c92..b09627f05f2 100644 --- a/js/src/ion/IonCaches.cpp +++ b/js/src/ion/IonCaches.cpp @@ -1017,6 +1017,14 @@ GetPropertyIC::update(JSContext *cx, size_t cacheIndex, return true; } +void +GetPropertyIC::reset() +{ + IonCache::reset(); + hasArrayLengthStub_ = false; + hasTypedArrayLengthStub_ = false; +} + void IonCache::updateBaseAddress(IonCode *code, MacroAssembler &masm) { @@ -1742,6 +1750,13 @@ GetElementIC::update(JSContext *cx, size_t cacheIndex, HandleObject obj, return true; } +void +GetElementIC::reset() +{ + IonCache::reset(); + hasDenseStub_ = false; +} + bool BindNameIC::attachGlobal(JSContext *cx, IonScript *ion, JSObject *scopeChain) { diff --git a/js/src/ion/IonCaches.h b/js/src/ion/IonCaches.h index 1f1dad3b3c3..dc8d530872f 100644 --- a/js/src/ion/IonCaches.h +++ b/js/src/ion/IonCaches.h @@ -221,7 +221,7 @@ class IonCache void updateBaseAddress(IonCode *code, MacroAssembler &masm); // Reset the cache around garbage collection. - void reset(); + virtual void reset(); bool canAttachStub() const { return stubCount_ < MAX_STUBS; @@ -322,6 +322,8 @@ class GetPropertyIC : public IonCache CACHE_HEADER(GetProperty) + void reset(); + Register object() const { return object_; } @@ -433,6 +435,8 @@ class GetElementIC : public IonCache CACHE_HEADER(GetElement) + void reset(); + Register object() const { return object_; }