Skip to content

Commit

Permalink
Version 3.3.0-278.0.dev
Browse files Browse the repository at this point in the history
Merge 4804d54 into dev
  • Loading branch information
Dart CI committed Jan 3, 2024
2 parents c5a75ac + 4804d54 commit 9edeb52
Show file tree
Hide file tree
Showing 32 changed files with 237 additions and 95 deletions.
22 changes: 11 additions & 11 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ vars = {
"clock_rev": "f975668839f45bad561d6227f88297bbbcff03fa",
"collection_rev": "2d57a82ad079fe2d127f5a9b188170de2f5cdedc",
"convert_rev": "f8a72d67a10805bca358be8d7e189a62f79d86b9",
"crypto_rev": "63e9a90c97d216bfd6e3ce72e80df320ef84572a",
"crypto_rev": "f2efb981b461dcae43d0cf18a3a970142abfee35",
"csslib_rev": "1ad2d1ec461fb1836180e917220a5a48fd641897",
# Note: Updates to dart_style have to be coordinated with the infrastructure
# team so that the internal formatter `tools/sdks/dart-sdk/bin/dart format`
Expand Down Expand Up @@ -156,25 +156,25 @@ vars = {
"json_rpc_2_rev": "ac1fabddd51fc90aa6fa4e1248f1a7141899eb4a",
"leak_tracker_rev": "8644f8b1c78009e9149e08e0c349d06c304110a9",
"lints_rev": "3810f8b3dc3205cfaa4ccc0054b021e68046d851",
"logging_rev": "324a0b5fd2b49b80ea4fbe2b48aac7794000e25a",
"logging_rev": "4d35a4e02b9237bd794378413e7ce3deb52ffcaf",
"markdown_rev": "d2e790305d136b4eb39d329c884bb49d5a5f1411",
"matcher_rev": "fcbd3616c1dbe636d22d2b164aee3f1c32c52a42",
"material_color_utilities_rev": "799b6ba2f3f1c28c67cc7e0b4f18e0c7d7f3c03e",
"mime_rev": "56359b0c72e1a9a2e2b20ee5a34bacc18e113897",
"mime_rev": "ca9f059d2334bb2657683e0a7f5949817cb4b0e6",
"mockito_rev": "57a7c820ffae61e3df0dbc279ad98b92751175f0",
"native_rev": "b668ca94f551fcebdeb3ce9f822170facced55ae",
"package_config_rev": "33dd24659147bd7ed2fa87aeacc52d199be766b4",
"path_rev": "115ea2a4084881e7c76089a37abc01a067dfa6e3",
"pool_rev": "3c1bd422da311d95b65a04a5f28de2c0e8193692",
"path_rev": "57a049cff2e2be7a302dd9683b2b194c6d06e2d4",
"pool_rev": "4c490001446d8ba3d361b99d8befd6a4f61abc7a",
"protobuf_rev": "20ec6856b65b7fd6445219fdec24d90b414f7469",
"pub_rev": "1779628b386819675130f14326f1e8812901c48f", # disable rev_sdk_deps.dart
"pub_semver_rev": "45721813dea1591a7689f93762afa358cbf260c7",
"shelf_rev": "b3adc7c5264b448a77427c6aacd67eedfb16dce2",
"shelf_rev": "733588f90572801574f68d636338f61c12781cd1",
"source_map_stack_trace_rev": "220962658bf67304207aedc7eeedca6ef64a7c72",
"source_maps_rev": "87dc58736b5bd334502005cdbd4d325aba9bc696",
"source_span_rev": "9398e2464e24d2f15cccfa1199381a6247403829",
"sse_rev": "8d2e2f0d00a5b46f005c621a3b23465ce7348724",
"stack_trace_rev": "4abff4489b93e6bbc82063343e666ccda9f62e8e",
"stack_trace_rev": "0f4710c9d2678530501e1e88c77f955b68450325",
"stream_channel_rev": "178104d0f1316b0120cf0031b8dbae0cbfec4c26",
"string_scanner_rev": "ebc30a3dec2552bbdb481099180618c22c122b69",
"sync_http_rev": "f96db9543e5a9f62833ca9a24269b12fcf63d45b",
Expand All @@ -184,18 +184,18 @@ vars = {
"test_descriptor_rev": "59ce97fae49709fa1f479efa808c031a576e617e",
"test_process_rev": "d68de5bc53bf33a12334d06748af9db4844d66f0",
"test_reflective_loader_rev": "6edf5358b53bfda487840bad1a03d089326fa08c",
"tools_rev": "ed81684df747830de8b29e9d6e6d8f951ea6968d",
"tools_rev": "2f59ab443ab829dfbd2922d0edac44cda27889ae",
"typed_data_rev": "6f6d81d64cd698f8def5116fc97b7b1fb7441696",
"usage_rev": "e99690ae6d5fa9ec24ac5218bcd3621e8e3ae8a9",
"vector_math_rev": "38a00c35575b71a095903467141e5ee60c94d011",
"watcher_rev": "dc45f1925f66743ff29b9dcbb4693a7ec25945c5",
"watcher_rev": "66cd694ffb7ee6e09ff0cde6c9f788aa47ee1a23",
"web_rev": "acf0bebdd764d2400dc4e9e18577813c0f9e90c3",
"web_socket_channel_rev": "5241175e7c66271850d6e75fb9ec90068f9dd3c4", # https://github.com/dart-lang/sdk/issues/54165
"webdev_rev": "8375cd66821550cb7a129315d97cd768c5fdd92c",
"webdriver_rev": "2c1b6f8b9d684caf62d72bb327c24f738a4e7455",
"webkit_inspection_protocol_rev": "667c55e6f65638592768e0325b75420e39b01d2e",
"yaml_rev": "98a3aab54b09d355e094fdb4e5abd9083a2876b8",
"yaml_edit_rev": "9b9d33c5255798c950e843efe19e6f81a225ad28",
"yaml_rev": "509fd72c0910746bf25db9c7d890b4c47c286a8c",
"yaml_edit_rev": "47eb20e9083954b7b9ec1fb04e7a9f8976a8ed14",

# Windows deps
"crashpad_rev": "bf327d8ceb6a669607b0dbab5a83a275d03f99ed",
Expand Down
2 changes: 2 additions & 0 deletions pkg/compiler/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ linter:
- prefer_if_null_operators
- prefer_null_aware_operators
- use_super_parameters
- exhaustive_cases
- no_default_cases
3 changes: 0 additions & 3 deletions pkg/compiler/lib/src/elements/types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2263,9 +2263,6 @@ abstract class DartTypes {
if (!_isSubtype(sArgs[i], tArgs[i], env) ||
!_isSubtype(tArgs[i], sArgs[i], env)) return false;
break;
default:
throw StateError(
"Invalid variance ${variances[i]} used for subtype check.");
}
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ class FlatTypeMask extends TypeMask {
return other.withFlags(
isNullable: includeNull, hasLateSentinel: includeLateSentinel);
case SubclassResultKind.SET:
default:
if (result.classes.isEmpty) {
return includeNull
? TypeMask.empty(hasLateSentinel: includeLateSentinel)
Expand Down
17 changes: 14 additions & 3 deletions pkg/compiler/lib/src/io/kernel_source_information.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ String? computeKernelElementNameForSourceMaps(
String enclosingMemberName =
computeElementNameForSourceMaps(enclosingMember, callStructure)!;
return '$enclosingMemberName.$name';
default:
case MemberKind.constructor:
case MemberKind.constructorBody:
case MemberKind.recordGetter:
case MemberKind.signature:
case MemberKind.closureField:
case MemberKind.generatorBody:
case MemberKind.parameterStub:
return computeElementNameForSourceMaps(member, callStructure);
}
}
Expand Down Expand Up @@ -190,7 +196,7 @@ class KernelSourceInformationBuilder implements SourceInformationBuilder {
case MemberKind.closureField:
case MemberKind.signature:
case MemberKind.generatorBody:
// TODO(sra): Should we target the generator itself for generatorBody
// TODO(sra): Should we target the generator itself for generatorBody?
break;
}
return _buildTreeNode(base ?? definition.node as ir.TreeNode, name: name);
Expand Down Expand Up @@ -295,7 +301,12 @@ class KernelSourceInformationBuilder implements SourceInformationBuilder {
case MemberKind.closureCall:
final node = definition.node as ir.LocalFunction;
return _buildFunctionExit(node, node.function);
default:
case MemberKind.signature:
case MemberKind.closureField:
case MemberKind.recordGetter:
case MemberKind.generatorBody:
case MemberKind.parameterStub:
break;
}
return _buildTreeNode(definition.node as ir.TreeNode);
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/compiler/lib/src/ir/scope_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1568,8 +1568,6 @@ class EvaluationComplexity {
case ComplexityLevel.definitelyLazy:
sb.write('lazy');
break;
default:
throw UnsupportedError("Unexpected complexity level $level");
}
return sb.toString();
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/compiler/lib/src/ir/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ AsyncMarker getAsyncMarker(ir.FunctionNode node) {
return AsyncMarker.SYNC;
case ir.AsyncMarker.SyncStar:
return AsyncMarker.SYNC_STAR;
default:
throw UnsupportedError(
"Async marker ${node.asyncMarker} is not supported.");
}
}

Expand Down
19 changes: 18 additions & 1 deletion pkg/compiler/lib/src/js_backend/enqueuer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,24 @@ class CodegenEnqueuer extends Enqueuer {
// TODO(johnniwinther): Should this be tracked with _MemberUsage ?
listener.registerUsedElement(staticUse.element as MemberEntity);
break;
default:
case StaticUseKind.CALL_METHOD:
case StaticUseKind.CLOSURE:
case StaticUseKind.CLOSURE_CALL:
case StaticUseKind.DIRECT_INVOKE:
case StaticUseKind.FIELD_CONSTANT_INIT:
case StaticUseKind.FIELD_INIT:
case StaticUseKind.INSTANCE_FIELD_GET:
case StaticUseKind.INSTANCE_FIELD_SET:
case StaticUseKind.STATIC_GET:
case StaticUseKind.STATIC_INVOKE:
case StaticUseKind.STATIC_SET:
case StaticUseKind.STATIC_TEAR_OFF:
case StaticUseKind.SUPER_FIELD_SET:
case StaticUseKind.SUPER_GET:
case StaticUseKind.SUPER_INVOKE:
case StaticUseKind.SUPER_SETTER_SET:
case StaticUseKind.SUPER_TEAR_OFF:
case StaticUseKind.WEAK_STATIC_TEAR_OFF:
break;
}
});
Expand Down
18 changes: 17 additions & 1 deletion pkg/compiler/lib/src/js_backend/impact_transformer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,20 @@ class CodegenImpactTransformer {
_closedWorld.outputUnitData.registerConstantDeferredUse(
constantUse.value as DeferredGlobalConstantValue);
break;
default:
case ConstantValueKind.BOOL:
case ConstantValueKind.DOUBLE:
case ConstantValueKind.DUMMY_INTERCEPTOR:
case ConstantValueKind.FUNCTION:
case ConstantValueKind.INT:
case ConstantValueKind.INTERCEPTOR:
case ConstantValueKind.JAVASCRIPT_OBJECT:
case ConstantValueKind.JS_NAME:
case ConstantValueKind.LATE_SENTINEL:
case ConstantValueKind.NULL:
case ConstantValueKind.RECORD:
case ConstantValueKind.STRING:
case ConstantValueKind.TYPE:
case ConstantValueKind.UNREACHABLE:
break;
}
}
Expand Down Expand Up @@ -175,6 +188,9 @@ class CodegenImpactTransformer {
_impacts.asyncStarBody
.registerImpact(transformed, _elementEnvironment);
break;
case AsyncMarker.SYNC:
// No implicit impacts.
break;
}
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/compiler/lib/src/js_backend/namer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1988,9 +1988,6 @@ abstract class ModularNamer {
return asName(fixedNames.recordShapeTag);
case JsGetName.RECORD_SHAPE_TYPE_PROPERTY:
return asName(fixedNames.recordShapeRecipe);
default:
throw failedAt(spannable ?? CURRENT_ELEMENT_SPANNABLE,
'Error: Namer has no name for "$name".');
}
}
}
Expand Down
31 changes: 17 additions & 14 deletions pkg/compiler/lib/src/js_backend/specialized_checks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../js_backend/interceptor_data.dart' show InterceptorData;
import '../js_model/js_world.dart' show JClosedWorld;
import '../universe/class_hierarchy.dart' show ClassHierarchy;

enum _Kind {
enum IsTestSpecializationKind {
isNull,
isNotNull,
isString,
Expand All @@ -22,27 +22,30 @@ enum _Kind {
}

class IsTestSpecialization {
static const isNull = IsTestSpecialization._(_Kind.isNull);
static const isNotNull = IsTestSpecialization._(_Kind.isNotNull);
static const isString = IsTestSpecialization._(_Kind.isString);
static const isBool = IsTestSpecialization._(_Kind.isBool);
static const isNum = IsTestSpecialization._(_Kind.isNum);
static const isInt = IsTestSpecialization._(_Kind.isInt);
static const isArrayTop = IsTestSpecialization._(_Kind.isArrayTop);

final _Kind _kind;
static const isNull = IsTestSpecialization._(IsTestSpecializationKind.isNull);
static const isNotNull =
IsTestSpecialization._(IsTestSpecializationKind.isNotNull);
static const isString =
IsTestSpecialization._(IsTestSpecializationKind.isString);
static const isBool = IsTestSpecialization._(IsTestSpecializationKind.isBool);
static const isNum = IsTestSpecialization._(IsTestSpecializationKind.isNum);
static const isInt = IsTestSpecialization._(IsTestSpecializationKind.isInt);
static const isArrayTop =
IsTestSpecialization._(IsTestSpecializationKind.isArrayTop);

final IsTestSpecializationKind kind;
final InterfaceType? _type;

const IsTestSpecialization._(this._kind) : _type = null;
const IsTestSpecialization._(this.kind) : _type = null;

const IsTestSpecialization._instanceof(InterfaceType type)
: _kind = _Kind.isInstanceof,
: kind = IsTestSpecializationKind.isInstanceof,
_type = type;

bool get isInstanceof => _kind == _Kind.isInstanceof;
bool get isInstanceof => kind == IsTestSpecializationKind.isInstanceof;

InterfaceType get interfaceType {
assert(_kind == _Kind.isInstanceof);
assert(kind == IsTestSpecializationKind.isInstanceof);
return _type!;
}
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/compiler/lib/src/js_model/closure.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ class ClosureDataImpl implements ClosureData {
const CapturedScope();
case MemberKind.parameterStub:
return const CapturedScope();
default:
case MemberKind.closureField:
case MemberKind.generatorBody:
case MemberKind.recordGetter:
throw failedAt(entity, "Unexpected member definition $definition");
}
}
Expand Down
7 changes: 6 additions & 1 deletion pkg/compiler/lib/src/js_model/element_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,12 @@ void forEachOrderedParameter(JsToElementMap elementMap, FunctionEntity function,
forEachOrderedParameterByFunctionNode(
node.function, parameterStructure, handleParameter);
return;
default:
case MemberKind.closureField:
case MemberKind.generatorBody:
case MemberKind.recordGetter:
case MemberKind.signature:
case MemberKind.parameterStub:
break;
}
failedAt(function, "Unexpected function definition $definition.");
}
Expand Down
9 changes: 8 additions & 1 deletion pkg/compiler/lib/src/js_model/element_map_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,14 @@ class JsKernelToElementMap implements JsToElementMap, IrToElementMap {
methodMap[node as ir.Procedure] = member as JFunction;
}
break;
default:
case MemberKind.closureCall:
case MemberKind.closureField:
case MemberKind.constructorBody:
case MemberKind.generatorBody:
case MemberKind.recordGetter:
case MemberKind.signature:
case MemberKind.parameterStub:
break;
}
}
source.end(memberTag);
Expand Down
3 changes: 2 additions & 1 deletion pkg/compiler/lib/src/kernel/front_end_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ void reportFrontEndMessage(
case fe.Severity.info:
reporter.reportInfo(mainMessage, infos);
break;
default:
case fe.Severity.context:
case fe.Severity.ignored:
throw UnimplementedError('unhandled severity ${message.severity}');
}
}
20 changes: 19 additions & 1 deletion pkg/compiler/lib/src/resolution/enqueuer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,25 @@ class ResolutionEnqueuer extends Enqueuer {
constructor: staticUse.element as ConstructorEntity?,
globalDependency: false);
break;
default:
case StaticUseKind.STATIC_TEAR_OFF:
case StaticUseKind.SUPER_TEAR_OFF:
case StaticUseKind.SUPER_FIELD_SET:
case StaticUseKind.SUPER_GET:
case StaticUseKind.SUPER_SETTER_SET:
case StaticUseKind.SUPER_INVOKE:
case StaticUseKind.INSTANCE_FIELD_GET:
case StaticUseKind.INSTANCE_FIELD_SET:
case StaticUseKind.CLOSURE:
case StaticUseKind.CLOSURE_CALL:
case StaticUseKind.CALL_METHOD:
case StaticUseKind.DIRECT_INVOKE:
case StaticUseKind.INLINING:
case StaticUseKind.STATIC_INVOKE:
case StaticUseKind.STATIC_GET:
case StaticUseKind.STATIC_SET:
case StaticUseKind.FIELD_INIT:
case StaticUseKind.FIELD_CONSTANT_INIT:
case StaticUseKind.WEAK_STATIC_TEAR_OFF:
break;
}
});
Expand Down
3 changes: 0 additions & 3 deletions pkg/compiler/lib/src/source_file_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,6 @@ class RandomAccessFileOutputProvider implements api.CompilerOutput {
}
uri = out!.resolve('$name.$extension');
break;
default:
onFailure('Unknown output type: $type');
throw StateError('unreachable');
}
return uri;
}
Expand Down
20 changes: 15 additions & 5 deletions pkg/compiler/lib/src/ssa/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -971,12 +971,19 @@ class KernelSsaGraphBuilder extends ir.VisitorDefault<void>
constructorData, field.enclosingClass!);

MemberDefinition definition = _elementMap.getMemberDefinition(field);
late final ir.Field node;
ir.Field node;
switch (definition.kind) {
case MemberKind.regular:
node = definition.node as ir.Field;
break;
default:
case MemberKind.constructor:
case MemberKind.constructorBody:
case MemberKind.closureCall:
case MemberKind.closureField:
case MemberKind.signature:
case MemberKind.generatorBody:
case MemberKind.recordGetter:
case MemberKind.parameterStub:
failedAt(field, "Unexpected member definition $definition.");
}

Expand Down Expand Up @@ -5118,7 +5125,7 @@ class KernelSsaGraphBuilder extends ir.VisitorDefault<void>
String typesAccess = _emitter.generateEmbeddedGlobalAccessString(TYPES);
return js.js.expressionTemplateFor("$typesAccess[#]");

default:
case JsBuiltin.isJsInteropTypeArgument:
reporter.internalError(
NO_LOCATION_SPANNABLE, "Unhandled Builtin: $builtin");
return null;
Expand Down Expand Up @@ -6857,8 +6864,11 @@ class KernelSsaGraphBuilder extends ir.VisitorDefault<void>
final node = definition.node as ir.LocalFunction;
node.function.body!.accept(this);
return;
default:
break;
case MemberKind.closureField:
case MemberKind.generatorBody:
case MemberKind.recordGetter:
case MemberKind.signature:
case MemberKind.parameterStub:
}
failedAt(function, "Unexpected inlined function: $definition");
}
Expand Down
Loading

0 comments on commit 9edeb52

Please sign in to comment.