[vm/aot] Remove unnecessary closurization of some entry-points.

Change-Id: Ie84529ef3d41d55c29c9a4bf2c84a69e3dbcaa0f
Reviewed-on: https://dart-review.googlesource.com/c/93429
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
This commit is contained in:
Samir Jindel 2019-02-20 10:44:21 +00:00 committed by commit-bot@chromium.org
parent c635896e1b
commit 8db489cb10
25 changed files with 47 additions and 47 deletions

View file

@ -55,7 +55,7 @@ class _IOCrypto {
static Uint8List getRandomBytes(int count) native "Crypto_GetRandomBytes";
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
_setupHooks() {
VMLibraryHooks.eventHandlerSendData = _EventHandler._sendData;
VMLibraryHooks.timerMillisecondClock = _EventHandler._timerMillisecondClock;

View file

@ -67,5 +67,5 @@ Uri _uriBaseClosure() {
return new Uri.directory(result);
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
_getUriBaseClosure() => _uriBaseClosure;

View file

@ -415,7 +415,7 @@ class _FSEventStreamFileSystemWatcher extends _FileSystemWatcher {
}
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) {
return new Uint8List.view(source.buffer, offsetInBytes, length);
}

View file

@ -35,7 +35,7 @@ class _NamespaceImpl extends NativeFieldWrapperClass1 implements _Namespace {
@pragma("vm:entry-point")
class _Namespace {
@patch
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static void _setupNamespace(var namespace) {
_NamespaceImpl._setupNamespace(namespace);
}

View file

@ -129,7 +129,7 @@ class _SignalController {
native "Process_ClearSignalHandler";
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
Function _getWatchSignalInternal() => _ProcessUtils._watchSignalInternal;
@patch

View file

@ -1971,7 +1971,7 @@ class _RawDatagramSocket extends Stream<RawSocketEvent>
void setRawOption(RawSocketOption option) => _socket.setRawOption(option);
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
Datagram _makeDatagram(
List<int> data, String address, List<int> in_addr, int port) {
return new Datagram(data, new _InternetAddress(address, null, in_addr), port);

View file

@ -65,7 +65,7 @@ class List<E> {
// Factory constructing a mutable List from a parser generated List literal.
// [elements] contains elements that are already type checked.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
factory List._fromLiteral(List elements) {
if (elements.isEmpty) {
return new _GrowableList<E>(0);

View file

@ -120,7 +120,7 @@ void _asyncStarListenHelper(var object, var awaiter) {
object._awaiter = awaiter;
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _asyncStarMoveNextHelper(var stream) {
if (stream is! _StreamImpl) {
return;
@ -289,7 +289,7 @@ class _StreamImpl<T> {
Function _generator;
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _completeOnAsyncReturn(Completer completer, Object value) {
completer.complete(value);
}
@ -299,11 +299,11 @@ void _completeOnAsyncReturn(Completer completer, Object value) {
Object _asyncStackTraceHelper(Function async_op)
native "StackTrace_asyncStackTraceHelper";
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _clearAsyncThreadStackTrace()
native "StackTrace_clearAsyncThreadStackTrace";
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _setAsyncThreadStackTrace(StackTrace stackTrace)
native "StackTrace_setAsyncThreadStackTrace";

View file

@ -6,7 +6,7 @@
@pragma("vm:entry-point")
class ClassID {
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
@pragma("vm:exact-result-type", "dart:core#_Smi")
static int getID(Object value) native "ClassID_getID";

View file

@ -8,7 +8,7 @@
// This function takes care of rehashing of the linked hashmaps in [objects]. We
// do this eagerly after snapshot deserialization.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _rehashObjects(List objects) {
final int length = objects.length;
for (int i = 0; i < length; ++i) {

View file

@ -31,7 +31,7 @@ class _AssertionError extends Error implements AssertionError {
// AssertionError_throwNew in errors.cc fishes the assertion source code
// out of the script. It expects a Dart stack frame from class
// _AssertionError. Thus we need a Dart stub that calls the native code.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static _throwNew(int assertionStart, int assertionEnd, Object message) {
_doThrowNew(assertionStart, assertionEnd, message);
}
@ -39,7 +39,7 @@ class _AssertionError extends Error implements AssertionError {
static _doThrowNew(int assertionStart, int assertionEnd, Object message)
native "AssertionError_throwNew";
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static _evaluateAssertion(condition) {
if (identical(condition, true) || identical(condition, false)) {
return condition;
@ -194,7 +194,7 @@ class NoSuchMethodError {
// The compiler emits a call to _throwNew when it cannot resolve a static
// method at compile time. The receiver is actually the literal class of the
// unresolved method.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static void _throwNew(Object receiver, String memberName, int invocation_type,
Object typeArguments, List arguments, List argumentNames) {
throw new NoSuchMethodError._withType(receiver, memberName, invocation_type,

View file

@ -7,9 +7,9 @@ import "dart:_internal" show patch;
DynamicLibrary _open(String name) native "Ffi_dl_open";
@patch
@pragma("vm:entry-point")
class DynamicLibrary {
@patch
@pragma("vm:entry-point")
factory DynamicLibrary.open(String name) {
return _open(name);
}

View file

@ -150,7 +150,7 @@ class _GrowableList<T> extends ListBase<T> {
void _setIndexed(int index, T value) native "GrowableList_setIndexed";
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void add(T value) {
var len = length;
if (len == _capacity) {

View file

@ -9,5 +9,5 @@
bool identical(Object a, Object b) native "Identical_comparison";
@patch
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
int identityHashCode(Object object) => object._identityHashCode;

View file

@ -68,7 +68,7 @@ final bool is64Bit = _inquireIs64Bit();
bool _inquireIs64Bit() native "Internal_inquireIs64Bit";
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
@pragma("vm:exact-result-type", bool)
bool _classRangeCheck(int cid, int lowerLimit, int upperLimit) {
return cid >= lowerLimit && cid <= upperLimit;
@ -99,13 +99,13 @@ class Lists {
// function type arguments (may be null). The result is null if both input
// vectors are null or is a newly allocated and canonicalized vector of length
// 'totalLen'.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
_prependTypeArguments(functionTypeArguments, parentTypeArguments, parentLen,
totalLen) native "Internal_prependTypeArguments";
// Check that a set of type arguments satisfy the type parameter bounds on a
// closure.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
_boundsCheckForPartialInstantiation(closure, typeArgs)
native "Internal_boundsCheckForPartialInstantiation";

View file

@ -176,7 +176,7 @@ class _InvocationMirror implements Invocation {
this._positionalArguments, this._namedArguments, this._isSuperInvocation,
[this._delayedTypeArgumentsLen = 0]);
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static _allocateInvocationMirror(String functionName,
List argumentsDescriptor, List arguments, bool isSuperInvocation,
[int type = null]) {
@ -189,7 +189,7 @@ class _InvocationMirror implements Invocation {
// indicate 0 type arguments, but the actual number of type arguments are
// passed in `delayedTypeArgumentsLen`. If any type arguments are available,
// the type arguments vector will be the first entry in `arguments`.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static _allocateInvocationMirrorForClosure(
String functionName,
List argumentsDescriptor,

View file

@ -107,7 +107,7 @@ void _isolateScheduleImmediate(void callback()) {
_pendingImmediateCallback = callback;
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _runPendingImmediateCallback() {
if (_pendingImmediateCallback != null) {
var callback = _pendingImmediateCallback;
@ -124,7 +124,7 @@ _ImmediateCallback _removePendingImmediateCallback() {
/// The embedder can execute this function to get hold of
/// [_isolateScheduleImmediate] above.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
Function _getIsolateScheduleImmediateClosure() {
return _isolateScheduleImmediate;
}
@ -156,14 +156,14 @@ class _RawReceivePortImpl implements RawReceivePort {
_get_sendport() native "RawReceivePortImpl_get_sendport";
// Called from the VM to retrieve the handler for a message.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static _lookupHandler(int id) {
var result = _handlerMap[id];
return result;
}
// Called from the VM to dispatch to the handler.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static void _handleMessage(Function handler, var message) {
// TODO(floitsch): this relies on the fact that any exception aborts the
// VM. Once we have non-fatal global exceptions we need to catch errors
@ -197,7 +197,7 @@ class _RawReceivePortImpl implements RawReceivePort {
@pragma("vm:entry-point")
class _SendPortImpl implements SendPort {
/*--- public interface ---*/
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void send(var message) {
_sendInternal(message);
}
@ -227,7 +227,7 @@ typedef _BinaryFunction(Null args, Null message);
* initial message. Defers execution of the entry point until the
* isolate is in the message loop.
*/
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _startMainIsolate(Function entryPoint, List<String> args) {
_startIsolate(
null, // no parent port
@ -245,7 +245,7 @@ void _startMainIsolate(Function entryPoint, List<String> args) {
* once support for @pragma("vm:entry_point", "get") as documented in
* https://github.com/dart-lang/sdk/issues/35720 lands.
*/
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
Function _getStartMainIsolateFunction() {
return _startMainIsolate;
}
@ -254,7 +254,7 @@ Function _getStartMainIsolateFunction() {
* Takes the real entry point as argument and invokes it with the initial
* message.
*/
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _startIsolate(
SendPort parentPort,
Function entryPoint,

View file

@ -47,7 +47,7 @@ class _LibraryPrefix {
var _outstandingLoadRequests = new List<List>();
// Called from the VM when an outstanding load request has finished.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
_completeDeferredLoads() {
// Determine which outstanding load requests have completed and complete
// their completer (with an error or true). For outstanding load requests

View file

@ -11,7 +11,7 @@ class Map<K, V> {
// The keys are at position 2*n and are already type checked by the parser
// in checked mode.
// The values are at position 2*n+1 and are not yet type checked.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
factory Map._fromLiteral(List elements) {
var map = new LinkedHashMap<K, V>();
var len = elements.length;

View file

@ -44,7 +44,7 @@ class Object {
static String _toString(obj) native "Object_toString";
@patch
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
dynamic noSuchMethod(Invocation invocation) {
// TODO(regis): Remove temp constructor identifier 'withInvocation'.
throw new NoSuchMethodError.withInvocation(this, invocation);
@ -54,21 +54,21 @@ class Object {
@pragma("vm:exact-result-type", "dart:core#_Type")
Type get runtimeType native "Object_runtimeType";
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
@pragma("vm:exact-result-type", bool)
static bool _haveSameRuntimeType(a, b) native "Object_haveSameRuntimeType";
// Call this function instead of inlining instanceof, thus collecting
// type feedback and reducing code size of unoptimized code.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
bool _instanceOf(instantiatorTypeArguments, functionTypeArguments, type)
native "Object_instanceOf";
// Group of functions for implementing fast simple instance of.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
bool _simpleInstanceOf(type) native "Object_simpleInstanceOf";
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
bool _simpleInstanceOfTrue(type) => true;
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
bool _simpleInstanceOfFalse(type) => false;
}

View file

@ -21,12 +21,12 @@ class _ScheduleImmediate {
static _ScheduleImmediateClosure _closure;
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _setScheduleImmediateClosure(_ScheduleImmediateClosure closure) {
_ScheduleImmediate._closure = closure;
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
void _ensureScheduleImmediate() {
_AsyncRun._scheduleImmediate(_startMicrotaskLoop);
}

View file

@ -811,7 +811,7 @@ abstract class _StringBase implements String {
}
// Convert single object to string.
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static String _interpolateSingle(Object o) {
if (o is String) return o;
final s = o.toString();
@ -826,7 +826,7 @@ abstract class _StringBase implements String {
* into a result string.
* Modifies the input list if it contains non-`String` values.
*/
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
static String _interpolate(final List values) {
final numValues = values.length;
int totalLength = 0;

View file

@ -462,7 +462,7 @@ class _Timer implements Timer {
}
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
_setupHooks() {
VMLibraryHooks.timerFactory = _Timer._factory;
}

View file

@ -394,7 +394,7 @@ int _stdinFD = 0;
int _stdoutFD = 1;
int _stderrFD = 2;
@pragma('vm:entry-point')
@pragma('vm:entry-point', 'call')
void _setStdioFDs(int stdin, int stdout, int stderr) {
_stdinFD = stdin;
_stdoutFD = stdout;

View file

@ -702,7 +702,7 @@ class VMService extends MessageRouter {
}
}
@pragma("vm:entry-point")
@pragma("vm:entry-point", "call")
RawReceivePort boot() {
// Return the port we expect isolate control messages on.
return isolateControlPort;