File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -363,16 +363,15 @@ struct TypeInfos {
363363 }
364364 }
365365 void note (Type type) {
366- if (type.isNumber () || type.getID () == Type::none ||
367- type.getID () == Type::unreachable) {
368- return ;
369- }
366+ // Handle the common case of a ref directly, to avoid a scan of children.
370367 if (type.isRef ()) {
371368 note (type.getHeapType ());
372369 return ;
373370 }
374- for (HeapType ht : type.getHeapTypeChildren ()) {
375- note (ht);
371+ if (type.isTuple ()) {
372+ for (HeapType ht : type.getHeapTypeChildren ()) {
373+ note (ht);
374+ }
376375 }
377376 }
378377 // Ensure a type is included without increasing its count.
@@ -382,16 +381,14 @@ struct TypeInfos {
382381 }
383382 }
384383 void include (Type type) {
385- if (type.isNumber () || type.getID () == Type::none ||
386- type.getID () == Type::unreachable) {
387- return ;
388- }
389384 if (type.isRef ()) {
390385 include (type.getHeapType ());
391386 return ;
392387 }
393- for (HeapType ht : type.getHeapTypeChildren ()) {
394- include (ht);
388+ if (type.isTuple ()) {
389+ for (HeapType ht : type.getHeapTypeChildren ()) {
390+ include (ht);
391+ }
395392 }
396393 }
397394 void noteControlFlow (Signature sig) {
You can’t perform that action at this time.
0 commit comments