Skip to content

Commit 9e315e6

Browse files
Remove entries from dart_vm_entry_points.txt and use annotations (flutter#6226)
The `dart_vm_entry_points.txt` file is now deprecated in favor of annotations. Support for parsing and generating the entry-points files will be removed from Dart shortly.
1 parent cdbe214 commit 9e315e6

File tree

8 files changed

+40
-47
lines changed

8 files changed

+40
-47
lines changed

lib/ui/compositing.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Scene extends NativeFieldWrapperClass2 {
1515
/// or extended directly.
1616
///
1717
/// To create a Scene object, use a [SceneBuilder].
18+
@pragma('vm:entry-point')
1819
Scene._();
1920

2021

@@ -45,6 +46,7 @@ class Scene extends NativeFieldWrapperClass2 {
4546
/// it to the scene using [addPicture].
4647
class SceneBuilder extends NativeFieldWrapperClass2 {
4748
/// Creates an empty [SceneBuilder] object.
49+
@pragma('vm:entry-point')
4850
SceneBuilder() { _constructor(); }
4951
void _constructor() native 'SceneBuilder_constructor';
5052

lib/ui/geometry.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ class Rect {
589589
Rect._();
590590

591591
/// Construct a rectangle from its left, top, right, and bottom edges.
592+
@pragma('vm:entry-point')
592593
Rect.fromLTRB(double left, double top, double right, double bottom) {
593594
_value
594595
..[0] = left

lib/ui/hooks.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dynamic _decodeJSON(String message) {
1212
return message != null ? json.decode(message) : null;
1313
}
1414

15+
@pragma('vm:entry-point')
1516
void _updateWindowMetrics(double devicePixelRatio,
1617
double width,
1718
double height,
@@ -43,13 +44,16 @@ typedef _LocaleClosure = String Function();
4344

4445
String _localeClosure() => window._locale.toString();
4546

47+
@pragma('vm:entry-point')
4648
_LocaleClosure _getLocaleClosure() => _localeClosure;
4749

50+
@pragma('vm:entry-point')
4851
void _updateLocale(String languageCode, String countryCode) {
4952
window._locale = new Locale(languageCode, countryCode);
5053
_invoke(window.onLocaleChanged, window._onLocaleChangedZone);
5154
}
5255

56+
@pragma('vm:entry-point')
5357
void _updateUserSettingsData(String jsonData) {
5458
final Map<String, dynamic> data = json.decode(jsonData);
5559
_updateTextScaleFactor(data['textScaleFactor'].toDouble());
@@ -65,11 +69,13 @@ void _updateAlwaysUse24HourFormat(bool alwaysUse24HourFormat) {
6569
window._alwaysUse24HourFormat = alwaysUse24HourFormat;
6670
}
6771

72+
@pragma('vm:entry-point')
6873
void _updateSemanticsEnabled(bool enabled) {
6974
window._semanticsEnabled = enabled;
7075
_invoke(window.onSemanticsEnabledChanged, window._onSemanticsEnabledChangedZone);
7176
}
7277

78+
@pragma('vm:entry-point')
7379
void _updateAccessibilityFeatures(int values) {
7480
final AccessibilityFeatures newFeatures = new AccessibilityFeatures._(values);
7581
if (newFeatures == window._accessibilityFeatures)
@@ -78,6 +84,7 @@ void _updateAccessibilityFeatures(int values) {
7884
_invoke(window.onAccessibilityFeaturesChanged, window._onAccessibilityFlagsChangedZone);
7985
}
8086

87+
@pragma('vm:entry-point')
8188
void _dispatchPlatformMessage(String name, ByteData data, int responseId) {
8289
if (window.onPlatformMessage != null) {
8390
_invoke3<String, ByteData, PlatformMessageResponseCallback>(
@@ -94,11 +101,13 @@ void _dispatchPlatformMessage(String name, ByteData data, int responseId) {
94101
}
95102
}
96103

104+
@pragma('vm:entry-point')
97105
void _dispatchPointerDataPacket(ByteData packet) {
98106
if (window.onPointerDataPacket != null)
99107
_invoke1<PointerDataPacket>(window.onPointerDataPacket, window._onPointerDataPacketZone, _unpackPointerDataPacket(packet));
100108
}
101109

110+
@pragma('vm:entry-point')
102111
void _dispatchSemanticsAction(int id, int action, ByteData args) {
103112
_invoke3<int, SemanticsAction, ByteData>(
104113
window.onSemanticsAction,
@@ -109,10 +118,12 @@ void _dispatchSemanticsAction(int id, int action, ByteData args) {
109118
);
110119
}
111120

121+
@pragma('vm:entry-point')
112122
void _beginFrame(int microseconds) {
113123
_invoke1<Duration>(window.onBeginFrame, window._onBeginFrameZone, new Duration(microseconds: microseconds));
114124
}
115125

126+
@pragma('vm:entry-point')
116127
void _drawFrame() {
117128
_invoke(window.onDrawFrame, window._onDrawFrameZone);
118129
}

lib/ui/natives.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Future<developer.ServiceExtensionResponse> _scheduleFrame(
2727
}));
2828
}
2929

30+
@pragma('vm:entry-point')
3031
void _setupHooks() {
3132
assert(() {
3233
// In debug mode, register the schedule frame extension.
@@ -54,12 +55,15 @@ Function _getCallbackFromHandle(int handle) native 'GetCallbackFromHandle';
5455
// Required for gen_snapshot to work correctly.
5556
int _isolateId;
5657

58+
@pragma('vm:entry-point')
5759
Function _getPrintClosure() => _print;
60+
@pragma('vm:entry-point')
5861
Function _getScheduleMicrotaskClosure() => _scheduleMicrotask;
5962

6063
// Though the "main" symbol is not included in any of the libraries imported
6164
// above, the builtin library will be included manually during VM setup. This
6265
// symbol is only necessary for precompilation. It is marked as a stanalone
6366
// entry point into the VM. This prevents the precompiler from tree shaking
6467
// away "main".
68+
@pragma('vm:entry-point')
6569
Function _getMainClosure() => main;

lib/ui/painting.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class Color {
102102
/// For example, to get a fully opaque orange, you would use `const
103103
/// Color(0xFFFF9000)` (`FF` for the alpha, `FF` for the red, `90` for the
104104
/// green, and `00` for the blue).
105+
@pragma('vm:entry-point')
105106
const Color(int value) : value = value & 0xFFFFFFFF;
106107

107108
/// Construct a color from the lower 8 bits of four integers.
@@ -1485,9 +1486,14 @@ class _ImageInfo {
14851486
_ImageInfo(this.width, this.height, this.format, this.rowBytes) {
14861487
rowBytes ??= width * 4;
14871488
}
1489+
1490+
@pragma('vm:entry-point', 'get')
14881491
int width;
1492+
@pragma('vm:entry-point', 'get')
14891493
int height;
1494+
@pragma('vm:entry-point', 'get')
14901495
int format;
1496+
@pragma('vm:entry-point', 'get')
14911497
int rowBytes;
14921498
}
14931499

@@ -1502,6 +1508,7 @@ class Image extends NativeFieldWrapperClass2 {
15021508
/// or extended directly.
15031509
///
15041510
/// To obtain an [Image] object, use [instantiateImageCodec].
1511+
@pragma('vm:entry-point')
15051512
Image._();
15061513

15071514
/// The number of image pixels along the image's horizontal axis.
@@ -1549,6 +1556,7 @@ class FrameInfo extends NativeFieldWrapperClass2 {
15491556
///
15501557
/// To obtain an instance of the [FrameInfo] interface, see
15511558
/// [Codec.getNextFrame].
1559+
@pragma('vm:entry-point')
15521560
FrameInfo._();
15531561

15541562
/// The duration this frame should be shown.
@@ -1566,6 +1574,7 @@ class Codec extends NativeFieldWrapperClass2 {
15661574
///
15671575
/// To obtain an instance of the [Codec] interface, see
15681576
/// [instantiateImageCodec].
1577+
@pragma('vm:entry-point')
15691578
Codec._();
15701579

15711580
/// Number of frames in this image.
@@ -1752,6 +1761,7 @@ enum PathOperation {
17521761
/// used to create clip regions using [Canvas.clipPath].
17531762
class Path extends NativeFieldWrapperClass2 {
17541763
/// Create a new empty [Path] object.
1764+
@pragma('vm:entry-point')
17551765
Path() { _constructor(); }
17561766
void _constructor() native 'Path_constructor';
17571767

@@ -2401,6 +2411,7 @@ class ImageFilter extends NativeFieldWrapperClass2 {
24012411
class Shader extends NativeFieldWrapperClass2 {
24022412
/// This class is created by the engine, and should not be instantiated
24032413
/// or extended directly.
2414+
@pragma('vm:entry-point')
24042415
Shader._();
24052416
}
24062417

@@ -2664,6 +2675,7 @@ class ImageShader extends Shader {
26642675
/// direction and y direction respectively. The fourth argument gives the
26652676
/// matrix to apply to the effect. All the arguments are required and must not
26662677
/// be null.
2678+
@pragma('vm:entry-point')
26672679
ImageShader(Image image, TileMode tmx, TileMode tmy, Float64List matrix4) :
26682680
assert(image != null), // image is checked on the engine side
26692681
assert(tmx != null),
@@ -2828,6 +2840,7 @@ class Canvas extends NativeFieldWrapperClass2 {
28282840
///
28292841
/// To end the recording, call [PictureRecorder.endRecording] on the
28302842
/// given recorder.
2843+
@pragma('vm:entry-point')
28312844
Canvas(PictureRecorder recorder, [ Rect cullRect ]) : assert(recorder != null) {
28322845
if (recorder.isRecording)
28332846
throw new ArgumentError('"recorder" must not already be associated with another Canvas.');
@@ -3545,6 +3558,7 @@ class Picture extends NativeFieldWrapperClass2 {
35453558
/// or extended directly.
35463559
///
35473560
/// To create a [Picture], use a [PictureRecorder].
3561+
@pragma('vm:entry-point')
35483562
Picture._();
35493563

35503564
/// Creates an image from this picture.
@@ -3575,6 +3589,7 @@ class PictureRecorder extends NativeFieldWrapperClass2 {
35753589
/// Creates a new idle PictureRecorder. To associate it with a
35763590
/// [Canvas] and begin recording, pass this [PictureRecorder] to the
35773591
/// [Canvas] constructor.
3592+
@pragma('vm:entry-point')
35783593
PictureRecorder() { _constructor(); }
35793594
void _constructor() native 'PictureRecorder_constructor';
35803595

@@ -3640,4 +3655,3 @@ Future<T> _futurize<T>(_Callbacker<T> callbacker) {
36403655
throw new Exception(error);
36413656
return completer.future;
36423657
}
3643-

lib/ui/semantics.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ class SemanticsFlag {
552552
/// [Window.updateSemantics] to update the semantics conveyed to the user.
553553
class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
554554
/// Creates an empty [SemanticsUpdateBuilder] object.
555+
@pragma('vm:entry-point')
555556
SemanticsUpdateBuilder() { _constructor(); }
556557
void _constructor() native 'SemanticsUpdateBuilder_constructor';
557558

@@ -727,6 +728,7 @@ class SemanticsUpdate extends NativeFieldWrapperClass2 {
727728
/// or extended directly.
728729
///
729730
/// To create a SemanticsUpdate object, use a [SemanticsUpdateBuilder].
731+
@pragma('vm:entry-point')
730732
SemanticsUpdate._();
731733

732734
/// Releases the resources used by this semantics update.

lib/ui/text.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ class TextBox {
750750
this.direction,
751751
);
752752

753+
@pragma('vm:entry-point')
753754
TextBox._(
754755
this.left,
755756
this.top,
@@ -948,6 +949,7 @@ class Paragraph extends NativeFieldWrapperClass2 {
948949
/// or extended directly.
949950
///
950951
/// To create a [Paragraph] object, use a [ParagraphBuilder].
952+
@pragma('vm:entry-point')
951953
Paragraph._();
952954

953955
/// The amount of horizontal space this paragraph occupies.
@@ -1035,6 +1037,7 @@ class Paragraph extends NativeFieldWrapperClass2 {
10351037
class ParagraphBuilder extends NativeFieldWrapperClass2 {
10361038
/// Creates a [ParagraphBuilder] object, which is used to create a
10371039
/// [Paragraph].
1040+
@pragma('vm:entry-point')
10381041
ParagraphBuilder(ParagraphStyle style) { _constructor(style._encoded, style._fontFamily, style._fontSize, style._lineHeight, style._ellipsis, _encodeLocale(style._locale)); }
10391042
void _constructor(Int32List encoded, String fontFamily, double fontSize, double lineHeight, String ellipsis, String locale) native 'ParagraphBuilder_constructor';
10401043

runtime/dart_vm_entry_points.txt

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,2 @@
1-
dart:_internal,::,_printClosure
2-
dart:async,::,_setScheduleImmediateClosure
3-
dart:io,::,_getUriBaseClosure
4-
dart:io,::,_setupHooks
5-
dart:io,_Platform,_localeClosure
6-
dart:io,_Platform,set:_nativeScript
7-
dart:isolate,::,_getIsolateScheduleImmediateClosure
8-
dart:isolate,::,_setupHooks
9-
dart:isolate,::,_startMainIsolate
10-
dart:ui,::,_beginFrame
11-
dart:ui,::,_dispatchPlatformMessage
12-
dart:ui,::,_dispatchPointerDataPacket
13-
dart:ui,::,_dispatchSemanticsAction
14-
dart:ui,::,_drawFrame
15-
dart:ui,::,_getLocaleClosure
16-
dart:ui,::,_getMainClosure
17-
dart:ui,::,_getPrintClosure
18-
dart:ui,::,_getScheduleMicrotaskClosure
19-
dart:ui,::,_setupHooks
20-
dart:ui,::,_updateLocale
21-
dart:ui,::,_updateSemanticsEnabled
22-
dart:ui,::,_updateAccessibilityFeatures
23-
dart:ui,::,_updateUserSettingsData
24-
dart:ui,::,_updateWindowMetrics
25-
dart:ui,_ImageInfo,get:width
26-
dart:ui,_ImageInfo,get:height
27-
dart:ui,_ImageInfo,get:format
28-
dart:ui,_ImageInfo,get:rowBytes
29-
dart:ui,Canvas,Canvas.
30-
dart:ui,Codec,Codec._
31-
dart:ui,Color,Color.
32-
dart:ui,FrameInfo,FrameInfo._
33-
dart:ui,Image,Image._
34-
dart:ui,ImageShader,ImageShader.
35-
dart:ui,Paragraph,Paragraph._
36-
dart:ui,ParagraphBuilder,ParagraphBuilder.
37-
dart:ui,Path,Path.
38-
dart:ui,Picture,Picture._
39-
dart:ui,PictureRecorder,PictureRecorder.
40-
dart:ui,Rect,Rect.fromLTRB
41-
dart:ui,Scene,Scene._
42-
dart:ui,SceneBuilder,SceneBuilder.
43-
dart:ui,SemanticsUpdate,SemanticsUpdate._
44-
dart:ui,SemanticsUpdateBuilder,SemanticsUpdateBuilder.
45-
dart:ui,Shader,Shader._
46-
dart:ui,TextBox,TextBox._
1+
# Please don't add entries to this file.
2+
# Use the @pragma('vm:entry-point') annotation instead.

0 commit comments

Comments
 (0)