@@ -66,11 +66,11 @@ inline unsigned CountArgSlots(JSScript* script, bool hasFun,
6666// Contains information about the compilation source for IR being generated.
6767class CompileInfo {
6868 public:
69- CompileInfo (CompileRuntime* runtime, JSScript* script, JSFunction* fun,
69+ CompileInfo (CompileRuntime* runtime, JSScript* script,
7070 jsbytecode* osrPc, bool scriptNeedsArgsObj,
7171 InlineScriptTree* inlineScriptTree)
7272 : script_(script),
73- fun_ (fun ),
73+ fun_ (script-> function () ),
7474 osrPc_(osrPc),
7575 scriptNeedsArgsObj_(scriptNeedsArgsObj),
7676 hadEagerTruncationBailout_(script->hadEagerTruncationBailout ()),
@@ -89,18 +89,9 @@ class CompileInfo {
8989 runtime->hasSeenArrayExceedsInt32LengthFuseIntact ()) {
9090 MOZ_ASSERT_IF (osrPc, JSOp (*osrPc) == JSOp::LoopHead);
9191
92- // The function here can flow in from anywhere so look up the canonical
93- // function to ensure that we do not try to embed a nursery pointer in
94- // jit-code. Precisely because it can flow in from anywhere, it's not
95- // guaranteed to be non-lazy. Hence, don't access its script!
96- if (fun_) {
97- fun_ = fun_->baseScript ()->function ();
98- MOZ_ASSERT (fun_->isTenured ());
99- }
100-
10192 nimplicit_ = StartArgSlot (script) /* env chain and argument obj */
102- + (fun ? 1 : 0 ); /* this */
103- nargs_ = fun ? fun ->nargs () : 0 ;
93+ + (fun_ ? 1 : 0 ); /* this */
94+ nargs_ = fun_ ? fun_ ->nargs () : 0 ;
10495 nlocals_ = script->nfixed ();
10596
10697 // An extra slot is needed for global scopes because InitGLexical (stack
@@ -134,7 +125,7 @@ class CompileInfo {
134125 // will need to be observable.
135126 needsBodyEnvironmentObject_ = script->needsBodyEnvironment ();
136127 funNeedsSomeEnvironmentObject_ =
137- fun ? fun ->needsSomeEnvironmentObject () : false ;
128+ fun_ ? fun_ ->needsSomeEnvironmentObject () : false ;
138129 }
139130
140131 explicit CompileInfo (unsigned nlocals)
0 commit comments