Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Commit

Permalink
[vm/precomp] Fix name of vm:entry-point.
Browse files Browse the repository at this point in the history
Change-Id: I907e59a9df9407f924c0518a185d5b28ab46e381
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/69971
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
sjindel-google authored and commit-bot@chromium.org committed Aug 16, 2018
1 parent e4bd670 commit 5572df1
Show file tree
Hide file tree
Showing 68 changed files with 229 additions and 227 deletions.
7 changes: 5 additions & 2 deletions pkg/vm/lib/transformations/type_flow/native_code.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ abstract class EntryPointsListener {

enum PragmaEntryPointType { Always, GetterOnly, SetterOnly }

const kEntryPointPragmaName = "vm:entry-point";
const kNativeMethodPragmaName = "vm:native-method";

abstract class EntryPointsAnnotationMatcher {
PragmaEntryPointType annotationsDefineRoot(List<Expression> annotations);
}
Expand All @@ -47,7 +50,7 @@ class ConstantEntryPointsAnnotationMatcher
Constant name = constant.fieldValues[coreTypes.pragmaName.reference];
assertx(name != null);
if (name is! StringConstant ||
(name as StringConstant).value != "vm.entry-point") {
(name as StringConstant).value != kEntryPointPragmaName) {
return null;
}

Expand All @@ -63,7 +66,7 @@ class ConstantEntryPointsAnnotationMatcher
} else if (options.value == "set") {
return PragmaEntryPointType.SetterOnly;
} else {
throw "Error: string directive to @pragma('vm.entry-point', ...) must be either 'get' or 'set'.";
throw "Error: string directive to @pragma('$kEntryPointPragmaName', ...) must be either 'get' or 'set'.";
}
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ExpressionEntryPointsAnnotationMatcher
}

var argument = annotation.arguments.positional[0];
return argument is StringLiteral && argument.value == "vm.entry-point";
return argument is StringLiteral && argument.value == kEntryPointPragmaName;
}

@override
Expand Down
20 changes: 10 additions & 10 deletions runtime/bin/builtin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ void _print(arg) {
_printString(arg.toString());
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
_getPrintClosure() => _print;

// Asynchronous loading of resources.
// The embedder forwards loading requests to the service isolate.

// A port for communicating with the service isolate for I/O.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
SendPort _loadPort;

// The isolateId used to communicate with the service isolate for I/O.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
int _isolateId;

// Requests made to the service isolate over the load port.
Expand Down Expand Up @@ -140,7 +140,7 @@ _enforceTrailingSlash(uri) {

// Embedder Entrypoint:
// The embedder calls this method with the current working directory.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
void _setWorkingDirectory(String cwd) {
if (!_setupCompleted) {
_setupHooks();
Expand All @@ -156,7 +156,7 @@ void _setWorkingDirectory(String cwd) {

// Embedder Entrypoint:
// The embedder calls this method with a custom package root.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
String _setPackageRoot(String packageRoot) {
if (!_setupCompleted) {
_setupHooks();
Expand Down Expand Up @@ -187,7 +187,7 @@ String _setPackageRoot(String packageRoot) {
}

// Embedder Entrypoint:
@pragma("vm.entry-point")
@pragma("vm:entry-point")
String _setPackagesMap(String packagesParam) {
if (!_setupCompleted) {
_setupHooks();
Expand Down Expand Up @@ -219,7 +219,7 @@ String _setPackagesMap(String packagesParam) {

// Resolves the script uri in the current working directory iff the given uri
// did not specify a scheme (e.g. a path to a script file on the command line).
@pragma("vm.entry-point")
@pragma("vm:entry-point")
String _resolveScriptUri(String scriptName) {
if (_traceLoading) {
_log("Resolving script: $scriptName");
Expand Down Expand Up @@ -248,7 +248,7 @@ String _resolveScriptUri(String scriptName) {

// Embedder Entrypoint (gen_snapshot):
// Resolve relative paths relative to working directory.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
String _resolveInWorkingDirectory(String fileName) {
if (!_setupCompleted) {
_setupHooks();
Expand Down Expand Up @@ -305,7 +305,7 @@ String _filePathFromUri(String userUri) {
}

// Embedder Entrypoint.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
_libraryFilePath(String libraryUri) {
if (!_setupCompleted) {
_setupHooks();
Expand All @@ -321,7 +321,7 @@ _libraryFilePath(String libraryUri) {
}

// Register callbacks and hooks with the rest of the core libraries.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
_setupHooks() {
_setupCompleted = true;
VMLibraryHooks.resourceReadAsBytes = _resourceReadAsBytes;
Expand Down
2 changes: 1 addition & 1 deletion runtime/bin/common_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _IOCrypto {
static Uint8List getRandomBytes(int count) native "Crypto_GetRandomBytes";
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
_setupHooks() {
VMLibraryHooks.eventHandlerSendData = _EventHandler._sendData;
VMLibraryHooks.timerMillisecondClock = _EventHandler._timerMillisecondClock;
Expand Down
2 changes: 1 addition & 1 deletion runtime/bin/directory_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ Uri _uriBaseClosure() {
return new Uri.directory(result);
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
_getUriBaseClosure() => _uriBaseClosure;
2 changes: 1 addition & 1 deletion runtime/bin/file_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class _FSEventStreamFileSystemWatcher extends _FileSystemWatcher {
}
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
Uint8List _makeUint8ListView(Uint8List source, int offsetInBytes, int length) {
return new Uint8List.view(source.buffer, offsetInBytes, length);
}
2 changes: 1 addition & 1 deletion runtime/bin/namespace_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class _NamespaceImpl extends NativeFieldWrapperClass1 implements _Namespace {
@patch
class _Namespace {
@patch
@pragma("vm.entry-point")
@pragma("vm:entry-point")
static void _setupNamespace(var namespace) {
_NamespaceImpl._setupNamespace(namespace);
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/bin/platform_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _Platform {
static Uri _script() => VMLibraryHooks.platformScript;

// This script singleton is written to by the embedder if applicable.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
static void set _nativeScript(String path) {
VMLibraryHooks.platformScript = (() {
if (path.startsWith('http:') ||
Expand Down
9 changes: 4 additions & 5 deletions runtime/bin/process_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class _SignalController {
native "Process_ClearSignalHandler";
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
Function _getWatchSignalInternal() => _ProcessUtils._watchSignalInternal;

@patch
Expand Down Expand Up @@ -193,9 +193,9 @@ class ProcessInfo {
}

class _ProcessStartStatus {
@pragma("vm.entry-point", "set")
@pragma("vm:entry-point", "set")
int _errorCode; // Set to OS error code if process start failed.
@pragma("vm.entry-point", "set")
@pragma("vm:entry-point", "set")
String _errorMessage; // Set to OS error message if process start failed.
}

Expand Down Expand Up @@ -578,8 +578,7 @@ Future<ProcessResult> _runNonInteractiveProcess(
Encoding stdoutEncoding,
Encoding stderrEncoding) {
// Start the underlying process.
return Process
.start(path, arguments,
return Process.start(path, arguments,
workingDirectory: workingDirectory,
environment: environment,
includeParentEnvironment: includeParentEnvironment,
Expand Down
8 changes: 4 additions & 4 deletions runtime/bin/secure_socket_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class _SecureFilter {
@patch
class X509Certificate {
@patch
@pragma("vm.entry-point")
@pragma("vm:entry-point")
factory X509Certificate._() => new _X509CertificateImpl();
}

Expand Down Expand Up @@ -68,9 +68,9 @@ class _SecureFilterImpl extends NativeFieldWrapperClass1
// Performance is improved if a full buffer of plaintext fits
// in the encrypted buffer, when encrypted.
// SIZE and ENCRYPTED_SIZE are referenced from C++.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
static final int SIZE = 8 * 1024;
@pragma("vm.entry-point")
@pragma("vm:entry-point")
static final int ENCRYPTED_SIZE = 10 * 1024;

_SecureFilterImpl() {
Expand Down Expand Up @@ -120,7 +120,7 @@ class _SecureFilterImpl extends NativeFieldWrapperClass1
// This is a security issue, as it exposes a raw pointer to Dart code.
int _pointer() native "SecureSocket_FilterPointer";

@pragma("vm.entry-point", "get")
@pragma("vm:entry-point", "get")
List<_ExternalBuffer> buffers;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/bin/socket_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ class _RawDatagramSocket extends Stream<RawSocketEvent>
}
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
Datagram _makeDatagram(
List<int> data, String address, List<int> in_addr, int port) {
return new Datagram(data, new _InternetAddress(address, null, in_addr), port);
Expand Down
4 changes: 2 additions & 2 deletions runtime/bin/vmservice/loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ class FileRequest {
FileRequest(this.sp, this.tag, this.uri, this.resolvedUri, this.libraryUrl);
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
bool _traceLoading = false;
@pragma("vm.entry-point")
@pragma("vm:entry-point")
bool _deterministic = false;

// State associated with the isolate that is used for loading.
Expand Down
16 changes: 8 additions & 8 deletions runtime/bin/vmservice/vmservice_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ part 'loader.dart';
part 'server.dart';

// The TCP ip/port that the HTTP server listens on.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
int _port;
@pragma("vm.entry-point")
@pragma("vm:entry-point")
String _ip;
// Should the HTTP server auto start?
@pragma("vm.entry-point")
@pragma("vm:entry-point")
bool _autoStart;
// Should the HTTP server run in devmode?
@pragma("vm.entry-point")
@pragma("vm:entry-point")
bool _originCheckDisabled;
@pragma("vm.entry-point")
@pragma("vm:entry-point")
bool _isWindows = false;
@pragma("vm.entry-point")
@pragma("vm:entry-point")
bool _isFuchsia = false;
@pragma("vm.entry-point")
@pragma("vm:entry-point")
var _signalWatch;
var _signalSubscription;

Expand Down Expand Up @@ -227,7 +227,7 @@ _registerSignalHandler() {
_signalSubscription = _signalWatch(ProcessSignal.SIGQUIT).listen(_onSignal);
}

@pragma("vm.entry-point", !const bool.fromEnvironment("dart.vm.product"))
@pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
main() {
// Set embedder hooks.
VMServiceEmbedderHooks.cleanup = cleanupCallback;
Expand Down
4 changes: 2 additions & 2 deletions runtime/lib/array.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// part of "core_patch.dart";

@pragma("vm.entry-point")
@pragma("vm:entry-point")
class _List<E> extends FixedLengthListBase<E> {
factory _List(length) native "List_allocate";

Expand Down Expand Up @@ -122,7 +122,7 @@ class _List<E> extends FixedLengthListBase<E> {
// classes (and inline cache misses) versus a field in the native
// implementation (checks when modifying). We should keep watching
// the inline cache misses.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
class _ImmutableList<E> extends UnmodifiableListBase<E> {
factory _ImmutableList._uninstantiable() {
throw new UnsupportedError(
Expand Down
2 changes: 1 addition & 1 deletion runtime/lib/array_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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")
factory List._fromLiteral(List elements) {
if (elements.isEmpty) {
return new _GrowableList<E>(0);
Expand Down
10 changes: 5 additions & 5 deletions runtime/lib/async_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void _asyncStarListenHelper(var object, var awaiter) {
object._awaiter = awaiter;
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
void _asyncStarMoveNextHelper(var stream) {
if (stream is! _StreamImpl) {
return;
Expand All @@ -135,7 +135,7 @@ void _asyncStarMoveNextHelper(var stream) {

// _AsyncStarStreamController is used by the compiler to implement
// async* generator functions.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
class _AsyncStarStreamController<T> {
StreamController<T> controller;
Function asyncStarBody;
Expand Down Expand Up @@ -290,7 +290,7 @@ class _StreamImpl<T> {
Function _generator;
}

@pragma("vm.entry-point")
@pragma("vm:entry-point")
void _completeOnAsyncReturn(Completer completer, Object value) {
completer.complete(value);
}
Expand All @@ -300,11 +300,11 @@ void _completeOnAsyncReturn(Completer completer, Object value) {
Object _asyncStackTraceHelper(Function async_op)
native "StackTrace_asyncStackTraceHelper";

@pragma("vm.entry-point")
@pragma("vm:entry-point")
void _clearAsyncThreadStackTrace()
native "StackTrace_clearAsyncThreadStackTrace";

@pragma("vm.entry-point")
@pragma("vm:entry-point")
void _setAsyncThreadStackTrace(StackTrace stackTrace)
native "StackTrace_setAsyncThreadStackTrace";

Expand Down
2 changes: 1 addition & 1 deletion runtime/lib/bool_patch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// part of "core_patch.dart";

@patch
@pragma("vm.entry-point")
@pragma("vm:entry-point")
class bool {
@patch
const factory bool.fromEnvironment(String name, {bool defaultValue: false})
Expand Down
4 changes: 2 additions & 2 deletions runtime/lib/compact_hash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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")
void _rehashObjects(List objects) {
final int length = objects.length;
for (int i = 0; i < length; ++i) {
Expand Down Expand Up @@ -131,7 +131,7 @@ class _IdenticalAndIdentityHashCode {
}

// VM-internalized implementation of a default-constructed LinkedHashMap.
@pragma("vm.entry-point")
@pragma("vm:entry-point")
class _InternalLinkedHashMap<K, V> extends _HashVMBase
with
MapMixin<K, V>,
Expand Down
2 changes: 1 addition & 1 deletion runtime/lib/developer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ _registerExtension(String method, ServiceExtensionHandler handler)
native "Developer_registerExtension";

// This code is only invoked when there is no other Dart code on the stack.
@pragma("vm.entry-point", !const bool.fromEnvironment("dart.vm.product"))
@pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
_runExtension(
ServiceExtensionHandler handler,
String method,
Expand Down
2 changes: 1 addition & 1 deletion runtime/lib/double.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// part of "core_patch.dart";

@pragma("vm.entry-point")
@pragma("vm:entry-point")
class _Double implements double {
factory _Double.fromInteger(int value) native "Double_doubleFromInteger";

Expand Down
Loading

0 comments on commit 5572df1

Please sign in to comment.