From 67361f102e9fe74b1e767f9ec4516984fdaf9359 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 11 Dec 2014 13:07:43 -0500 Subject: [PATCH] Bug 1109888. ICGetPropCallDOMProxyNativeStub should inherit from ICGetPropCallGetter so we have our holder/holdershape/etc accessible the same way across all the JSNative getter stubs. r=efaust --- js/src/jit/BaselineIC.cpp | 13 ++++++------- js/src/jit/BaselineIC.h | 37 +------------------------------------ 2 files changed, 7 insertions(+), 43 deletions(-) diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index c952c59e7414..f77a86098b02 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -11603,7 +11603,9 @@ ICGetPropCallGetter::ICGetPropCallGetter(Kind kind, JitCode *stubCode, ICStub *f { MOZ_ASSERT(kind == ICStub::GetProp_CallScripted || kind == ICStub::GetProp_CallNative || - kind == ICStub::GetProp_CallNativePrototype); + kind == ICStub::GetProp_CallNativePrototype || + kind == ICStub::GetProp_CallDOMProxyNative || + kind == ICStub::GetProp_CallDOMProxyWithGenerationNative); } ICGetPropCallPrototypeGetter::ICGetPropCallPrototypeGetter(Kind kind, JitCode *stubCode, @@ -11868,14 +11870,11 @@ ICGetPropCallDOMProxyNativeStub::ICGetPropCallDOMProxyNativeStub(Kind kind, JitC HandleShape holderShape, HandleFunction getter, uint32_t pcOffset) - : ICMonitoredStub(kind, stubCode, firstMonitorStub), +: ICGetPropCallGetter(kind, stubCode, firstMonitorStub, holder, holderShape, + getter, pcOffset), shape_(shape), proxyHandler_(proxyHandler), - expandoShape_(expandoShape), - holder_(holder), - holderShape_(holderShape), - getter_(getter), - pcOffset_(pcOffset) + expandoShape_(expandoShape) { } ICGetPropCallDOMProxyNativeCompiler::ICGetPropCallDOMProxyNativeCompiler(JSContext *cx, diff --git a/js/src/jit/BaselineIC.h b/js/src/jit/BaselineIC.h index fcffc576625a..93e63957a91f 100644 --- a/js/src/jit/BaselineIC.h +++ b/js/src/jit/BaselineIC.h @@ -4955,7 +4955,7 @@ class ICGetProp_CallNativePrototype : public ICGetPropCallPrototypeGetter }; }; -class ICGetPropCallDOMProxyNativeStub : public ICMonitoredStub +class ICGetPropCallDOMProxyNativeStub : public ICGetPropCallGetter { friend class ICStubSpace; protected: @@ -4968,16 +4968,6 @@ class ICGetPropCallDOMProxyNativeStub : public ICMonitoredStub // Object shape of expected expando object. (nullptr if no expando object should be there) HeapPtrShape expandoShape_; - // Holder and its shape. - HeapPtrObject holder_; - HeapPtrShape holderShape_; - - // Function to call. - HeapPtrFunction getter_; - - // PC offset of call - uint32_t pcOffset_; - ICGetPropCallDOMProxyNativeStub(ICStub::Kind kind, JitCode *stubCode, ICStub *firstMonitorStub, HandleShape shape, const BaseProxyHandler *proxyHandler, HandleShape expandoShape, @@ -4991,19 +4981,6 @@ class ICGetPropCallDOMProxyNativeStub : public ICMonitoredStub HeapPtrShape &expandoShape() { return expandoShape_; } - HeapPtrObject &holder() { - return holder_; - } - HeapPtrShape &holderShape() { - return holderShape_; - } - HeapPtrFunction &getter() { - return getter_; - } - uint32_t pcOffset() const { - return pcOffset_; - } - static size_t offsetOfShape() { return offsetof(ICGetPropCallDOMProxyNativeStub, shape_); } @@ -5013,18 +4990,6 @@ class ICGetPropCallDOMProxyNativeStub : public ICMonitoredStub static size_t offsetOfExpandoShape() { return offsetof(ICGetPropCallDOMProxyNativeStub, expandoShape_); } - static size_t offsetOfHolder() { - return offsetof(ICGetPropCallDOMProxyNativeStub, holder_); - } - static size_t offsetOfHolderShape() { - return offsetof(ICGetPropCallDOMProxyNativeStub, holderShape_); - } - static size_t offsetOfGetter() { - return offsetof(ICGetPropCallDOMProxyNativeStub, getter_); - } - static size_t offsetOfPCOffset() { - return offsetof(ICGetPropCallDOMProxyNativeStub, pcOffset_); - } }; class ICGetProp_CallDOMProxyNative : public ICGetPropCallDOMProxyNativeStub