@@ -30,6 +30,7 @@ enum ConstantTag {
3030 kInterfaceCall,
3131 kInstantiatedInterfaceCall,
3232 kDynamicCall,
33+ kExternalCall,
3334}
3435
3536String constantTagToString (ConstantTag tag) =>
@@ -84,6 +85,8 @@ abstract class ConstantPoolEntry {
8485 return new ConstantInstantiatedInterfaceCall .read (reader);
8586 case ConstantTag .kDynamicCall:
8687 return new ConstantDynamicCall .read (reader);
88+ case ConstantTag .kExternalCall:
89+ return new ConstantExternalCall .read (reader);
8790 }
8891 throw 'Unexpected constant tag $tag ' ;
8992 }
@@ -501,6 +504,32 @@ class ConstantDynamicCall extends ConstantPoolEntry {
501504 this .argDesc == other.argDesc;
502505}
503506
507+ class ConstantExternalCall extends ConstantPoolEntry {
508+ ConstantExternalCall ();
509+
510+ @override
511+ ConstantTag get tag => ConstantTag .kExternalCall;
512+
513+ @override
514+ int get numReservedEntries => 1 ;
515+
516+ @override
517+ void writeValue (BufferedWriter writer) {}
518+
519+ ConstantExternalCall .read (BufferedReader reader);
520+
521+ @override
522+ String toString () => 'ExternalCall' ;
523+
524+ // Do not merge ConstantExternalCall entries.
525+
526+ @override
527+ int get hashCode => identityHashCode (this );
528+
529+ @override
530+ bool operator == (other) => identical (this , other);
531+ }
532+
504533/// Reserved constant pool entry.
505534class _ReservedConstantPoolEntry extends ConstantPoolEntry {
506535 const _ReservedConstantPoolEntry ();
@@ -576,6 +605,8 @@ class ConstantPool {
576605 ? addDynamicCall (invocationKind, targetName, argDesc)
577606 : addInterfaceCall (invocationKind, target, argDesc);
578607
608+ int addExternalCall () => _add (ConstantExternalCall ());
609+
579610 int addStaticField (Field field) =>
580611 _add (new ConstantStaticField (objectTable.getHandle (field)! ));
581612
0 commit comments