Skip to content

Commit

Permalink
Version 3.3.0-159.0.dev
Browse files Browse the repository at this point in the history
Merge 613fa1f into dev
  • Loading branch information
Dart CI committed Nov 22, 2023
2 parents df958dc + 613fa1f commit 2547cf7
Show file tree
Hide file tree
Showing 56 changed files with 1,526 additions and 1,026 deletions.
13 changes: 2 additions & 11 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ vars = {
# Use a published dev version to support unstable platforms.
"sdk_tag": "version:3.2.0-150.0.dev",

# co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
# hashes.
# co19 is a cipd package automatically generated for each co19 commit.
# Use tests/co19/update.sh to update this hash.
"co19_rev": "460758bf4c298812d47b24f7e5040c75088c3ebf",
# This line prevents conflicts when both packages are rolled simultaneously.
"co19_2_rev": "d87f9096ec0a14cd7c32c33316fb2378b89d6a45",

# The internal benchmarks to use. See go/dart-benchmarks-internal
"benchmarks_internal_rev": "f048a4a853e3062056d39c3db100acdde42f16d6",
Expand Down Expand Up @@ -268,13 +266,6 @@ deps = {
}],
"dep_type": "cipd",
},
Var("dart_root") + "/tests/co19_2/src": {
"packages": [{
"package": "dart/third_party/co19/legacy",
"version": "git_revision:" + Var("co19_2_rev"),
}],
"dep_type": "cipd",
},
Var("dart_root") + "/third_party/markupsafe":
Var("chromium_git") + "/chromium/src/third_party/markupsafe.git" +
"@" + Var("markupsafe_rev"),
Expand Down
7 changes: 7 additions & 0 deletions build/rbe/linux-intel.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
service=remotebuildexecution.googleapis.com:443
instance=projects/flutter-rbe-prod/instances/default
use_application_default_credentials=true
enable_deps_cache=true
xattr_digest=user.fuchsia.rbe.digest.sha256
server_address=unix:///tmp/reproxy.sock
log_format=reducedtext
Original file line number Diff line number Diff line change
Expand Up @@ -530,16 +530,19 @@ class FunctionDeclarationImpl extends DeclarationImpl
});

@override
void serializeUncached(Serializer serializer) {
void serializeUncached(Serializer serializer, {bool isConstructor = false}) {
super.serializeUncached(serializer);

serializer
..addBool(hasBody)
..addBool(hasExternal)
..addBool(isGetter)
..addBool(isOperator)
..addBool(isSetter)
..startList();
..addBool(hasExternal);
if (!isConstructor) {
serializer
..addBool(isGetter)
..addBool(isOperator)
..addBool(isSetter);
}
serializer.startList();
for (ParameterDeclarationImpl named in namedParameters) {
named.serialize(serializer);
}
Expand Down Expand Up @@ -592,11 +595,11 @@ class MethodDeclarationImpl extends FunctionDeclarationImpl
});

@override
void serializeUncached(Serializer serializer) {
super.serializeUncached(serializer);
void serializeUncached(Serializer serializer, {bool isConstructor = false}) {
super.serializeUncached(serializer, isConstructor: isConstructor);

definingType.serialize(serializer);
serializer.addBool(isStatic);
if (!isConstructor) serializer.addBool(isStatic);
}
}

Expand All @@ -617,9 +620,6 @@ class ConstructorDeclarationImpl extends MethodDeclarationImpl
// Function fields.
required super.hasBody,
required super.hasExternal,
required super.isGetter,
required super.isOperator,
required super.isSetter,
required super.namedParameters,
required super.positionalParameters,
required super.returnType,
Expand All @@ -629,12 +629,16 @@ class ConstructorDeclarationImpl extends MethodDeclarationImpl
// Constructor fields.
required this.isFactory,
}) : super(
isGetter: false,
isOperator: false,
isSetter: false,
isStatic: true,
);

@override
void serializeUncached(Serializer serializer) {
super.serializeUncached(serializer);
void serializeUncached(Serializer serializer, {bool isConstructor = true}) {
assert(isConstructor);
super.serializeUncached(serializer, isConstructor: isConstructor);

serializer.addBool(isFactory);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,21 +235,12 @@ extension DeserializerExtensions on Deserializer {
metadata: (this..moveNext())._expectRemoteInstanceList(),
hasBody: (this..moveNext()).expectBool(),
hasExternal: (this..moveNext()).expectBool(),
isGetter: (this..moveNext()).expectBool(),
isOperator: (this..moveNext()).expectBool(),
isSetter: (this..moveNext()).expectBool(),
namedParameters: (this..moveNext())._expectRemoteInstanceList(),
positionalParameters: (this..moveNext())._expectRemoteInstanceList(),
returnType: RemoteInstance.deserialize(this),
typeParameters: (this..moveNext())._expectRemoteInstanceList(),
definingType: RemoteInstance.deserialize(this),
// There is an extra boolean here representing the `isStatic` field
// which we just skip past.
isFactory: (this
..moveNext()
..expectBool()
..moveNext())
.expectBool(),
isFactory: (this..moveNext()).expectBool(),
);

VariableDeclarationImpl _expectVariableDeclaration(int id) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,6 @@ class LibraryInfo {
result.libraryAugmentations.single.debugString().toString(),
equalsIgnoringWhitespace('''
augment String myFunction() {
print('isAbstract: false');
print('isExternal: false');
print('isGetter: false');
print('isSetter: false');
Expand Down Expand Up @@ -703,7 +702,6 @@ class LibraryInfo {
result.libraryAugmentations.single.debugString().toString(),
equalsIgnoringWhitespace('''
augment String get myVariable {
print('isAbstract: false');
print('isExternal: false');
print('isGetter: true');
print('isSetter: false');
Expand All @@ -725,7 +723,6 @@ class LibraryInfo {
result.libraryAugmentations.single.debugString().toString(),
equalsIgnoringWhitespace('''
augment void myVariable(String value, ) {
print('isAbstract: false');
print('isExternal: false');
print('isGetter: false');
print('isSetter: true');
Expand Down Expand Up @@ -828,7 +825,6 @@ class LibraryInfo {
augment MyEnum.myEnumConstructor(String myField, ) {
print('definingClass: MyEnum');
print('isFactory: false');
print('isAbstract: false');
print('isExternal: false');
print('isGetter: false');
print('isSetter: false');
Expand Down Expand Up @@ -963,7 +959,6 @@ final constructorDefinitionMatcher = equalsIgnoringWhitespace('''
augment MyClass.myConstructor(/*inferred*/String myField, ) {
print('definingClass: MyClass');
print('isFactory: false');
print('isAbstract: false');
print('isExternal: false');
print('isGetter: false');
print('isSetter: false');
Expand All @@ -976,6 +971,7 @@ final fieldDefinitionMatchers = [
equalsIgnoringWhitespace('''
augment String get myField {
print('parentClass: MyClass');
print('isAbstract: false');
print('isExternal: false');
print('isFinal: false');
print('isLate: false');
Expand All @@ -993,7 +989,6 @@ final methodDefinitionMatchers = [
equalsIgnoringWhitespace('''
augment (String, bool? hello, {String world}) myMethod() {
print('definingClass: MyClass');
print('isAbstract: false');
print('isExternal: false');
print('isGetter: false');
print('isSetter: false');
Expand Down Expand Up @@ -1024,7 +1019,6 @@ final mixinMethodDefinitionMatchers = [
equalsIgnoringWhitespace('''
augment (String, bool? hello, {String world}) myMixinMethod() {
print('definingClass: MyMixin');
print('isAbstract: false');
print('isExternal: false');
print('isGetter: false');
print('isSetter: false');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,6 @@ void main() {
metadata: [],
hasBody: true,
hasExternal: false,
isGetter: false,
isOperator: true,
isSetter: false,
namedParameters: [fooNamedParam],
positionalParameters: [barPositionalParam],
returnType: fooType,
Expand Down
6 changes: 0 additions & 6 deletions pkg/_fe_analyzer_shared/test/macros/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,6 @@ class Fixtures {
metadata: [],
hasBody: true,
hasExternal: false,
isGetter: false,
isOperator: false,
isSetter: false,
namedParameters: [],
positionalParameters: [
ParameterDeclarationImpl(
Expand Down Expand Up @@ -616,9 +613,6 @@ class Fixtures {
metadata: [],
hasBody: true,
hasExternal: false,
isGetter: false,
isOperator: false,
isSetter: false,
namedParameters: [],
positionalParameters: [
ParameterDeclarationImpl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,11 @@ class _EnumDescription {
constantsBuffer.write(indent);
}
if (documentationComment != null) {
constantsBuffer
.write(documentationComment.replaceAll(eol, '$eol$indent'));
constantsBuffer.write(
// Always replace '\n' because documentationComment is normalized to
// always '\n' (in `getCommentNodeRawText`).
documentationComment.replaceAll('\n', '$eol$indent'),
);
constantsBuffer.write('$eol$indent');
}
constantsBuffer.write(field.name);
Expand Down
45 changes: 45 additions & 0 deletions pkg/analyzer/PRESUBMIT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env python3
# Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Analyzer specific presubmit script.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl.
"""

import os.path
import re

USE_PYTHON3 = True
PRESUBMIT_VERSION = '2.0.0'


def CheckNodeTextExpectationsCollectorUpdatingIsDisabled(input_api, output_api):
local_root = input_api.change.RepositoryRoot()
node_text_expectations_file = os.path.join(local_root, 'pkg', 'analyzer',
'test', 'src', 'dart',
'resolution',
'node_text_expectations.dart')
for git_file in input_api.AffectedTestableFiles():
filename = git_file.AbsoluteLocalPath()
if (filename == node_text_expectations_file):
isEnabledLine = re.compile('static const updatingIsEnabled = (.*);')
for line in git_file.NewContents():
m = isEnabledLine.search(line)
if (m is not None):
value = m.group(1)
if (value == 'false'):
return []
else:
return [
output_api.PresubmitError(
'NodeTextExpectationsCollector.updatingIsEnabled '
'must be `false`')
]
return [
output_api.PresubmitError(
'Could not validate '
'NodeTextExpectationsCollector.updatingIsEnabled')
]
return []
9 changes: 0 additions & 9 deletions pkg/analyzer/lib/src/summary2/macro_declarations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ class ConstructorDeclarationImpl extends macro.ConstructorDeclarationImpl
required super.metadata,
required super.hasBody,
required super.hasExternal,
required super.isGetter,
required super.isOperator,
required super.isSetter,
required super.namedParameters,
required super.positionalParameters,
required super.returnType,
Expand Down Expand Up @@ -329,9 +326,6 @@ class DeclarationBuilderFromElement {
metadata: _buildMetadata(element),
hasBody: !element.isAbstract,
hasExternal: element.isExternal,
isGetter: false,
isOperator: false,
isSetter: false,
isFactory: element.isFactory,
namedParameters: _namedFormalParameters(element.parameters),
positionalParameters: _positionalFormalParameters(element.parameters),
Expand Down Expand Up @@ -529,9 +523,6 @@ class DeclarationBuilderFromNode {
metadata: _buildMetadata(element),
hasBody: node.body is! ast.EmptyFunctionBody,
hasExternal: node.externalKeyword != null,
isGetter: false,
isOperator: false,
isSetter: false,
isFactory: node.factoryKeyword != null,
namedParameters: _namedFormalParameters(node.parameters),
positionalParameters: _positionalFormalParameters(node.parameters),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NodeTextExpectationsCollector {
/// This should only happen locally, to update tests or implementation.
///
/// This flag should be `false` during code review.
static const updatingIsEnabled = true;
static const updatingIsEnabled = false;

static final assertMethods = [
_AssertMethod(
Expand Down
6 changes: 0 additions & 6 deletions pkg/front_end/lib/src/fasta/kernel/macro/macro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -972,9 +972,6 @@ class MacroApplications {
// TODO(johnniwinther): Real implementation of hasBody.
hasBody: true,
hasExternal: builder.isExternal,
isGetter: builder.isGetter,
isOperator: builder.isOperator,
isSetter: builder.isSetter,
positionalParameters: parameters[0],
namedParameters: parameters[1],
// TODO(johnniwinther): Support constructor return type.
Expand Down Expand Up @@ -1006,9 +1003,6 @@ class MacroApplications {
// TODO(johnniwinther): Real implementation of hasBody.
hasBody: true,
hasExternal: builder.isExternal,
isGetter: builder.isGetter,
isOperator: builder.isOperator,
isSetter: builder.isSetter,
positionalParameters: parameters[0],
namedParameters: parameters[1],
// TODO(johnniwinther): Support constructor return type.
Expand Down
28 changes: 20 additions & 8 deletions pkg/vm/lib/transformations/ffi/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1158,19 +1158,31 @@ class FfiTransformer extends Transformer {
]))
..fileOffset = fileOffset;

if (dartSignature is FunctionType) {
final returnType = dartSignature.returnType;
if (returnType is InterfaceType) {
final clazz = returnType.classNode;
if (clazz.superclass == structClass || clazz.superclass == unionClass) {
return invokeCompoundConstructor(asFunctionInternalInvocation, clazz);
}
}
final possibleCompoundReturn = findCompoundReturnType(dartSignature);
if (possibleCompoundReturn != null) {
return invokeCompoundConstructor(
asFunctionInternalInvocation, possibleCompoundReturn);
}

return asFunctionInternalInvocation;
}

/// Returns the compound [Class] if a compound is returned, otherwise `null`.
Class? findCompoundReturnType(DartType dartSignature) {
if (dartSignature is! FunctionType) {
return null;
}
final returnType = dartSignature.returnType;
if (returnType is! InterfaceType) {
return null;
}
final clazz = returnType.classNode;
if (clazz.superclass == structClass || clazz.superclass == unionClass) {
return clazz;
}
return null;
}

/// Returns
/// - `true` if leaf
/// - `false` if not leaf
Expand Down
Loading

0 comments on commit 2547cf7

Please sign in to comment.