Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 1624853002: Store the result of type inference in summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files".
7 7
8 library analyzer.src.summary.format; 8 library analyzer.src.summary.format;
9 9
10 import 'base.dart' as base; 10 import 'base.dart' as base;
(...skipping 2908 matching lines...) Expand 10 before | Expand all | Expand 10 after
2919 UnlinkedDocumentationCommentBuilder _documentationComment; 2919 UnlinkedDocumentationCommentBuilder _documentationComment;
2920 List<UnlinkedTypeParamBuilder> _typeParameters; 2920 List<UnlinkedTypeParamBuilder> _typeParameters;
2921 EntityRefBuilder _returnType; 2921 EntityRefBuilder _returnType;
2922 List<UnlinkedParamBuilder> _parameters; 2922 List<UnlinkedParamBuilder> _parameters;
2923 UnlinkedExecutableKind _kind; 2923 UnlinkedExecutableKind _kind;
2924 bool _isAbstract; 2924 bool _isAbstract;
2925 bool _isStatic; 2925 bool _isStatic;
2926 bool _isConst; 2926 bool _isConst;
2927 bool _isFactory; 2927 bool _isFactory;
2928 bool _isExternal; 2928 bool _isExternal;
2929 int _inferredReturnTypeSlot;
2929 2930
2930 @override 2931 @override
2931 String get name => _name ??= ''; 2932 String get name => _name ??= '';
2932 2933
2933 /** 2934 /**
2934 * Name of the executable. For setters, this includes the trailing "=". For 2935 * Name of the executable. For setters, this includes the trailing "=". For
2935 * named constructors, this excludes the class name and excludes the ".". 2936 * named constructors, this excludes the class name and excludes the ".".
2936 * For unnamed constructors, this is the empty string. 2937 * For unnamed constructors, this is the empty string.
2937 */ 2938 */
2938 void set name(String _value) { 2939 void set name(String _value) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
3068 bool get isExternal => _isExternal ??= false; 3069 bool get isExternal => _isExternal ??= false;
3069 3070
3070 /** 3071 /**
3071 * Indicates whether the executable is declared using the `external` keyword. 3072 * Indicates whether the executable is declared using the `external` keyword.
3072 */ 3073 */
3073 void set isExternal(bool _value) { 3074 void set isExternal(bool _value) {
3074 assert(!_finished); 3075 assert(!_finished);
3075 _isExternal = _value; 3076 _isExternal = _value;
3076 } 3077 }
3077 3078
3078 UnlinkedExecutableBuilder({String name, int nameOffset, UnlinkedDocumentationC ommentBuilder documentationComment, List<UnlinkedTypeParamBuilder> typeParameter s, EntityRefBuilder returnType, List<UnlinkedParamBuilder> parameters, UnlinkedE xecutableKind kind, bool isAbstract, bool isStatic, bool isConst, bool isFactory , bool isExternal}) 3079 @override
3080 int get inferredReturnTypeSlot => _inferredReturnTypeSlot ??= 0;
3081
3082 /**
3083 * If this executable's return type is inferrable, nonzero slot id
3084 * identifying which entry in [LinkedLibrary.types] contains the inferred
3085 * return type. If there is no matching entry in [LinkedLibrary.types], then
3086 * no return type was inferred for this variable, so its static type is
3087 * `dynamic`.
3088 */
3089 void set inferredReturnTypeSlot(int _value) {
3090 assert(!_finished);
3091 assert(_value == null || _value >= 0);
3092 _inferredReturnTypeSlot = _value;
3093 }
3094
3095 UnlinkedExecutableBuilder({String name, int nameOffset, UnlinkedDocumentationC ommentBuilder documentationComment, List<UnlinkedTypeParamBuilder> typeParameter s, EntityRefBuilder returnType, List<UnlinkedParamBuilder> parameters, UnlinkedE xecutableKind kind, bool isAbstract, bool isStatic, bool isConst, bool isFactory , bool isExternal, int inferredReturnTypeSlot})
3079 : _name = name, 3096 : _name = name,
3080 _nameOffset = nameOffset, 3097 _nameOffset = nameOffset,
3081 _documentationComment = documentationComment, 3098 _documentationComment = documentationComment,
3082 _typeParameters = typeParameters, 3099 _typeParameters = typeParameters,
3083 _returnType = returnType, 3100 _returnType = returnType,
3084 _parameters = parameters, 3101 _parameters = parameters,
3085 _kind = kind, 3102 _kind = kind,
3086 _isAbstract = isAbstract, 3103 _isAbstract = isAbstract,
3087 _isStatic = isStatic, 3104 _isStatic = isStatic,
3088 _isConst = isConst, 3105 _isConst = isConst,
3089 _isFactory = isFactory, 3106 _isFactory = isFactory,
3090 _isExternal = isExternal; 3107 _isExternal = isExternal,
3108 _inferredReturnTypeSlot = inferredReturnTypeSlot;
3091 3109
3092 fb.Offset finish(fb.Builder fbBuilder) { 3110 fb.Offset finish(fb.Builder fbBuilder) {
3093 assert(!_finished); 3111 assert(!_finished);
3094 _finished = true; 3112 _finished = true;
3095 fb.Offset offset_name; 3113 fb.Offset offset_name;
3096 fb.Offset offset_documentationComment; 3114 fb.Offset offset_documentationComment;
3097 fb.Offset offset_typeParameters; 3115 fb.Offset offset_typeParameters;
3098 fb.Offset offset_returnType; 3116 fb.Offset offset_returnType;
3099 fb.Offset offset_parameters; 3117 fb.Offset offset_parameters;
3100 if (_name != null) { 3118 if (_name != null) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
3142 } 3160 }
3143 if (_isConst == true) { 3161 if (_isConst == true) {
3144 fbBuilder.addBool(9, true); 3162 fbBuilder.addBool(9, true);
3145 } 3163 }
3146 if (_isFactory == true) { 3164 if (_isFactory == true) {
3147 fbBuilder.addBool(10, true); 3165 fbBuilder.addBool(10, true);
3148 } 3166 }
3149 if (_isExternal == true) { 3167 if (_isExternal == true) {
3150 fbBuilder.addBool(11, true); 3168 fbBuilder.addBool(11, true);
3151 } 3169 }
3170 if (_inferredReturnTypeSlot != null && _inferredReturnTypeSlot != 0) {
3171 fbBuilder.addUint32(12, _inferredReturnTypeSlot);
3172 }
3152 return fbBuilder.endTable(); 3173 return fbBuilder.endTable();
3153 } 3174 }
3154 } 3175 }
3155 3176
3156 /** 3177 /**
3157 * Unlinked summary information about a function, method, getter, or setter 3178 * Unlinked summary information about a function, method, getter, or setter
3158 * declaration. 3179 * declaration.
3159 */ 3180 */
3160 abstract class UnlinkedExecutable extends base.SummaryClass { 3181 abstract class UnlinkedExecutable extends base.SummaryClass {
3161 3182
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
3226 3247
3227 /** 3248 /**
3228 * Indicates whether the executable is declared using the `factory` keyword. 3249 * Indicates whether the executable is declared using the `factory` keyword.
3229 */ 3250 */
3230 bool get isFactory; 3251 bool get isFactory;
3231 3252
3232 /** 3253 /**
3233 * Indicates whether the executable is declared using the `external` keyword. 3254 * Indicates whether the executable is declared using the `external` keyword.
3234 */ 3255 */
3235 bool get isExternal; 3256 bool get isExternal;
3257
3258 /**
3259 * If this executable's return type is inferrable, nonzero slot id
3260 * identifying which entry in [LinkedLibrary.types] contains the inferred
3261 * return type. If there is no matching entry in [LinkedLibrary.types], then
3262 * no return type was inferred for this variable, so its static type is
3263 * `dynamic`.
3264 */
3265 int get inferredReturnTypeSlot;
3236 } 3266 }
3237 3267
3238 class _UnlinkedExecutableReader extends fb.TableReader<_UnlinkedExecutableImpl> { 3268 class _UnlinkedExecutableReader extends fb.TableReader<_UnlinkedExecutableImpl> {
3239 const _UnlinkedExecutableReader(); 3269 const _UnlinkedExecutableReader();
3240 3270
3241 @override 3271 @override
3242 _UnlinkedExecutableImpl createObject(fb.BufferPointer bp) => new _UnlinkedExec utableImpl(bp); 3272 _UnlinkedExecutableImpl createObject(fb.BufferPointer bp) => new _UnlinkedExec utableImpl(bp);
3243 } 3273 }
3244 3274
3245 class _UnlinkedExecutableImpl extends Object with _UnlinkedExecutableMixin imple ments UnlinkedExecutable { 3275 class _UnlinkedExecutableImpl extends Object with _UnlinkedExecutableMixin imple ments UnlinkedExecutable {
3246 final fb.BufferPointer _bp; 3276 final fb.BufferPointer _bp;
3247 3277
3248 _UnlinkedExecutableImpl(this._bp); 3278 _UnlinkedExecutableImpl(this._bp);
3249 3279
3250 String _name; 3280 String _name;
3251 int _nameOffset; 3281 int _nameOffset;
3252 UnlinkedDocumentationComment _documentationComment; 3282 UnlinkedDocumentationComment _documentationComment;
3253 List<UnlinkedTypeParam> _typeParameters; 3283 List<UnlinkedTypeParam> _typeParameters;
3254 EntityRef _returnType; 3284 EntityRef _returnType;
3255 List<UnlinkedParam> _parameters; 3285 List<UnlinkedParam> _parameters;
3256 UnlinkedExecutableKind _kind; 3286 UnlinkedExecutableKind _kind;
3257 bool _isAbstract; 3287 bool _isAbstract;
3258 bool _isStatic; 3288 bool _isStatic;
3259 bool _isConst; 3289 bool _isConst;
3260 bool _isFactory; 3290 bool _isFactory;
3261 bool _isExternal; 3291 bool _isExternal;
3292 int _inferredReturnTypeSlot;
3262 3293
3263 @override 3294 @override
3264 String get name { 3295 String get name {
3265 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); 3296 _name ??= const fb.StringReader().vTableGet(_bp, 0, '');
3266 return _name; 3297 return _name;
3267 } 3298 }
3268 3299
3269 @override 3300 @override
3270 int get nameOffset { 3301 int get nameOffset {
3271 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0); 3302 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
3324 bool get isFactory { 3355 bool get isFactory {
3325 _isFactory ??= const fb.BoolReader().vTableGet(_bp, 10, false); 3356 _isFactory ??= const fb.BoolReader().vTableGet(_bp, 10, false);
3326 return _isFactory; 3357 return _isFactory;
3327 } 3358 }
3328 3359
3329 @override 3360 @override
3330 bool get isExternal { 3361 bool get isExternal {
3331 _isExternal ??= const fb.BoolReader().vTableGet(_bp, 11, false); 3362 _isExternal ??= const fb.BoolReader().vTableGet(_bp, 11, false);
3332 return _isExternal; 3363 return _isExternal;
3333 } 3364 }
3365
3366 @override
3367 int get inferredReturnTypeSlot {
3368 _inferredReturnTypeSlot ??= const fb.Uint32Reader().vTableGet(_bp, 12, 0);
3369 return _inferredReturnTypeSlot;
3370 }
3334 } 3371 }
3335 3372
3336 abstract class _UnlinkedExecutableMixin implements UnlinkedExecutable { 3373 abstract class _UnlinkedExecutableMixin implements UnlinkedExecutable {
3337 @override 3374 @override
3338 Map<String, Object> toMap() => { 3375 Map<String, Object> toMap() => {
3339 "name": name, 3376 "name": name,
3340 "nameOffset": nameOffset, 3377 "nameOffset": nameOffset,
3341 "documentationComment": documentationComment, 3378 "documentationComment": documentationComment,
3342 "typeParameters": typeParameters, 3379 "typeParameters": typeParameters,
3343 "returnType": returnType, 3380 "returnType": returnType,
3344 "parameters": parameters, 3381 "parameters": parameters,
3345 "kind": kind, 3382 "kind": kind,
3346 "isAbstract": isAbstract, 3383 "isAbstract": isAbstract,
3347 "isStatic": isStatic, 3384 "isStatic": isStatic,
3348 "isConst": isConst, 3385 "isConst": isConst,
3349 "isFactory": isFactory, 3386 "isFactory": isFactory,
3350 "isExternal": isExternal, 3387 "isExternal": isExternal,
3388 "inferredReturnTypeSlot": inferredReturnTypeSlot,
3351 }; 3389 };
3352 } 3390 }
3353 3391
3354 class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPubli cMixin implements UnlinkedExportNonPublic { 3392 class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPubli cMixin implements UnlinkedExportNonPublic {
3355 bool _finished = false; 3393 bool _finished = false;
3356 3394
3357 int _offset; 3395 int _offset;
3358 int _uriOffset; 3396 int _uriOffset;
3359 int _uriEnd; 3397 int _uriEnd;
3360 3398
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements Un linkedParam { 3962 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements Un linkedParam {
3925 bool _finished = false; 3963 bool _finished = false;
3926 3964
3927 String _name; 3965 String _name;
3928 int _nameOffset; 3966 int _nameOffset;
3929 EntityRefBuilder _type; 3967 EntityRefBuilder _type;
3930 List<UnlinkedParamBuilder> _parameters; 3968 List<UnlinkedParamBuilder> _parameters;
3931 UnlinkedParamKind _kind; 3969 UnlinkedParamKind _kind;
3932 bool _isFunctionTyped; 3970 bool _isFunctionTyped;
3933 bool _isInitializingFormal; 3971 bool _isInitializingFormal;
3972 int _inferredTypeSlot;
3934 3973
3935 @override 3974 @override
3936 String get name => _name ??= ''; 3975 String get name => _name ??= '';
3937 3976
3938 /** 3977 /**
3939 * Name of the parameter. 3978 * Name of the parameter.
3940 */ 3979 */
3941 void set name(String _value) { 3980 void set name(String _value) {
3942 assert(!_finished); 3981 assert(!_finished);
3943 _name = _value; 3982 _name = _value;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
4006 4045
4007 /** 4046 /**
4008 * Indicates whether this is an initializing formal parameter (i.e. it is 4047 * Indicates whether this is an initializing formal parameter (i.e. it is
4009 * declared using `this.` syntax). 4048 * declared using `this.` syntax).
4010 */ 4049 */
4011 void set isInitializingFormal(bool _value) { 4050 void set isInitializingFormal(bool _value) {
4012 assert(!_finished); 4051 assert(!_finished);
4013 _isInitializingFormal = _value; 4052 _isInitializingFormal = _value;
4014 } 4053 }
4015 4054
4016 UnlinkedParamBuilder({String name, int nameOffset, EntityRefBuilder type, List <UnlinkedParamBuilder> parameters, UnlinkedParamKind kind, bool isFunctionTyped, bool isInitializingFormal}) 4055 @override
4056 int get inferredTypeSlot => _inferredTypeSlot ??= 0;
4057
4058 /**
4059 * If this parameter's type is inferrable, nonzero slot id identifying which
4060 * entry in [LinkedLibrary.types] contains the inferred type. If there is no
4061 * matching entry in [LinkedLibrary.types], then no type was inferred for
4062 * this variable, so its static type is `dynamic`.
4063 *
4064 * Note that although strong mode considers initializing formals to be
4065 * inferrable, they are not marked as such in the summary; if their type is
4066 * not specified, they always inherit the static type of the corresponding
4067 * field.
4068 */
4069 void set inferredTypeSlot(int _value) {
4070 assert(!_finished);
4071 assert(_value == null || _value >= 0);
4072 _inferredTypeSlot = _value;
4073 }
4074
4075 UnlinkedParamBuilder({String name, int nameOffset, EntityRefBuilder type, List <UnlinkedParamBuilder> parameters, UnlinkedParamKind kind, bool isFunctionTyped, bool isInitializingFormal, int inferredTypeSlot})
4017 : _name = name, 4076 : _name = name,
4018 _nameOffset = nameOffset, 4077 _nameOffset = nameOffset,
4019 _type = type, 4078 _type = type,
4020 _parameters = parameters, 4079 _parameters = parameters,
4021 _kind = kind, 4080 _kind = kind,
4022 _isFunctionTyped = isFunctionTyped, 4081 _isFunctionTyped = isFunctionTyped,
4023 _isInitializingFormal = isInitializingFormal; 4082 _isInitializingFormal = isInitializingFormal,
4083 _inferredTypeSlot = inferredTypeSlot;
4024 4084
4025 fb.Offset finish(fb.Builder fbBuilder) { 4085 fb.Offset finish(fb.Builder fbBuilder) {
4026 assert(!_finished); 4086 assert(!_finished);
4027 _finished = true; 4087 _finished = true;
4028 fb.Offset offset_name; 4088 fb.Offset offset_name;
4029 fb.Offset offset_type; 4089 fb.Offset offset_type;
4030 fb.Offset offset_parameters; 4090 fb.Offset offset_parameters;
4031 if (_name != null) { 4091 if (_name != null) {
4032 offset_name = fbBuilder.writeString(_name); 4092 offset_name = fbBuilder.writeString(_name);
4033 } 4093 }
(...skipping 18 matching lines...) Expand all
4052 } 4112 }
4053 if (_kind != null && _kind != UnlinkedParamKind.required) { 4113 if (_kind != null && _kind != UnlinkedParamKind.required) {
4054 fbBuilder.addUint32(4, _kind.index); 4114 fbBuilder.addUint32(4, _kind.index);
4055 } 4115 }
4056 if (_isFunctionTyped == true) { 4116 if (_isFunctionTyped == true) {
4057 fbBuilder.addBool(5, true); 4117 fbBuilder.addBool(5, true);
4058 } 4118 }
4059 if (_isInitializingFormal == true) { 4119 if (_isInitializingFormal == true) {
4060 fbBuilder.addBool(6, true); 4120 fbBuilder.addBool(6, true);
4061 } 4121 }
4122 if (_inferredTypeSlot != null && _inferredTypeSlot != 0) {
4123 fbBuilder.addUint32(7, _inferredTypeSlot);
4124 }
4062 return fbBuilder.endTable(); 4125 return fbBuilder.endTable();
4063 } 4126 }
4064 } 4127 }
4065 4128
4066 /** 4129 /**
4067 * Unlinked summary information about a function parameter. 4130 * Unlinked summary information about a function parameter.
4068 */ 4131 */
4069 abstract class UnlinkedParam extends base.SummaryClass { 4132 abstract class UnlinkedParam extends base.SummaryClass {
4070 4133
4071 /** 4134 /**
(...skipping 26 matching lines...) Expand all
4098 /** 4161 /**
4099 * Indicates whether this is a function-typed parameter. 4162 * Indicates whether this is a function-typed parameter.
4100 */ 4163 */
4101 bool get isFunctionTyped; 4164 bool get isFunctionTyped;
4102 4165
4103 /** 4166 /**
4104 * Indicates whether this is an initializing formal parameter (i.e. it is 4167 * Indicates whether this is an initializing formal parameter (i.e. it is
4105 * declared using `this.` syntax). 4168 * declared using `this.` syntax).
4106 */ 4169 */
4107 bool get isInitializingFormal; 4170 bool get isInitializingFormal;
4171
4172 /**
4173 * If this parameter's type is inferrable, nonzero slot id identifying which
4174 * entry in [LinkedLibrary.types] contains the inferred type. If there is no
4175 * matching entry in [LinkedLibrary.types], then no type was inferred for
4176 * this variable, so its static type is `dynamic`.
4177 *
4178 * Note that although strong mode considers initializing formals to be
4179 * inferrable, they are not marked as such in the summary; if their type is
4180 * not specified, they always inherit the static type of the corresponding
4181 * field.
4182 */
4183 int get inferredTypeSlot;
4108 } 4184 }
4109 4185
4110 class _UnlinkedParamReader extends fb.TableReader<_UnlinkedParamImpl> { 4186 class _UnlinkedParamReader extends fb.TableReader<_UnlinkedParamImpl> {
4111 const _UnlinkedParamReader(); 4187 const _UnlinkedParamReader();
4112 4188
4113 @override 4189 @override
4114 _UnlinkedParamImpl createObject(fb.BufferPointer bp) => new _UnlinkedParamImpl (bp); 4190 _UnlinkedParamImpl createObject(fb.BufferPointer bp) => new _UnlinkedParamImpl (bp);
4115 } 4191 }
4116 4192
4117 class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements Unli nkedParam { 4193 class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements Unli nkedParam {
4118 final fb.BufferPointer _bp; 4194 final fb.BufferPointer _bp;
4119 4195
4120 _UnlinkedParamImpl(this._bp); 4196 _UnlinkedParamImpl(this._bp);
4121 4197
4122 String _name; 4198 String _name;
4123 int _nameOffset; 4199 int _nameOffset;
4124 EntityRef _type; 4200 EntityRef _type;
4125 List<UnlinkedParam> _parameters; 4201 List<UnlinkedParam> _parameters;
4126 UnlinkedParamKind _kind; 4202 UnlinkedParamKind _kind;
4127 bool _isFunctionTyped; 4203 bool _isFunctionTyped;
4128 bool _isInitializingFormal; 4204 bool _isInitializingFormal;
4205 int _inferredTypeSlot;
4129 4206
4130 @override 4207 @override
4131 String get name { 4208 String get name {
4132 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); 4209 _name ??= const fb.StringReader().vTableGet(_bp, 0, '');
4133 return _name; 4210 return _name;
4134 } 4211 }
4135 4212
4136 @override 4213 @override
4137 int get nameOffset { 4214 int get nameOffset {
4138 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0); 4215 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0);
(...skipping 22 matching lines...) Expand all
4161 bool get isFunctionTyped { 4238 bool get isFunctionTyped {
4162 _isFunctionTyped ??= const fb.BoolReader().vTableGet(_bp, 5, false); 4239 _isFunctionTyped ??= const fb.BoolReader().vTableGet(_bp, 5, false);
4163 return _isFunctionTyped; 4240 return _isFunctionTyped;
4164 } 4241 }
4165 4242
4166 @override 4243 @override
4167 bool get isInitializingFormal { 4244 bool get isInitializingFormal {
4168 _isInitializingFormal ??= const fb.BoolReader().vTableGet(_bp, 6, false); 4245 _isInitializingFormal ??= const fb.BoolReader().vTableGet(_bp, 6, false);
4169 return _isInitializingFormal; 4246 return _isInitializingFormal;
4170 } 4247 }
4248
4249 @override
4250 int get inferredTypeSlot {
4251 _inferredTypeSlot ??= const fb.Uint32Reader().vTableGet(_bp, 7, 0);
4252 return _inferredTypeSlot;
4253 }
4171 } 4254 }
4172 4255
4173 abstract class _UnlinkedParamMixin implements UnlinkedParam { 4256 abstract class _UnlinkedParamMixin implements UnlinkedParam {
4174 @override 4257 @override
4175 Map<String, Object> toMap() => { 4258 Map<String, Object> toMap() => {
4176 "name": name, 4259 "name": name,
4177 "nameOffset": nameOffset, 4260 "nameOffset": nameOffset,
4178 "type": type, 4261 "type": type,
4179 "parameters": parameters, 4262 "parameters": parameters,
4180 "kind": kind, 4263 "kind": kind,
4181 "isFunctionTyped": isFunctionTyped, 4264 "isFunctionTyped": isFunctionTyped,
4182 "isInitializingFormal": isInitializingFormal, 4265 "isInitializingFormal": isInitializingFormal,
4266 "inferredTypeSlot": inferredTypeSlot,
4183 }; 4267 };
4184 } 4268 }
4185 4269
4186 class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements Unli nkedPart { 4270 class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements Unli nkedPart {
4187 bool _finished = false; 4271 bool _finished = false;
4188 4272
4189 int _uriOffset; 4273 int _uriOffset;
4190 int _uriEnd; 4274 int _uriEnd;
4191 4275
4192 @override 4276 @override
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
5605 5689
5606 String _name; 5690 String _name;
5607 int _nameOffset; 5691 int _nameOffset;
5608 UnlinkedDocumentationCommentBuilder _documentationComment; 5692 UnlinkedDocumentationCommentBuilder _documentationComment;
5609 EntityRefBuilder _type; 5693 EntityRefBuilder _type;
5610 UnlinkedConstBuilder _constExpr; 5694 UnlinkedConstBuilder _constExpr;
5611 bool _isStatic; 5695 bool _isStatic;
5612 bool _isFinal; 5696 bool _isFinal;
5613 bool _isConst; 5697 bool _isConst;
5614 int _propagatedTypeSlot; 5698 int _propagatedTypeSlot;
5699 int _inferredTypeSlot;
5615 5700
5616 @override 5701 @override
5617 String get name => _name ??= ''; 5702 String get name => _name ??= '';
5618 5703
5619 /** 5704 /**
5620 * Name of the variable. 5705 * Name of the variable.
5621 */ 5706 */
5622 void set name(String _value) { 5707 void set name(String _value) {
5623 assert(!_finished); 5708 assert(!_finished);
5624 _name = _value; 5709 _name = _value;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
5718 * propagated type is the same as its declared type. 5803 * propagated type is the same as its declared type.
5719 * 5804 *
5720 * Non-propagable variables have a [propagatedTypeSlot] of zero. 5805 * Non-propagable variables have a [propagatedTypeSlot] of zero.
5721 */ 5806 */
5722 void set propagatedTypeSlot(int _value) { 5807 void set propagatedTypeSlot(int _value) {
5723 assert(!_finished); 5808 assert(!_finished);
5724 assert(_value == null || _value >= 0); 5809 assert(_value == null || _value >= 0);
5725 _propagatedTypeSlot = _value; 5810 _propagatedTypeSlot = _value;
5726 } 5811 }
5727 5812
5728 UnlinkedVariableBuilder({String name, int nameOffset, UnlinkedDocumentationCom mentBuilder documentationComment, EntityRefBuilder type, UnlinkedConstBuilder co nstExpr, bool isStatic, bool isFinal, bool isConst, int propagatedTypeSlot}) 5813 @override
5814 int get inferredTypeSlot => _inferredTypeSlot ??= 0;
5815
5816 /**
5817 * If this variable is inferrable, nonzero slot id identifying which entry in
5818 * [LinkedLibrary.types] contains the inferred type for this variable. If
5819 * there is no matching entry in [LinkedLibrary.types], then no type was
5820 * inferred for this variable, so its static type is `dynamic`.
5821 */
5822 void set inferredTypeSlot(int _value) {
5823 assert(!_finished);
5824 assert(_value == null || _value >= 0);
5825 _inferredTypeSlot = _value;
5826 }
5827
5828 UnlinkedVariableBuilder({String name, int nameOffset, UnlinkedDocumentationCom mentBuilder documentationComment, EntityRefBuilder type, UnlinkedConstBuilder co nstExpr, bool isStatic, bool isFinal, bool isConst, int propagatedTypeSlot, int inferredTypeSlot})
5729 : _name = name, 5829 : _name = name,
5730 _nameOffset = nameOffset, 5830 _nameOffset = nameOffset,
5731 _documentationComment = documentationComment, 5831 _documentationComment = documentationComment,
5732 _type = type, 5832 _type = type,
5733 _constExpr = constExpr, 5833 _constExpr = constExpr,
5734 _isStatic = isStatic, 5834 _isStatic = isStatic,
5735 _isFinal = isFinal, 5835 _isFinal = isFinal,
5736 _isConst = isConst, 5836 _isConst = isConst,
5737 _propagatedTypeSlot = propagatedTypeSlot; 5837 _propagatedTypeSlot = propagatedTypeSlot,
5838 _inferredTypeSlot = inferredTypeSlot;
5738 5839
5739 fb.Offset finish(fb.Builder fbBuilder) { 5840 fb.Offset finish(fb.Builder fbBuilder) {
5740 assert(!_finished); 5841 assert(!_finished);
5741 _finished = true; 5842 _finished = true;
5742 fb.Offset offset_name; 5843 fb.Offset offset_name;
5743 fb.Offset offset_documentationComment; 5844 fb.Offset offset_documentationComment;
5744 fb.Offset offset_type; 5845 fb.Offset offset_type;
5745 fb.Offset offset_constExpr; 5846 fb.Offset offset_constExpr;
5746 if (_name != null) { 5847 if (_name != null) {
5747 offset_name = fbBuilder.writeString(_name); 5848 offset_name = fbBuilder.writeString(_name);
(...skipping 28 matching lines...) Expand all
5776 } 5877 }
5777 if (_isFinal == true) { 5878 if (_isFinal == true) {
5778 fbBuilder.addBool(6, true); 5879 fbBuilder.addBool(6, true);
5779 } 5880 }
5780 if (_isConst == true) { 5881 if (_isConst == true) {
5781 fbBuilder.addBool(7, true); 5882 fbBuilder.addBool(7, true);
5782 } 5883 }
5783 if (_propagatedTypeSlot != null && _propagatedTypeSlot != 0) { 5884 if (_propagatedTypeSlot != null && _propagatedTypeSlot != 0) {
5784 fbBuilder.addUint32(8, _propagatedTypeSlot); 5885 fbBuilder.addUint32(8, _propagatedTypeSlot);
5785 } 5886 }
5887 if (_inferredTypeSlot != null && _inferredTypeSlot != 0) {
5888 fbBuilder.addUint32(9, _inferredTypeSlot);
5889 }
5786 return fbBuilder.endTable(); 5890 return fbBuilder.endTable();
5787 } 5891 }
5788 } 5892 }
5789 5893
5790 /** 5894 /**
5791 * Unlinked summary information about a top level variable, local variable, or 5895 * Unlinked summary information about a top level variable, local variable, or
5792 * a field. 5896 * a field.
5793 */ 5897 */
5794 abstract class UnlinkedVariable extends base.SummaryClass { 5898 abstract class UnlinkedVariable extends base.SummaryClass {
5795 5899
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
5841 5945
5842 /** 5946 /**
5843 * If this variable is propagable, nonzero slot id identifying which entry in 5947 * If this variable is propagable, nonzero slot id identifying which entry in
5844 * [LinkedLibrary.types] contains the propagated type for this variable. If 5948 * [LinkedLibrary.types] contains the propagated type for this variable. If
5845 * there is no matching entry in [LinkedLibrary.types], then this variable's 5949 * there is no matching entry in [LinkedLibrary.types], then this variable's
5846 * propagated type is the same as its declared type. 5950 * propagated type is the same as its declared type.
5847 * 5951 *
5848 * Non-propagable variables have a [propagatedTypeSlot] of zero. 5952 * Non-propagable variables have a [propagatedTypeSlot] of zero.
5849 */ 5953 */
5850 int get propagatedTypeSlot; 5954 int get propagatedTypeSlot;
5955
5956 /**
5957 * If this variable is inferrable, nonzero slot id identifying which entry in
5958 * [LinkedLibrary.types] contains the inferred type for this variable. If
5959 * there is no matching entry in [LinkedLibrary.types], then no type was
5960 * inferred for this variable, so its static type is `dynamic`.
5961 */
5962 int get inferredTypeSlot;
5851 } 5963 }
5852 5964
5853 class _UnlinkedVariableReader extends fb.TableReader<_UnlinkedVariableImpl> { 5965 class _UnlinkedVariableReader extends fb.TableReader<_UnlinkedVariableImpl> {
5854 const _UnlinkedVariableReader(); 5966 const _UnlinkedVariableReader();
5855 5967
5856 @override 5968 @override
5857 _UnlinkedVariableImpl createObject(fb.BufferPointer bp) => new _UnlinkedVariab leImpl(bp); 5969 _UnlinkedVariableImpl createObject(fb.BufferPointer bp) => new _UnlinkedVariab leImpl(bp);
5858 } 5970 }
5859 5971
5860 class _UnlinkedVariableImpl extends Object with _UnlinkedVariableMixin implement s UnlinkedVariable { 5972 class _UnlinkedVariableImpl extends Object with _UnlinkedVariableMixin implement s UnlinkedVariable {
5861 final fb.BufferPointer _bp; 5973 final fb.BufferPointer _bp;
5862 5974
5863 _UnlinkedVariableImpl(this._bp); 5975 _UnlinkedVariableImpl(this._bp);
5864 5976
5865 String _name; 5977 String _name;
5866 int _nameOffset; 5978 int _nameOffset;
5867 UnlinkedDocumentationComment _documentationComment; 5979 UnlinkedDocumentationComment _documentationComment;
5868 EntityRef _type; 5980 EntityRef _type;
5869 UnlinkedConst _constExpr; 5981 UnlinkedConst _constExpr;
5870 bool _isStatic; 5982 bool _isStatic;
5871 bool _isFinal; 5983 bool _isFinal;
5872 bool _isConst; 5984 bool _isConst;
5873 int _propagatedTypeSlot; 5985 int _propagatedTypeSlot;
5986 int _inferredTypeSlot;
5874 5987
5875 @override 5988 @override
5876 String get name { 5989 String get name {
5877 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); 5990 _name ??= const fb.StringReader().vTableGet(_bp, 0, '');
5878 return _name; 5991 return _name;
5879 } 5992 }
5880 5993
5881 @override 5994 @override
5882 int get nameOffset { 5995 int get nameOffset {
5883 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0); 5996 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
5918 bool get isConst { 6031 bool get isConst {
5919 _isConst ??= const fb.BoolReader().vTableGet(_bp, 7, false); 6032 _isConst ??= const fb.BoolReader().vTableGet(_bp, 7, false);
5920 return _isConst; 6033 return _isConst;
5921 } 6034 }
5922 6035
5923 @override 6036 @override
5924 int get propagatedTypeSlot { 6037 int get propagatedTypeSlot {
5925 _propagatedTypeSlot ??= const fb.Uint32Reader().vTableGet(_bp, 8, 0); 6038 _propagatedTypeSlot ??= const fb.Uint32Reader().vTableGet(_bp, 8, 0);
5926 return _propagatedTypeSlot; 6039 return _propagatedTypeSlot;
5927 } 6040 }
6041
6042 @override
6043 int get inferredTypeSlot {
6044 _inferredTypeSlot ??= const fb.Uint32Reader().vTableGet(_bp, 9, 0);
6045 return _inferredTypeSlot;
6046 }
5928 } 6047 }
5929 6048
5930 abstract class _UnlinkedVariableMixin implements UnlinkedVariable { 6049 abstract class _UnlinkedVariableMixin implements UnlinkedVariable {
5931 @override 6050 @override
5932 Map<String, Object> toMap() => { 6051 Map<String, Object> toMap() => {
5933 "name": name, 6052 "name": name,
5934 "nameOffset": nameOffset, 6053 "nameOffset": nameOffset,
5935 "documentationComment": documentationComment, 6054 "documentationComment": documentationComment,
5936 "type": type, 6055 "type": type,
5937 "constExpr": constExpr, 6056 "constExpr": constExpr,
5938 "isStatic": isStatic, 6057 "isStatic": isStatic,
5939 "isFinal": isFinal, 6058 "isFinal": isFinal,
5940 "isConst": isConst, 6059 "isConst": isConst,
5941 "propagatedTypeSlot": propagatedTypeSlot, 6060 "propagatedTypeSlot": propagatedTypeSlot,
6061 "inferredTypeSlot": inferredTypeSlot,
5942 }; 6062 };
5943 } 6063 }
5944 6064
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | pkg/analyzer/lib/src/summary/resynthesize.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698