File tree Expand file tree Collapse file tree 2 files changed +10
-17
lines changed Expand file tree Collapse file tree 2 files changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -689,17 +689,7 @@ abstract class AstCodeGenerator
689689 }
690690
691691 List <w.ValueType > call (Reference target) {
692- final targetModule = translator.moduleForReference (target);
693- final isLocalModuleCall = targetModule == b.module;
694- final name = translator.functions.getFunctionName (target);
695-
696- if (isLocalModuleCall) {
697- b.comment ('Direct call to $name ' );
698- return b.invoke (translator.directCallTarget (target));
699- } else {
700- b.comment ('Direct call to $name (across modules)' );
701- return translator.callReference (target, b);
702- }
692+ return translator.callReference (target, b);
703693 }
704694
705695 @override
Original file line number Diff line number Diff line change @@ -553,16 +553,19 @@ class Translator with KernelNodes {
553553 }
554554 }
555555
556- /// Gets the function associated with [reference] and calls its using
557- /// [callFunction] .
556+ /// Calls the function referred to in [reference] either directly or via a
557+ /// cross-module call.
558+ ///
559+ /// When performing a direct call it may inline the target if allowed and
560+ /// beneficial.
558561 List <w.ValueType > callReference (
559562 Reference reference, w.InstructionsBuilder b) {
560- final function = functions. getFunction (reference);
561- final targetModule = function.enclosingModule ;
562- if (targetModule == b.module ) {
563+ final targetModule = moduleForReference (reference);
564+ final isLocalModuleCall = targetModule == b.module ;
565+ if (isLocalModuleCall ) {
563566 return b.invoke (directCallTarget (reference));
564567 }
565- return callFunction (function , b);
568+ return callFunction (functions. getFunction (reference) , b);
566569 }
567570
568571 late final WasmFunctionImporter _importedFunctions =
You can’t perform that action at this time.
0 commit comments