bool IonFrameIterator::checkInvalidation(IonScript **ionScriptOut) const { AutoAssertNoGC nogc; // Currently, this code only executes in sequential execution. CompileMode compileMode = COMPILE_MODE_SEQ; uint8 *returnAddr = returnAddressToFp(); RawScript script = this->script(); // N.B. the current IonScript is not the same as the frame's // IonScript if the frame has since been invalidated. IonScript *currentIonScript = script->ions[compileMode]; bool invalidated = !script->hasIonScript(compileMode) || !currentIonScript->containsReturnAddress(returnAddr); if (!invalidated) return false; int32 invalidationDataOffset = ((int32 *) returnAddr)[-1]; uint8 *ionScriptDataOffset = returnAddr + invalidationDataOffset; IonScript *ionScript = (IonScript *) Assembler::getPointer(ionScriptDataOffset); JS_ASSERT(ionScript->containsReturnAddress(returnAddr)); *ionScriptOut = ionScript; return true; }
bool IonFrameIterator::checkInvalidation(IonScript **ionScriptOut) const { AutoAssertNoGC nogc; uint8_t *returnAddr = returnAddressToFp(); RawScript script = this->script(); // N.B. the current IonScript is not the same as the frame's // IonScript if the frame has since been invalidated. IonScript *currentIonScript = script->ion; bool invalidated = !script->hasIonScript() || !currentIonScript->containsReturnAddress(returnAddr); if (!invalidated) return false; int32_t invalidationDataOffset = ((int32_t *) returnAddr)[-1]; uint8_t *ionScriptDataOffset = returnAddr + invalidationDataOffset; IonScript *ionScript = (IonScript *) Assembler::getPointer(ionScriptDataOffset); JS_ASSERT(ionScript->containsReturnAddress(returnAddr)); *ionScriptOut = ionScript; return true; }