Allow embedders to get a closurized _startMainIsolate function.

Change-Id: Ib4b2654c60c02f137832e3898fd38b724c4e4dbc
Reviewed-on: https://dart-review.googlesource.com/c/90582
Commit-Queue: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index 972d9af..a9a6a41 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -240,6 +240,17 @@
 }
 
 /**
+ * Returns the _startMainIsolate function. This closurization allows embedders
+ * to setup trampolines to the main function. This workaround can be removed
+ * once support for @pragma("vm:entry_point", "get") as documented in
+ * https://github.com/dart-lang/sdk/issues/35720 lands.
+ */
+@pragma("vm:entry-point")
+Function _getStartMainIsolateFunction() {
+  return _startMainIsolate;
+}
+
+/**
  * Takes the real entry point as argument and invokes it with the initial
  * message.
  */