anchor.diff:    typesOffset = #embeddedTypes.length;
   
     // TODO(floitsch): extend natives.
  -  hunk(inherit, inheritMany, mixin, lazy, makeConstList, convertToFastObject, installTearOff,
  +  hunk(inherit, inheritMany, mixin, lazy, makeConstList, convertToFastObject,
  +       hunkHelpers,
          setFunctionNamesIfNecessary, updateHolder, updateTypes,
          setOrUpdateInterceptorsByTag, setOrUpdateLeafTags,
          #embeddedGlobalsObject, holders, #staticState);
  
positive.code:     }
    }
  
    /// Emits the statement that installs a tear off for a method.
    ///
    /// Tear-offs might be passed to `Function.apply` which means that all
    /// calling-conventions (with or without optional positional/named arguments)
    /// are possible. As such, the tear-off needs enough information to fill in
    /// missing parameters.
    js.Statement emitInstallTearOff(js.Expression container, DartMethod method) {
      List<js.Name> callNames = [];
      List<js.Expression> funsOrNames = [];
  
      /// Adds the stub-method's code or name to the [funsOrNames] array.
      ///
      /// Static methods don't need stub-methods except for tear-offs. As such,
      /// they are not emitted in the prototype, but directly passed here.
      ///
      /// Instance-methods install the stub-methods in their prototype, and we
      /// use string-based redirections to find them there.
      void addFunOrName(StubMethod stubMethod) {
        if (method.isStatic) {
          funsOrNames.add(stubMethod.code);
        } else {
          funsOrNames.add(js.quoteName(stubMethod.name));
        }
      }
  
      callNames.add(method.callName);
      // The first entry in the funsOrNames-array must be a string.
      funsOrNames.add(js.quoteName(method.name));
      for (ParameterStubMethod stubMethod in method.parameterStubs) {
        callNames.add(stubMethod.callName);
        addFunOrName(stubMethod);
      }
  
      js.ArrayInitializer callNameArray =
          new js.ArrayInitializer(callNames.map(js.quoteName).toList());
      js.ArrayInitializer funsOrNamesArray = new js.ArrayInitializer(funsOrNames);
  
      bool isIntercepted = false;
      if (method is InstanceMethod) {
        isIntercepted = method.isIntercepted;
      }
      int requiredParameterCount = 0;
      js.Expression optionalParameterDefaultValues = new js.LiteralNull();
      if (method.canBeApplied) {
        requiredParameterCount = method.requiredParameterCount;
        optionalParameterDefaultValues =
            _encodeOptionalParameterDefaultValues(method);
      }
  
      var applyIndex = js.number(method.applyIndex);
  
      return js.js.statement('''
          installTearOff(#container, #getterName, #isStatic, #isIntercepted,
                         #requiredParameterCount, #optionalParameterDefaultValues,
                         #callNames, #funsOrNames, #funType, #applyIndex)''', {
        "container": container,
        "getterName": js.quoteName(method.tearOffName),
        // 'Truthy' values are ok for `isStatic` and `isIntercepted`.
        "isStatic": js.number(method.isStatic ? 1 : 0),
        "isIntercepted": js.number(isIntercepted ? 1 : 0),
        "requiredParameterCount": js.number(requiredParameterCount),
        "optionalParameterDefaultValues": optionalParameterDefaultValues,
        "callNames": callNameArray,
        "funsOrNames": funsOrNamesArray,
        "funType": method.functionType,
        "applyIndex": applyIndex,
      });
    }
  
    /// Wraps the statement in a named function to that it shows up as a unit in
    /// profiles.
    // TODO(sra): Should this be conditional?
  
negative.code:   /// Emits the section that installs tear-off getters.
    js.Statement emitInstallTearOffs(Fragment fragment,
        {bool softDeferred = false}) {
      var aliasForInstallStaticTearOff;
      var aliasForInstallInstanceTearOff;
  
      /// Emits the statement that installs a tear off for a method.
      ///
      /// Tear-offs might be passed to `Function.apply` which means that all
      /// calling-conventions (with or without optional positional/named
      /// arguments) are possible. As such, the tear-off needs enough information
      /// to fill in missing parameters.
      js.Statement emitInstallTearOff(
          js.Expression container, DartMethod method) {
        List<js.Name> callNames = [];
        List<js.Expression> funsOrNames = [];
  
        /// Adds the stub-method's code or name to the [funsOrNames] array.
        ///
        /// Static methods don't need stub-methods except for tear-offs. As such,
        /// they are not emitted in the prototype, but directly passed here.
        ///
        /// Instance-methods install the stub-methods in their prototype, and we
        /// use string-based redirections to find them there.
        void addFunOrName(StubMethod stubMethod) {
          if (method.isStatic) {
            funsOrNames.add(stubMethod.code);
          } else {
            funsOrNames.add(js.quoteName(stubMethod.name));
          }
        }
  
        callNames.add(method.callName);
        // The first entry in the funsOrNames-array must be a string.
        funsOrNames.add(js.quoteName(method.name));
        for (ParameterStubMethod stubMethod in method.parameterStubs) {
          callNames.add(stubMethod.callName);
          addFunOrName(stubMethod);
        }
  
        js.ArrayInitializer callNameArray =
            new js.ArrayInitializer(callNames.map(js.quoteName).toList());
        js.ArrayInitializer funsOrNamesArray =
            new js.ArrayInitializer(funsOrNames);
  
        bool isIntercepted = false;
        if (method is InstanceMethod) {
          isIntercepted = method.isIntercepted;
        }
  
        int requiredParameterCount = 0;
        js.Expression optionalParameterDefaultValues = new js.LiteralNull();
        if (method.canBeApplied) {
          requiredParameterCount = method.requiredParameterCount;
          optionalParameterDefaultValues =
              _encodeOptionalParameterDefaultValues(method);
        }
  
        var applyIndex = js.number(method.applyIndex);
  
        if (method.isStatic) {
          aliasForInstallStaticTearOff ??= '_static';
          return js.js.statement('''
              #install(#container, #getterName,
                       #requiredParameterCount, #optionalParameterDefaultValues,
                       #callNames, #funsOrNames, #funType, #applyIndex)''', {
            "install": aliasForInstallStaticTearOff,
            "container": container,
            "getterName": js.quoteName(method.tearOffName),
            "requiredParameterCount": js.number(requiredParameterCount),
            "optionalParameterDefaultValues": optionalParameterDefaultValues,
            "callNames": callNameArray,
            "funsOrNames": funsOrNamesArray,
            "funType": method.functionType,
            "applyIndex": applyIndex,
          });
        } else {
          aliasForInstallInstanceTearOff ??= '_instance';
          return js.js.statement('''
              #install(#container, #getterName, #isIntercepted,
                       #requiredParameterCount, #optionalParameterDefaultValues,
                       #callNames, #funsOrNames, #funType, #applyIndex)''', {
            "install": aliasForInstallInstanceTearOff,
            "container": container,
            "getterName": js.quoteName(method.tearOffName),
            // 'Truthy' values are ok for `isIntercepted`.
            "isIntercepted": js.number(isIntercepted ? 1 : 0),
            "requiredParameterCount": js.number(requiredParameterCount),
            "optionalParameterDefaultValues": optionalParameterDefaultValues,
            "callNames": callNameArray,
            "funsOrNames": funsOrNamesArray,
            "funType": method.functionType,
            "applyIndex": applyIndex,
          });
        }
      }
  
      List<js.Statement> inits = [];
      js.Expression temp;
  
  