Bug 1602222 - Move LazyScript::parseGoal() to BaseScript. r=jandem
authorTed Campbell <tcampbell@mozilla.com>
Mon, 16 Dec 2019 13:48:49 +0000
changeset 507112 887237f5f3e076dd6b0f319f7ea853649772f5d9
parent 507111 42f003a501505ba037fea0fac75559d1a7bb1928
child 507113 fd2b064f3c17c72a3ddd236566151f18d314d64c
push id36923
push userccoroiu@mozilla.com
push dateMon, 16 Dec 2019 21:47:33 +0000
treeherdermozilla-central@c238b47d7d57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1602222
milestone73.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 1602222 - Move LazyScript::parseGoal() to BaseScript. r=jandem Depends on D57220 Differential Revision: https://phabricator.services.mozilla.com/D57224
js/src/vm/JSScript.h
--- a/js/src/vm/JSScript.h
+++ b/js/src/vm/JSScript.h
@@ -2094,16 +2094,21 @@ setterLevel:                            
   }
 
   void setAsyncKind(FunctionAsyncKind kind) {
     if (kind == FunctionAsyncKind::AsyncFunction) {
       setFlag(ImmutableFlags::IsAsync);
     }
   }
 
+  frontend::ParseGoal parseGoal() const {
+    return hasModuleGoal() ? frontend::ParseGoal::Module
+                           : frontend::ParseGoal::Script;
+  }
+
   bool hasEnclosingLazyScript() const {
     return warmUpData_.isEnclosingScript();
   }
   LazyScript* enclosingLazyScript() const {
     return warmUpData_.toEnclosingScript();
   }
   void setEnclosingLazyScript(LazyScript* enclosingLazyScript);
 
@@ -3403,23 +3408,16 @@ class LazyScript : public BaseScript {
   void initScript(JSScript* script);
 
   JSScript* maybeScript() { return script_; }
   const JSScript* maybeScriptUnbarriered() const {
     return script_.unbarrieredGet();
   }
   bool hasScript() const { return bool(script_); }
 
-  frontend::ParseGoal parseGoal() const {
-    if (hasFlag(ImmutableFlags::HasModuleGoal)) {
-      return frontend::ParseGoal::Module;
-    }
-    return frontend::ParseGoal::Script;
-  }
-
   // Returns true if the enclosing script has ever been compiled.
   // Once the enclosing script is compiled, the scope chain is created.
   // This LazyScript is delazify-able as long as it has the enclosing scope,
   // even if the enclosing JSScript is GCed.
   // The enclosing JSScript can be GCed later if the enclosing scope is not
   // FunctionScope or ModuleScope.
   bool enclosingScriptHasEverBeenCompiled() const {
     return warmUpData_.isEnclosingScope();