Bug 1533420 - Remove JSScript::ExplicitUseStrict flag. r=jandem
authorTed Campbell <tcampbell@mozilla.com>
Thu, 07 Mar 2019 16:08:17 +0000
changeset 462917 dbf02da1d1bf4dc09640bf02b6a15a1ef2e825fd
parent 462916 a7c18fe7a05098c880d776c281cfd5c656f3ebdc
child 462918 0fc3a7dd1b3e266fca5d936e84d1b709c8d34aaa
push id79917
push usertcampbell@mozilla.com
push dateThu, 07 Mar 2019 16:09:06 +0000
treeherderautoland@dbf02da1d1bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1533420
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1533420 - Remove JSScript::ExplicitUseStrict flag. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D22524
js/src/vm/JSScript.cpp
js/src/vm/JSScript.h
--- a/js/src/vm/JSScript.cpp
+++ b/js/src/vm/JSScript.cpp
@@ -3567,18 +3567,16 @@ bool JSScript::fullyInitFromEmitter(JSCo
   script->mainOffset_ = bce->mainOffset();
   script->nfixed_ = bce->maxFixedSlots;
   script->nslots_ = nslots;
   script->bodyScopeIndex_ = bce->bodyScopeIndex;
   script->numBytecodeTypeSets_ = bce->typesetCount;
 
   // Initialize script flags from BytecodeEmitter
   script->setFlag(ImmutableFlags::Strict, bce->sc->strict());
-  script->setFlag(ImmutableFlags::ExplicitUseStrict,
-                  bce->sc->hasExplicitUseStrict());
   script->setFlag(ImmutableFlags::BindingsAccessedDynamically,
                   bce->sc->bindingsAccessedDynamically());
   script->setFlag(ImmutableFlags::HasSingletons, bce->hasSingletons);
   script->setFlag(ImmutableFlags::IsForEval, bce->sc->isEvalContext());
   script->setFlag(ImmutableFlags::IsModule, bce->sc->isModuleContext());
   script->setFlag(ImmutableFlags::HasNonSyntacticScope,
                   bce->outermostScope()->hasOnChain(ScopeKind::NonSyntactic));
   script->setFlag(ImmutableFlags::NeedsFunctionEnvironmentObjects,
--- a/js/src/vm/JSScript.h
+++ b/js/src/vm/JSScript.h
@@ -1681,18 +1681,17 @@ class JSScript : public js::gc::TenuredC
  public:
   enum class ImmutableFlags : uint32_t {
     // No need for result value of last expression statement.
     NoScriptRval = 1 << 0,
 
     // Code is in strict mode.
     Strict = 1 << 1,
 
-    // Code has "use strict"; explicitly.
-    ExplicitUseStrict = 1 << 2,
+    // (1 << 2) is unused.
 
     // True if the script has a non-syntactic scope on its dynamic scope chain.
     // That is, there are objects about which we know nothing between the
     // outermost syntactic scope and the global.
     HasNonSyntacticScope = 1 << 3,
 
     // See Parser::selfHostingMode.
     SelfHosted = 1 << 4,
@@ -2093,20 +2092,16 @@ class JSScript : public js::gc::TenuredC
   uint32_t toStringStart() const { return toStringStart_; }
 
   uint32_t toStringEnd() const { return toStringEnd_; }
 
   bool noScriptRval() const { return hasFlag(ImmutableFlags::NoScriptRval); }
 
   bool strict() const { return hasFlag(ImmutableFlags::Strict); }
 
-  bool explicitUseStrict() const {
-    return hasFlag(ImmutableFlags::ExplicitUseStrict);
-  }
-
   bool hasNonSyntacticScope() const {
     return hasFlag(ImmutableFlags::HasNonSyntacticScope);
   }
 
   bool selfHosted() const { return hasFlag(ImmutableFlags::SelfHosted); }
   bool bindingsAccessedDynamically() const {
     return hasFlag(ImmutableFlags::BindingsAccessedDynamically);
   }