@@ -20860,6 +20860,7 @@ const BuiltInFireId = 'BuiltInFire';
2086020860const BuiltInFireFunctionId = 'BuiltInFireFunction';
2086120861const BuiltInUseEffectEventId = 'BuiltInUseEffectEvent';
2086220862const BuiltinEffectEventId = 'BuiltInEffectEventFunction';
20863+ const BuiltInAutodepsId = 'BuiltInAutoDepsId';
2086320864const ReanimatedSharedValueId = 'ReanimatedSharedValueId';
2086420865const BUILTIN_SHAPES = new Map();
2086520866addObject(BUILTIN_SHAPES, BuiltInPropsId, [
@@ -29728,6 +29729,7 @@ const REACT_APIS = [
2972829729 returnValueKind: ValueKind.Frozen,
2972929730 }, BuiltInUseEffectEventId),
2973029731 ],
29732+ ['AUTODEPS', addObject(DEFAULT_SHAPES, BuiltInAutodepsId, [])],
2973129733];
2973229734TYPED_GLOBALS.push([
2973329735 'React',
@@ -45235,7 +45237,12 @@ function inferEffectDependencies(fn) {
4523545237 else if (value.kind === 'CallExpression' ||
4523645238 value.kind === 'MethodCall') {
4523745239 const callee = value.kind === 'CallExpression' ? value.callee : value.property;
45238- if (value.args.length === autodepFnLoads.get(callee.identifier.id) &&
45240+ const autodepsArgIndex = value.args.findIndex(arg => arg.kind === 'Identifier' &&
45241+ arg.identifier.type.kind === 'Object' &&
45242+ arg.identifier.type.shapeId === BuiltInAutodepsId);
45243+ if (value.args.length > 1 &&
45244+ autodepsArgIndex > 0 &&
45245+ autodepFnLoads.has(callee.identifier.id) &&
4523945246 value.args[0].kind === 'Identifier') {
4524045247 const effectDeps = [];
4524145248 const deps = {
@@ -45302,7 +45309,7 @@ function inferEffectDependencies(fn) {
4530245309 effects: null,
4530345310 },
4530445311 });
45305- value.args.push( Object.assign(Object.assign({}, depsPlace), { effect: Effect.Freeze }) );
45312+ value.args[autodepsArgIndex] = Object.assign(Object.assign({}, depsPlace), { effect: Effect.Freeze });
4530645313 fn.env.inferredEffectLocations.add(callee.loc);
4530745314 }
4530845315 else if (loadGlobals.has(value.args[0].identifier.id)) {
@@ -45317,7 +45324,7 @@ function inferEffectDependencies(fn) {
4531745324 effects: null,
4531845325 },
4531945326 });
45320- value.args.push( Object.assign(Object.assign({}, depsPlace), { effect: Effect.Freeze }) );
45327+ value.args[autodepsArgIndex] = Object.assign(Object.assign({}, depsPlace), { effect: Effect.Freeze });
4532145328 fn.env.inferredEffectLocations.add(callee.loc);
4532245329 }
4532345330 }
@@ -45351,6 +45358,7 @@ function inferEffectDependencies(fn) {
4535145358 markPredecessors(fn.body);
4535245359 markInstructionIds(fn.body);
4535345360 fixScopeAndIdentifierRanges(fn.body);
45361+ deadCodeElimination(fn);
4535445362 fn.env.hasInferredEffect = true;
4535545363 }
4535645364}
@@ -45387,7 +45395,7 @@ function rewriteSplices(originalBlock, splices, rewriteBlocks) {
4538745395 if (rewrite.kind === 'instr') {
4538845396 currBlock.instructions.push(rewrite.value);
4538945397 }
45390- else {
45398+ else if (rewrite.kind === 'block') {
4539145399 const { entry, blocks } = rewrite.value;
4539245400 const entryBlock = blocks.get(entry);
4539345401 currBlock.instructions.push(...entryBlock.instructions);
0 commit comments