@@ -86,7 +86,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
8686 return Some {Any} (Core. _call_in_world_total (getargs (args, frame)... ))
8787 elseif f === Core. _compute_sparams
8888 return Some {Any} (Core. _compute_sparams (getargs (args, frame)... ))
89- elseif @static isdefined (Core, :_defaultctors ) && f === Core. _defaultctors
89+ elseif @static isdefinedglobal (Core, :_defaultctors ) && f === Core. _defaultctors
9090 return Some {Any} (Core. _defaultctors (getargs (args, frame)... ))
9191 elseif f === Core. _equiv_typedef
9292 return Some {Any} (Core. _equiv_typedef (getargs (args, frame)... ))
@@ -120,7 +120,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
120120 else
121121 return Some {Any} (Core. compilerbarrier (getargs (args, frame)... ))
122122 end
123- elseif @static isdefined (Core, :current_scope ) && f === Core. current_scope
123+ elseif @static isdefinedglobal (Core, :current_scope ) && f === Core. current_scope
124124 if nargs == 0
125125 currscope = Core. current_scope ()
126126 for scope in frame. framedata. current_scopes
@@ -154,33 +154,33 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
154154 else
155155 return Some {Any} (Core. ifelse (getargs (args, frame)... ))
156156 end
157- elseif @static isdefined (Core, :invoke_in_world ) && f === Core. invoke_in_world
157+ elseif @static isdefinedglobal (Core, :invoke_in_world ) && f === Core. invoke_in_world
158158 return Some {Any} (Core. invoke_in_world (getargs (args, frame)... ))
159- elseif @static isdefined (Core, :memorynew ) && f === Core. memorynew
159+ elseif @static isdefinedglobal (Core, :memorynew ) && f === Core. memorynew
160160 if nargs == 2
161161 return Some {Any} (Core. memorynew (@lookup (frame, args[2 ]), @lookup (frame, args[3 ])))
162162 else
163163 return Some {Any} (Core. memorynew (getargs (args, frame)... ))
164164 end
165- elseif @static isdefined (Core, :memoryref_isassigned ) && f === Core. memoryref_isassigned
165+ elseif @static isdefinedglobal (Core, :memoryref_isassigned ) && f === Core. memoryref_isassigned
166166 if nargs == 3
167167 return Some {Any} (Core. memoryref_isassigned (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ])))
168168 else
169169 return Some {Any} (Core. memoryref_isassigned (getargs (args, frame)... ))
170170 end
171- elseif @static isdefined (Core, :memoryrefget ) && f === Core. memoryrefget
171+ elseif @static isdefinedglobal (Core, :memoryrefget ) && f === Core. memoryrefget
172172 if nargs == 3
173173 return Some {Any} (Core. memoryrefget (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ])))
174174 else
175175 return Some {Any} (Core. memoryrefget (getargs (args, frame)... ))
176176 end
177- elseif @static isdefined (Core, :memoryrefmodify! ) && f === Core. memoryrefmodify!
177+ elseif @static isdefinedglobal (Core, :memoryrefmodify! ) && f === Core. memoryrefmodify!
178178 if nargs == 5
179179 return Some {Any} (Core. memoryrefmodify! (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ]), @lookup (frame, args[5 ]), @lookup (frame, args[6 ])))
180180 else
181181 return Some {Any} (Core. memoryrefmodify! (getargs (args, frame)... ))
182182 end
183- elseif @static isdefined (Core, :memoryrefnew ) && f === Core. memoryrefnew
183+ elseif @static isdefinedglobal (Core, :memoryrefnew ) && f === Core. memoryrefnew
184184 if nargs == 1
185185 return Some {Any} (Core. memoryrefnew (@lookup (frame, args[2 ])))
186186 elseif nargs == 2
@@ -194,31 +194,31 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
194194 else
195195 return Some {Any} (Core. memoryrefnew (getargs (args, frame)... ))
196196 end
197- elseif @static isdefined (Core, :memoryrefoffset ) && f === Core. memoryrefoffset
197+ elseif @static isdefinedglobal (Core, :memoryrefoffset ) && f === Core. memoryrefoffset
198198 if nargs == 1
199199 return Some {Any} (Core. memoryrefoffset (@lookup (frame, args[2 ])))
200200 else
201201 return Some {Any} (Core. memoryrefoffset (getargs (args, frame)... ))
202202 end
203- elseif @static isdefined (Core, :memoryrefreplace! ) && f === Core. memoryrefreplace!
203+ elseif @static isdefinedglobal (Core, :memoryrefreplace! ) && f === Core. memoryrefreplace!
204204 if nargs == 6
205205 return Some {Any} (Core. memoryrefreplace! (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ]), @lookup (frame, args[5 ]), @lookup (frame, args[6 ]), @lookup (frame, args[7 ])))
206206 else
207207 return Some {Any} (Core. memoryrefreplace! (getargs (args, frame)... ))
208208 end
209- elseif @static isdefined (Core, :memoryrefset! ) && f === Core. memoryrefset!
209+ elseif @static isdefinedglobal (Core, :memoryrefset! ) && f === Core. memoryrefset!
210210 if nargs == 4
211211 return Some {Any} (Core. memoryrefset! (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ]), @lookup (frame, args[5 ])))
212212 else
213213 return Some {Any} (Core. memoryrefset! (getargs (args, frame)... ))
214214 end
215- elseif @static isdefined (Core, :memoryrefsetonce! ) && f === Core. memoryrefsetonce!
215+ elseif @static isdefinedglobal (Core, :memoryrefsetonce! ) && f === Core. memoryrefsetonce!
216216 if nargs == 5
217217 return Some {Any} (Core. memoryrefsetonce! (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ]), @lookup (frame, args[5 ]), @lookup (frame, args[6 ])))
218218 else
219219 return Some {Any} (Core. memoryrefsetonce! (getargs (args, frame)... ))
220220 end
221- elseif @static isdefined (Core, :memoryrefswap! ) && f === Core. memoryrefswap!
221+ elseif @static isdefinedglobal (Core, :memoryrefswap! ) && f === Core. memoryrefswap!
222222 if nargs == 4
223223 return Some {Any} (Core. memoryrefswap! (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ]), @lookup (frame, args[5 ])))
224224 else
@@ -232,7 +232,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
232232 end
233233 elseif f === Core. svec
234234 return Some {Any} (Core. svec (getargs (args, frame)... ))
235- elseif @static isdefined (Core, :throw_methoderror ) && f === Core. throw_methoderror
235+ elseif @static isdefinedglobal (Core, :throw_methoderror ) && f === Core. throw_methoderror
236236 return Some {Any} (Core. throw_methoderror (getargs (args, frame)... ))
237237 elseif f === applicable
238238 return Some {Any} (applicable (getargs (args, frame)... ))
@@ -270,7 +270,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
270270 # This uses the original arguments to avoid looking them up twice
271271 # See #442
272272 return Expr (:call , invoke, args[2 : end ]. .. )
273- elseif @static isdefined (Core, :invokelatest ) && f === Core. invokelatest
273+ elseif @static isdefinedglobal (Core, :invokelatest ) && f === Core. invokelatest
274274 args = getargs (args, frame)
275275 if ! expand
276276 return Some {Any} (Core. invokelatest (args... ))
@@ -296,7 +296,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
296296 else
297297 return Some {Any} (isdefined (getargs (args, frame)... ))
298298 end
299- elseif @static isdefined (Core, :isdefinedglobal ) && f === isdefinedglobal
299+ elseif @static isdefinedglobal (Core, :isdefinedglobal ) && f === isdefinedglobal
300300 return Some {Any} (isdefinedglobal (getargs (args, frame)... ))
301301 elseif f === modifyfield!
302302 if nargs == 4
@@ -306,7 +306,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
306306 else
307307 return Some {Any} (modifyfield! (getargs (args, frame)... ))
308308 end
309- elseif @static isdefined (Core, :modifyglobal! ) && f === modifyglobal!
309+ elseif @static isdefinedglobal (Core, :modifyglobal! ) && f === modifyglobal!
310310 if nargs == 4
311311 return Some {Any} (Base. invoke_in_world (frame. world, modifyglobal!, @lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ]), @lookup (frame, args[5 ])))
312312 elseif nargs == 5
@@ -330,7 +330,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
330330 else
331331 return Some {Any} (replacefield! (getargs (args, frame)... ))
332332 end
333- elseif @static isdefined (Core, :replaceglobal! ) && f === replaceglobal!
333+ elseif @static isdefinedglobal (Core, :replaceglobal! ) && f === replaceglobal!
334334 if nargs == 4
335335 return Some {Any} (Base. invoke_in_world (frame. world, replaceglobal!, @lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ]), @lookup (frame, args[5 ])))
336336 elseif nargs == 5
@@ -348,7 +348,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
348348 else
349349 return Some {Any} (setfield! (getargs (args, frame)... ))
350350 end
351- elseif @static isdefined (Core, :setfieldonce! ) && f === setfieldonce!
351+ elseif @static isdefinedglobal (Core, :setfieldonce! ) && f === setfieldonce!
352352 if nargs == 3
353353 return Some {Any} (setfieldonce! (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ])))
354354 elseif nargs == 4
@@ -366,7 +366,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
366366 else
367367 return Some {Any} (Base. invoke_in_world (frame. world, setglobal!, getargs (args, frame)... ))
368368 end
369- elseif @static isdefined (Core, :setglobalonce! ) && f === setglobalonce!
369+ elseif @static isdefinedglobal (Core, :setglobalonce! ) && f === setglobalonce!
370370 if nargs == 3
371371 return Some {Any} (Base. invoke_in_world (frame. world, setglobalonce!, @lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ])))
372372 elseif nargs == 4
@@ -384,7 +384,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
384384 else
385385 return Some {Any} (swapfield! (getargs (args, frame)... ))
386386 end
387- elseif @static isdefined (Core, :swapglobal! ) && f === swapglobal!
387+ elseif @static isdefinedglobal (Core, :swapglobal! ) && f === swapglobal!
388388 if nargs == 3
389389 return Some {Any} (Base. invoke_in_world (frame. world, swapglobal!, @lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ])))
390390 elseif nargs == 4
@@ -426,7 +426,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
426426 call_expr. args[3 ] = @lookup (frame, args[3 ])
427427 return Some {Any} (Core. eval (moduleof (frame), call_expr))
428428 end
429- elseif @static (isdefined (Core, :arrayref ) && Core. arrayref isa Core. Builtin) && f === Core. arrayref
429+ elseif @static (isdefinedglobal (Core, :arrayref ) && Core. arrayref isa Core. Builtin) && f === Core. arrayref
430430 if nargs == 1
431431 return Some {Any} (Core. arrayref (@lookup (frame, args[2 ])))
432432 elseif nargs == 2
@@ -440,7 +440,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
440440 else
441441 return Some {Any} (Core. arrayref (getargs (args, frame)... ))
442442 end
443- elseif @static (isdefined (Core, :arrayset ) && Core. arrayset isa Core. Builtin) && f === Core. arrayset
443+ elseif @static (isdefinedglobal (Core, :arrayset ) && Core. arrayset isa Core. Builtin) && f === Core. arrayset
444444 if nargs == 1
445445 return Some {Any} (Core. arrayset (@lookup (frame, args[2 ])))
446446 elseif nargs == 2
@@ -456,7 +456,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
456456 else
457457 return Some {Any} (Core. arrayset (getargs (args, frame)... ))
458458 end
459- elseif @static (isdefined (Core, :arrayset ) && Core. arrayset isa Core. Builtin) && f === Core. arrayset
459+ elseif @static (isdefinedglobal (Core, :arrayset ) && Core. arrayset isa Core. Builtin) && f === Core. arrayset
460460 if nargs == 1
461461 return Some {Any} (Core. arrayset (@lookup (frame, args[2 ])))
462462 elseif nargs == 2
@@ -472,7 +472,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
472472 else
473473 return Some {Any} (Core. arrayset (getargs (args, frame)... ))
474474 end
475- elseif @static (isdefined (Core, :const_arrayref ) && Core. const_arrayref isa Core. Builtin) && f === Core. const_arrayref
475+ elseif @static (isdefinedglobal (Core, :const_arrayref ) && Core. const_arrayref isa Core. Builtin) && f === Core. const_arrayref
476476 if nargs == 1
477477 return Some {Any} (Core. const_arrayref (@lookup (frame, args[2 ])))
478478 elseif nargs == 2
@@ -486,7 +486,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
486486 else
487487 return Some {Any} (Core. const_arrayref (getargs (args, frame)... ))
488488 end
489- elseif @static (isdefined (Core, :memoryref ) && Core. memoryref isa Core. Builtin) && f === Core. memoryref
489+ elseif @static (isdefinedglobal (Core, :memoryref ) && Core. memoryref isa Core. Builtin) && f === Core. memoryref
490490 if nargs == 1
491491 return Some {Any} (Core. memoryref (@lookup (frame, args[2 ])))
492492 elseif nargs == 2
@@ -500,19 +500,19 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
500500 else
501501 return Some {Any} (Core. memoryref (getargs (args, frame)... ))
502502 end
503- elseif @static (isdefined (Core, :set_binding_type! ) && Core. set_binding_type! isa Core. Builtin) && f === Core. set_binding_type!
503+ elseif @static (isdefinedglobal (Core, :set_binding_type! ) && Core. set_binding_type! isa Core. Builtin) && f === Core. set_binding_type!
504504 if nargs == 2
505505 return Some {Any} (Core. set_binding_type! (@lookup (frame, args[2 ]), @lookup (frame, args[3 ])))
506506 elseif nargs == 3
507507 return Some {Any} (Core. set_binding_type! (@lookup (frame, args[2 ]), @lookup (frame, args[3 ]), @lookup (frame, args[4 ])))
508508 else
509509 return Some {Any} (Core. set_binding_type! (getargs (args, frame)... ))
510510 end
511- elseif @static (isdefined (Core, :_apply_pure ) && Core. _apply_pure isa Core. Builtin) && f === Core. _apply_pure
511+ elseif @static (isdefinedglobal (Core, :_apply_pure ) && Core. _apply_pure isa Core. Builtin) && f === Core. _apply_pure
512512 return Some {Any} (Core. _apply_pure (getargs (args, frame)... ))
513- elseif @static (isdefined (Core, :_call_in_world ) && Core. _call_in_world isa Core. Builtin) && f === Core. _call_in_world
513+ elseif @static (isdefinedglobal (Core, :_call_in_world ) && Core. _call_in_world isa Core. Builtin) && f === Core. _call_in_world
514514 return Some {Any} (Core. _call_in_world (getargs (args, frame)... ))
515- elseif @static (isdefined (Core, :_call_latest ) && Core. _call_latest isa Core. Builtin) && f === Core. _call_latest
515+ elseif @static (isdefinedglobal (Core, :_call_latest ) && Core. _call_latest isa Core. Builtin) && f === Core. _call_latest
516516 args = getargs (args, frame)
517517 if ! expand
518518 return Some {Any} (Core. _call_latest (args... ))
0 commit comments