diff --git a/pkg/dart2js_info/pubspec.yaml b/pkg/dart2js_info/pubspec.yaml
index 04e3c7b..68bab56 100644
--- a/pkg/dart2js_info/pubspec.yaml
+++ b/pkg/dart2js_info/pubspec.yaml
@@ -20,6 +20,7 @@
 
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
+  expect: any
   lints: any
   test: any
 
diff --git a/pkg/dart2js_info/test/classes/class_filter.txt b/pkg/dart2js_info/test/classes/class_filter.txt
new file mode 100644
index 0000000..aa011aa
--- /dev/null
+++ b/pkg/dart2js_info/test/classes/class_filter.txt
@@ -0,0 +1,5 @@
+dart:_rti - _Universe
+dart:core - Error
+testroot:classes.dart - Subsub1
+testroot:classes.dart - Super
+package:expect/expect.dart - Expect
diff --git a/pkg/dart2js_info/test/classes/classes.dart b/pkg/dart2js_info/test/classes/classes.dart
new file mode 100644
index 0000000..d7b49e0
--- /dev/null
+++ b/pkg/dart2js_info/test/classes/classes.dart
@@ -0,0 +1,45 @@
+import 'package:expect/expect.dart';
+
+class Super<T> {
+  void method(T t) {
+    print(t.runtimeType);
+  }
+}
+
+class Mixin {
+  void method(int t) {
+    print(t + 1);
+  }
+}
+
+class Clazz = Super<int> with Mixin;
+
+class Subclass extends Clazz {
+  void test() {
+    void Function(int) f = super.method;
+    f(42);
+    print(f);
+  }
+}
+
+class Subsub1 extends Subclass {
+  void a(dynamic x) {
+    print(x);
+  }
+}
+
+class Subsub2 extends Subclass {
+  void a(dynamic x) {
+    print(x);
+    print(x);
+  }
+}
+
+main() {
+  Super<Object> s = Subclass()..test();
+  Expect.throws(() => s.method(''));
+  dynamic x = Subsub1();
+  x.a(x);
+  x = Subsub2();
+  x.a(x);
+}
diff --git a/pkg/dart2js_info/test/classes/classes.js.info.data b/pkg/dart2js_info/test/classes/classes.js.info.data
new file mode 100644
index 0000000..cc738e1
--- /dev/null
+++ b/pkg/dart2js_info/test/classes/classes.js.info.data
Binary files differ
diff --git a/pkg/dart2js_info/test/runtime_coverage_test.dart b/pkg/dart2js_info/test/runtime_coverage_test.dart
new file mode 100644
index 0000000..9d5d048
--- /dev/null
+++ b/pkg/dart2js_info/test/runtime_coverage_test.dart
@@ -0,0 +1,81 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests for dart2js_info's runtime_coverage command.
+//
+// Regenerate files with dart2js flags:
+// --multi-root-scheme='testroot'
+// --multi-root='$PATH_TO_TEST_ROOT'
+// --entry-uri='testroot:$TEST_FILE.dart'
+// --dump-info=binary
+// --packages=$PATH_TO_SDK/.dart_tool/package_config.json
+
+import 'dart:io';
+
+import 'package:dart2js_info/binary_serialization.dart';
+import 'package:dart2js_info/src/util.dart';
+import 'package:test/test.dart';
+
+import '../bin/src/runtime_coverage_analysis.dart';
+
+void main() {
+  group('runtime coverage', () {
+    group('class filter (angular info)', () {
+      final infoBinaryFile =
+          File.fromUri(Platform.script.resolve('classes/classes.js.info.data'));
+      final allInfo = decode(infoBinaryFile.readAsBytesSync());
+      final classFilters =
+          File.fromUri(Platform.script.resolve('classes/class_filter.txt'))
+              .readAsLinesSync();
+      final runtimeClassInfos = <String, RuntimeClassInfo>{};
+
+      setUp(() {
+        runtimeClassInfos.clear();
+      });
+
+      test('class filters are formatted properly', () {
+        for (final filterString in classFilters) {
+          expect(filterString.contains(' - '), isTrue);
+        }
+      });
+
+      test('AngularInfo conversions throws on invalid schemes', () {
+        expect(
+            () => RuntimeClassInfo.fromAngularInfo(
+                'no/scheme/here.dart - ClassName'),
+            throwsArgumentError);
+        expect(
+            () => RuntimeClassInfo.fromAngularInfo('noscheme.dart - ClassName'),
+            throwsArgumentError);
+      });
+
+      test('class filters parse and annotate properly', () {
+        // Process class filters.
+        for (final filterString in classFilters) {
+          final runtimeClassInfo =
+              RuntimeClassInfo.fromAngularInfo(filterString);
+          expect(runtimeClassInfo.annotated, isFalse);
+          runtimeClassInfos[runtimeClassInfo.key] = runtimeClassInfo;
+        }
+
+        // Annotate class filters with their corresponding ClassInfo.
+        for (final classInfo in allInfo.classes) {
+          final name = qualifiedName(classInfo);
+          final nameWithoutScheme =
+              name.substring(name.indexOf(':') + 1, name.length);
+          final runtimeClassInfo = runtimeClassInfos[nameWithoutScheme];
+          if (runtimeClassInfo != null) {
+            runtimeClassInfo.annotateWithClassInfo(classInfo);
+            expect(runtimeClassInfos[runtimeClassInfo.key], isNotNull);
+          }
+        }
+
+        // Check that all class info objects are annotated.
+        for (final runtimeClassInfo in runtimeClassInfos.values) {
+          expect(runtimeClassInfo.annotated, isTrue);
+        }
+      });
+    });
+  });
+}
diff --git a/pkg/dart2wasm/bin/run_wasm.js b/pkg/dart2wasm/bin/run_wasm.js
index 0078a7b..a0673a0 100644
--- a/pkg/dart2wasm/bin/run_wasm.js
+++ b/pkg/dart2wasm/bin/run_wasm.js
@@ -163,6 +163,19 @@
         var factoryFunction = constructor.bind.apply(constructor, [null, ...args]);
         return new factoryFunction();
     },
+    getTimeZoneNameForSeconds: function(secondsSinceEpoch) {
+        var date = new Date(secondsSinceEpoch * 1000);
+        var match = /\((.*)\)/.exec(date.toString());
+        if (match == null) {
+            // This should never happen on any recent browser.
+            return '';
+        }
+        return stringToDartString(match[1]);
+
+    },
+    getTimeZoneOffsetInSeconds: function(secondsSinceEpoch) {
+        return new Date(secondsSinceEpoch * 1000).getTimezoneOffset() * 60;
+    },
 };
 
 function instantiate(filename, imports) {
diff --git a/sdk/lib/_internal/js_shared/lib/js_util_patch.dart b/sdk/lib/_internal/js_shared/lib/js_util_patch.dart
index f67886e..139f411 100644
--- a/sdk/lib/_internal/js_shared/lib/js_util_patch.dart
+++ b/sdk/lib/_internal/js_shared/lib/js_util_patch.dart
@@ -374,14 +374,55 @@
 @patch
 List<Object?> objectKeys(Object? object) => JS('', 'Object.keys(#)', object);
 
+// TODO(joshualitt): Move these `is` checks to a helper library to help
+// declutter this patch file.
+bool _isJavaScriptDate(value) => JS('bool', '# instanceof Date', value);
+bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value);
+
+@patch
+bool isJavaScriptArray(value) => JS('bool', '# instanceof Array', value);
+
+// Although it may be tempting to try and rewrite [isJavaScriptSimpleObject]
+// using `js_util` calls, it turns out this can be fragile on some browsers
+// under some situations.
+@patch
+bool isJavaScriptSimpleObject(value) {
+  var proto = JS('', 'Object.getPrototypeOf(#)', value);
+  return JS('bool', '# === Object.prototype', proto) ||
+      JS('bool', '# === null', proto);
+}
+
+bool _isJavaScriptPromise(value) =>
+    JS('bool', r'typeof Promise != "undefined" && # instanceof Promise', value);
+
+DateTime _dateToDateTime(date) {
+  int millisSinceEpoch = JS('int', '#.getTime()', date);
+  return new DateTime.fromMillisecondsSinceEpoch(millisSinceEpoch, isUtc: true);
+}
+
 @patch
 Object? dartify(Object? o) {
   var _convertedObjects = HashMap.identity();
-  Object? convert() {
+  Object? convert(Object? o) {
     if (_convertedObjects.containsKey(o)) {
       return _convertedObjects[o];
     }
     if (o == null || o is bool || o is num || o is String) return o;
+
+    if (_isJavaScriptDate(o)) {
+      return _dateToDateTime(o);
+    }
+
+    if (_isJavaScriptRegExp(o)) {
+      // TODO(joshualitt): Consider investigating if there is a way to convert
+      // from `JSRegExp` to `RegExp`.
+      throw new ArgumentError('structured clone of RegExp');
+    }
+
+    if (_isJavaScriptPromise(o)) {
+      return promiseToFuture(o);
+    }
+
     if (isJavaScriptSimpleObject(o)) {
       Map<Object?, Object?> dartObject = {};
       _convertedObjects[o] = dartObject;
@@ -394,23 +435,27 @@
         Object? jsKey = originalKeys[i];
         Object? dartKey = dartKeys[i];
         if (jsKey != null) {
-          dartObject[dartKey] = dartify(getProperty(o, jsKey));
+          dartObject[dartKey] = convert(getProperty(o, jsKey));
         }
       }
       return dartObject;
     }
+
     if (isJavaScriptArray(o)) {
+      var l = JS<List>('returns:List;creates:;', '#', o);
       List<Object?> dartObject = [];
       _convertedObjects[o] = dartObject;
       int length = getProperty(o, 'length');
       for (int i = 0; i < length; i++) {
-        dartObject.add(dartify(getProperty(o, i)));
+        dartObject.add(convert(l[i]));
       }
       return dartObject;
     }
-    throw ArgumentError(
-        "JavaScriptObject $o must be a primitive, simple object, or array");
+
+    // Assume anything else is already a valid Dart object, either by having
+    // already been processed, or e.g. a cloneable native class.
+    return o;
   }
 
-  return convert();
+  return convert(o);
 }
diff --git a/sdk/lib/_internal/wasm/lib/date_patch.dart b/sdk/lib/_internal/wasm/lib/date_patch.dart
index 9b31078..72f91011 100644
--- a/sdk/lib/_internal/wasm/lib/date_patch.dart
+++ b/sdk/lib/_internal/wasm/lib/date_patch.dart
@@ -17,16 +17,19 @@
 class DateTime {
   // Natives.
   // The natives have been moved up here to work around Issue 10401.
-  @pragma("vm:external-name", "DateTime_currentTimeMicros")
   static int _getCurrentMicros() =>
       (_jsDateNow() * Duration.microsecondsPerMillisecond).toInt();
 
-  @pragma("vm:external-name", "DateTime_timeZoneName")
-  external static String _timeZoneNameForClampedSeconds(int secondsSinceEpoch);
+  @pragma("wasm:import", "dart2wasm.getTimeZoneNameForSeconds")
+  external static String _timeZoneNameForClampedSecondsRaw(
+      double secondsSinceEpoch);
 
-  @pragma("vm:external-name", "DateTime_timeZoneOffsetInSeconds")
-  external static int _timeZoneOffsetInSecondsForClampedSeconds(
-      int secondsSinceEpoch);
+  static String _timeZoneNameForClampedSeconds(int secondsSinceEpoch) =>
+      _timeZoneNameForClampedSecondsRaw(secondsSinceEpoch.toDouble());
+
+  @pragma("wasm:import", "dart2wasm.getTimeZoneOffsetInSeconds")
+  external static double _timeZoneOffsetInSecondsForClampedSeconds(
+      double secondsSinceEpoch);
 
   static const _MICROSECOND_INDEX = 0;
   static const _MILLISECOND_INDEX = 1;
@@ -424,7 +427,9 @@
 
   static int _timeZoneOffsetInSeconds(int microsecondsSinceEpoch) {
     int equivalentSeconds = _equivalentSeconds(microsecondsSinceEpoch);
-    return _timeZoneOffsetInSecondsForClampedSeconds(equivalentSeconds);
+    return _timeZoneOffsetInSecondsForClampedSeconds(
+            equivalentSeconds.toDouble())
+        .toInt();
   }
 
   static String _timeZoneName(int microsecondsSinceEpoch) {
diff --git a/sdk/lib/_internal/wasm/lib/stopwatch_patch.dart b/sdk/lib/_internal/wasm/lib/stopwatch_patch.dart
new file mode 100644
index 0000000..b20f9eb
--- /dev/null
+++ b/sdk/lib/_internal/wasm/lib/stopwatch_patch.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// part of "core_patch.dart";
+
+@pragma("wasm:import", "performance.now")
+external double _performanceNow();
+
+@patch
+class Stopwatch {
+  @patch
+  static int _initTicker() {
+    return 1000;
+  }
+
+  @patch
+  static int _now() => _performanceNow().toInt();
+
+  @patch
+  int get elapsedMicroseconds => 1000 * elapsedTicks;
+
+  @patch
+  int get elapsedMilliseconds => elapsedTicks;
+}
diff --git a/sdk/lib/js_util/js_util.dart b/sdk/lib/js_util/js_util.dart
index 301f486..e47e6eb 100644
--- a/sdk/lib/js_util/js_util.dart
+++ b/sdk/lib/js_util/js_util.dart
@@ -150,13 +150,10 @@
 external List<Object?> objectKeys(Object? object);
 
 /// Returns `true` if a given object is a JavaScript array.
-bool isJavaScriptArray(value) => instanceOfString(value, 'Array');
+external bool isJavaScriptArray(value);
 
 /// Returns `true` if a given object is a simple JavaScript object.
-bool isJavaScriptSimpleObject(value) {
-  final Object? proto = objectGetPrototypeOf(value);
-  return proto == null || proto == objectPrototype;
-}
+external bool isJavaScriptSimpleObject(value);
 
 /// Effectively the inverse of [jsify], [dartify] Takes a JavaScript object, and
 /// converts it to a Dart based object. Only JS primitives, arrays, or 'map'
diff --git a/sdk/lib/libraries.json b/sdk/lib/libraries.json
index 5107be5..1ae9fe5 100644
--- a/sdk/lib/libraries.json
+++ b/sdk/lib/libraries.json
@@ -212,6 +212,7 @@
           "_internal/vm/lib/map_patch.dart",
           "_internal/wasm/lib/object_patch.dart",
           "_internal/wasm/lib/stack_trace_patch.dart",
+          "_internal/wasm/lib/stopwatch_patch.dart",
           "_internal/wasm/lib/string_buffer_patch.dart",
           "_internal/wasm/lib/string_patch.dart",
           "_internal/wasm/lib/type.dart"
diff --git a/sdk/lib/libraries.yaml b/sdk/lib/libraries.yaml
index f9f859e..ced8e76 100644
--- a/sdk/lib/libraries.yaml
+++ b/sdk/lib/libraries.yaml
@@ -202,6 +202,7 @@
       - _internal/vm/lib/map_patch.dart
       - _internal/wasm/lib/object_patch.dart
       - _internal/wasm/lib/stack_trace_patch.dart
+      - _internal/wasm/lib/stopwatch_patch.dart
       - _internal/wasm/lib/string_buffer_patch.dart
       - _internal/wasm/lib/string_patch.dart
       - _internal/wasm/lib/type.dart
diff --git a/tests/lib/js/js_util/dartify_test.dart b/tests/lib/js/js_util/dartify_test.dart
index 9fef877..2d9d08d 100644
--- a/tests/lib/js/js_util/dartify_test.dart
+++ b/tests/lib/js/js_util/dartify_test.dart
@@ -30,7 +30,15 @@
     };
     globalThis.recObjectData = {};
     globalThis.recObjectData = {'foo': globalThis.recObjectData}
-    globalThis.throwData = function() {};
+    globalThis.throwData = new RegExp();
+    globalThis.complexData = {
+      'a': new Date(0),
+      'b': new Promise((resolve, reject) => {}),
+    };
+    globalThis.complexList = [
+      new Date(0),
+      new Promise((resolve, reject) => {}),
+    ];
     """);
 
   test('convert an array', () {
@@ -79,7 +87,22 @@
     Expect.deepEquals(expectedValues, dartObject);
   });
 
-  test('throws if object is not an object literal or array', () {
+  test('complex types convert in an Object', () {
+    Object? jsObject = js_util.getProperty(js_util.globalThis, 'complexData');
+    Map<Object?, Object?> dartObject =
+        js_util.dartify(jsObject) as Map<Object?, Object?>;
+    Expect.isTrue(dartObject['a']! is DateTime);
+    Expect.isTrue(dartObject['b']! is Future);
+  });
+
+  test('complex types convert in a List', () {
+    Object? jsArray = js_util.getProperty(js_util.globalThis, 'complexList');
+    List<Object?> dartList = js_util.dartify(jsArray) as List<Object?>;
+    Expect.isTrue(dartList[0] is DateTime);
+    Expect.isTrue(dartList[1] is Future);
+  });
+
+  test('throws if object is a regexp', () {
     expect(
         () => js_util
             .dartify(js_util.getProperty(js_util.globalThis, 'throwData')),
diff --git a/tests/lib_2/js/js_util/dartify_test.dart b/tests/lib_2/js/js_util/dartify_test.dart
index 9fef877..4019af8 100644
--- a/tests/lib_2/js/js_util/dartify_test.dart
+++ b/tests/lib_2/js/js_util/dartify_test.dart
@@ -2,6 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// @dart = 2.9
+
 // Tests the dartify functionality of the js_util library.
 
 @JS()
@@ -30,13 +32,21 @@
     };
     globalThis.recObjectData = {};
     globalThis.recObjectData = {'foo': globalThis.recObjectData}
-    globalThis.throwData = function() {};
+    globalThis.throwData = new RegExp();
+    globalThis.complexData = {
+      'a': new Date(0),
+      'b': new Promise((resolve, reject) => {}),
+    };
+    globalThis.complexList = [
+      new Date(0),
+      new Promise((resolve, reject) => {}),
+    ];
     """);
 
   test('convert an array', () {
-    Object? jsArray = js_util.getProperty(js_util.globalThis, 'arrayData');
-    Object? dartArray = js_util.dartify(jsArray);
-    List<Object?> expectedValues = [
+    Object jsArray = js_util.getProperty(js_util.globalThis, 'arrayData');
+    Object dartArray = js_util.dartify(jsArray);
+    List<Object> expectedValues = [
       1,
       2,
       false,
@@ -50,16 +60,16 @@
   });
 
   test('convert a recursive array', () {
-    Object? jsArray = js_util.getProperty(js_util.globalThis, 'recArrayData');
-    Object? dartArray = js_util.dartify(jsArray);
-    List<Object?> expectedValues = [[]];
+    Object jsArray = js_util.getProperty(js_util.globalThis, 'recArrayData');
+    Object dartArray = js_util.dartify(jsArray);
+    List<Object> expectedValues = [[]];
     Expect.deepEquals(expectedValues, dartArray);
   });
 
   test('convert an object literal', () {
-    Object? jsObject = js_util.getProperty(js_util.globalThis, 'objectData');
-    Object? dartObject = js_util.dartify(jsObject);
-    Map<Object?, Object?> expectedValues = {
+    Object jsObject = js_util.getProperty(js_util.globalThis, 'objectData');
+    Object dartObject = js_util.dartify(jsObject);
+    Map<Object, Object> expectedValues = {
       'a': 1,
       'b': [1, 2, 3],
       'c': {
@@ -71,15 +81,31 @@
   });
 
   test('convert a recursive object literal', () {
-    Object? jsObject = js_util.getProperty(js_util.globalThis, 'recObjectData');
-    Object? dartObject = js_util.dartify(jsObject);
-    Map<Object?, Object?> expectedValues = {
+    Object jsObject = js_util.getProperty(js_util.globalThis, 'recObjectData');
+    Object dartObject = js_util.dartify(jsObject);
+    Map<Object, Object> expectedValues = {
       'foo': {},
     };
     Expect.deepEquals(expectedValues, dartObject);
   });
 
-  test('throws if object is not an object literal or array', () {
+  test('complex types convert in an Object', () {
+    Object jsObject = js_util.getProperty(js_util.globalThis, 'complexData');
+    Map<Object, Object> dartObject =
+        js_util.dartify(jsObject) as Map<Object, Object>;
+    print(dartObject);
+    Expect.isTrue(dartObject['a'] is DateTime);
+    Expect.isTrue(dartObject['b'] is Future);
+  });
+
+  test('complex types convert in a List', () {
+    Object jsArray = js_util.getProperty(js_util.globalThis, 'complexList');
+    List<Object> dartList = js_util.dartify(jsArray) as List<Object>;
+    Expect.isTrue(dartList[0] is DateTime);
+    Expect.isTrue(dartList[1] is Future);
+  });
+
+  test('throws if object is a regexp', () {
     expect(
         () => js_util
             .dartify(js_util.getProperty(js_util.globalThis, 'throwData')),
diff --git a/tools/VERSION b/tools/VERSION
index 6112c90..067fcd7 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 19
 PATCH 0
-PRERELEASE 37
+PRERELEASE 38
 PRERELEASE_PATCH 0
\ No newline at end of file
