arai-a / smoosh-sync

Automation to make jsparagus and SpiderMonkey bytecode in sync
2 stars 0 forks source link

/js/src/frontend/Stencil.cpp has been updated (5f7986e4) #350

Open github-actions[bot] opened 10 months ago

github-actions[bot] commented 10 months ago

Files

Changesets

Diffs

/js/src/frontend/Stencil.cpp

--- aeafc420949ca9fe37744dbce5b4cb4ce4975010/js/src/frontend/Stencil.cpp
+++ 5f7986e4be591d0f2e3d58eb53b42dafa1dcb21b/js/src/frontend/Stencil.cpp
@@ -31,30 +31,32 @@
 #include "frontend/StencilXdr.h"  // XDRStencilEncoder, XDRStencilDecoder
 #include "gc/AllocKind.h"         // gc::AllocKind
 #include "gc/Tracer.h"            // TraceNullableRoot
 #include "js/CallArgs.h"          // JSNative
 #include "js/CompileOptions.h"  // JS::DecodeOptions, JS::ReadOnlyDecodeOptions
 #include "js/experimental/JSStencil.h"  // JS::Stencil
 #include "js/GCAPI.h"                   // JS::AutoCheckCannotGC
 #include "js/Printer.h"                 // js::Fprinter
+#include "js/RealmOptions.h"            // JS::RealmBehaviors
 #include "js/RootingAPI.h"              // Rooted
 #include "js/Transcoding.h"             // JS::TranscodeBuffer
 #include "js/Utility.h"                 // js_malloc, js_calloc, js_free
 #include "js/Value.h"                   // ObjectValue
 #include "js/WasmModule.h"              // JS::WasmModule
 #include "vm/BigIntType.h"   // ParseBigIntLiteral, BigIntLiteralIsZero
 #include "vm/BindingKind.h"  // BindingKind
 #include "vm/EnvironmentObject.h"
 #include "vm/GeneratorAndAsyncKind.h"  // GeneratorKind, FunctionAsyncKind
 #include "vm/JSContext.h"              // JSContext
 #include "vm/JSFunction.h"  // JSFunction, GetFunctionPrototype, NewFunctionWithProto
 #include "vm/JSObject.h"      // JSObject, TenuredObject
 #include "vm/JSONPrinter.h"   // js::JSONPrinter
 #include "vm/JSScript.h"      // BaseScript, JSScript
+#include "vm/Realm.h"         // JS::Realm
 #include "vm/RegExpObject.h"  // js::RegExpObject
 #include "vm/Scope.h"  // Scope, *Scope, ScopeKind::*, ScopeKindString, ScopeIter, ScopeKindIsCatch, BindingIter, GetScopeDataTrailingNames, SizeOfParserScopeData
 #include "vm/ScopeKind.h"    // ScopeKind
 #include "vm/SelfHosting.h"  // SetClonedSelfHostedFunctionName
 #include "vm/StaticStrings.h"
 #include "vm/StencilEnums.h"  // ImmutableScriptFlagsEnum
 #include "vm/StringType.h"    // JSAtom, js::CopyChars
 #include "wasm/AsmJS.h"       // InstantiateAsmJS
@@ -2614,16 +2616,20 @@ bool CompilationStencil::instantiateSten
 bool CompilationStencil::instantiateStencilAfterPreparation(
     JSContext* cx, CompilationInput& input, const CompilationStencil& stencil,
     CompilationGCOutput& gcOutput) {
   // Distinguish between the initial (possibly lazy) compile and any subsequent
   // delazification compiles. Delazification will update existing GC things.
   bool isInitialParse = stencil.isInitialStencil();
   MOZ_ASSERT(stencil.isInitialStencil() == input.isInitialStencil());

+  // Assert the consistency between the compile option and the target global.
+  MOZ_ASSERT_IF(cx->realm()->behaviors().discardSource(),
+                !stencil.canLazilyParse);
+
   CompilationAtomCache& atomCache = input.atomCache;
   const JS::InstantiateOptions options(input.options);

   // Phase 1: Instantiate JSAtom/JSStrings.
   AutoReportFrontendContext fc(cx);
   if (!InstantiateAtoms(cx, &fc, atomCache, stencil)) {
     return false;
   }