diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index 0bef0187412c..e8c440e69c5f 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -357,6 +357,7 @@ js::XDRScript(XDRState *xdr, HandleObject enclosingScope, HandleScript enc OwnFilename, ParentFilename, IsGenerator, + IsGeneratorExp, HaveSource, OwnSource, ExplicitUseStrict @@ -525,6 +526,8 @@ js::XDRScript(XDRState *xdr, HandleObject enclosingScope, HandleScript enc } if (script->isGenerator) scriptBits |= (1 << IsGenerator); + if (script->isGeneratorExp) + scriptBits |= (1 << IsGeneratorExp); JS_ASSERT(!script->compileAndGo); JS_ASSERT(!script->hasSingletons); @@ -606,6 +609,8 @@ js::XDRScript(XDRState *xdr, HandleObject enclosingScope, HandleScript enc script->setNeedsArgsObj(true); if (scriptBits & (1 << IsGenerator)) script->isGenerator = true; + if (scriptBits & (1 << IsGeneratorExp)) + script->isGeneratorExp = true; } JS_STATIC_ASSERT(sizeof(jsbytecode) == 1); @@ -1814,6 +1819,7 @@ JSScript::fullyInitFromEmitter(JSContext *cx, Handle script, Bytecode if (bce->sc->inFunction()) { JS_ASSERT(!bce->script->noScriptRval); script->isGenerator = bce->sc->funIsGenerator(); + script->isGeneratorExp = bce->sc->funbox() && bce->sc->funbox()->inGenexpLambda; script->setFunction(bce->sc->fun()); } @@ -2289,6 +2295,7 @@ js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, dst->funHasExtensibleScope = src->funHasExtensibleScope; dst->hasSingletons = src->hasSingletons; dst->isGenerator = src->isGenerator; + dst->isGeneratorExp = src->isGeneratorExp; /* * initScriptCounts updates scriptCountsMap if necessary. The other script diff --git a/js/src/jsscript.h b/js/src/jsscript.h index c58447cc87b7..5e832cd3f612 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -540,6 +540,7 @@ struct JSScript : public js::gc::Cell #endif bool callDestroyHook:1;/* need to call destroy hook */ bool isGenerator:1; /* is a generator */ + bool isGeneratorExp:1; /* is a generator expression */ bool hasScriptCounts:1;/* script has an entry in JSCompartment::scriptCountsMap */ bool hasSourceMap:1; /* script has an entry in diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h index 20dcf623b5ed..4514bdeb6112 100644 --- a/js/src/vm/Xdr.h +++ b/js/src/vm/Xdr.h @@ -25,7 +25,7 @@ namespace js { * and saved versions. If deserialization fails, the data should be * invalidated if possible. */ -static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 123); +static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 124); class XDRBuffer { public: