diff --git a/js/src/ion/IonFrames.cpp b/js/src/ion/IonFrames.cpp index f31a8741465..223dd0dbb8a 100644 --- a/js/src/ion/IonFrames.cpp +++ b/js/src/ion/IonFrames.cpp @@ -122,10 +122,7 @@ IonFrameIterator::isDOMExit() const { if (type_ != IonFrame_Exit) return false; - IonCode *code = exitFrame()->footer()->ionCode(); - return code == ION_FRAME_DOMGETTER || - code == ION_FRAME_DOMSETTER || - code == ION_FRAME_DOMMETHOD; + return exitFrame()->isDomExit(); } bool diff --git a/js/src/ion/arm/IonFrames-arm.h b/js/src/ion/arm/IonFrames-arm.h index 56bd6d2f7bd..f0cd1a5fb47 100644 --- a/js/src/ion/arm/IonFrames-arm.h +++ b/js/src/ion/arm/IonFrames-arm.h @@ -185,14 +185,28 @@ class IonExitFrameLayout : public IonCommonFrameLayout JS_ASSERT(footer()->ionCode() != NULL); return top(); } + + inline bool isWrapperExit() { + return footer()->function() != NULL; + } + inline bool isNativeExit() { + return footer()->ionCode() == NULL; + } + inline bool isDomExit() { + IonCode *code = footer()->ionCode(); + return + code == ION_FRAME_DOMGETTER || + code == ION_FRAME_DOMSETTER || + code == ION_FRAME_DOMMETHOD; + } + inline IonNativeExitFrameLayout *nativeExit() { // see CodeGenerator::visitCallNative - JS_ASSERT(footer()->ionCode() == NULL); + JS_ASSERT(isNativeExit()); return reinterpret_cast(footer()); } inline IonDOMExitFrameLayout *DOMExit() { - JS_ASSERT(footer()->ionCode() == ION_FRAME_DOMGETTER || - footer()->ionCode() == ION_FRAME_DOMSETTER); + JS_ASSERT(isDomExit()); return reinterpret_cast(footer()); } }; diff --git a/js/src/ion/shared/IonFrames-x86-shared.h b/js/src/ion/shared/IonFrames-x86-shared.h index 00df2819f02..d543381b4f8 100644 --- a/js/src/ion/shared/IonFrames-x86-shared.h +++ b/js/src/ion/shared/IonFrames-x86-shared.h @@ -169,14 +169,28 @@ class IonExitFrameLayout : public IonCommonFrameLayout JS_ASSERT(footer()->ionCode() != NULL); return top(); } + + inline bool isWrapperExit() { + return footer()->function() != NULL; + } + inline bool isNativeExit() { + return footer()->ionCode() == NULL; + } + inline bool isDomExit() { + IonCode *code = footer()->ionCode(); + return + code == ION_FRAME_DOMGETTER || + code == ION_FRAME_DOMSETTER || + code == ION_FRAME_DOMMETHOD; + } + inline IonNativeExitFrameLayout *nativeExit() { // see CodeGenerator::visitCallNative - JS_ASSERT(footer()->ionCode() == NULL); + JS_ASSERT(isNativeExit()); return reinterpret_cast(footer()); } inline IonDOMExitFrameLayout *DOMExit() { - JS_ASSERT(footer()->ionCode() == ION_FRAME_DOMGETTER || - footer()->ionCode() == ION_FRAME_DOMSETTER); + JS_ASSERT(isDomExit()); return reinterpret_cast(footer()); } };