Version 2.13.0-61.0.dev
Merge commit '79de274398064e96b5fe9c7a5fc715e6c82d1c5c' into 'dev'
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0d6142e..a508ebd 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -11,7 +11,7 @@
click that icon to report a bug on the page.
* To report an API doc bug,
[create an SDK issue](https://github.com/dart-lang/sdk/issues/new?title=API%20doc%20issue:).
- * Contribute to the Dart developer websites such as [dart.dev](https://dart.dev) (repo: [dart-lang/site-www](https://github.com/dart-lang/site-www)) and [dart.dev/web](https://dart.dev/web) (repo: [dart-lang/site-webdev](https://github.com/dart-lang/site-webdev)). For more information, see [Writing for Dart and Flutter websites](https://github.com/dart-lang/site-shared/wiki/Writing-for-Dart-and-Flutter-websites).
+ * Contribute to the Dart developer websites such as [dart.dev](https://dart.dev) (repo: [dart-lang/site-www](https://github.com/dart-lang/site-www)) and [dart.dev/web](https://dart.dev/web) (repo: [dart-lang/site-www/src/web](https://github.com/dart-lang/site-www/tree/master/src/web)). For more information, see [Writing for Dart and Flutter websites](https://github.com/dart-lang/site-shared/wiki/Writing-for-Dart-and-Flutter-websites).
* Improve the API reference docs at [api.dart.dev](https://api.dart.dev) by editing doc comments in the [Dart SDK repo](https://github.com/dart-lang/sdk/tree/master/sdk/lib). For more information on how to write API docs, see [Effective Dart: Documentation](https://dart.dev/guides/language/effective-dart/documentation).
## Before you contribute
diff --git a/pkg/front_end/testcases/incremental/changing_modules_2.yaml.world.1.expect b/pkg/front_end/testcases/incremental/changing_modules_2.yaml.world.1.expect
index 41e48cc..ad8a087 100644
--- a/pkg/front_end/testcases/incremental/changing_modules_2.yaml.world.1.expect
+++ b/pkg/front_end/testcases/incremental/changing_modules_2.yaml.world.1.expect
@@ -6,8 +6,8 @@
}
library from "package:foo/foo.dart" as foo {
additionalExports = (a::example,
- a::a,
- a::example)
+ a::example,
+ a::a)
export "package:example/a.dart";
diff --git a/pkg/front_end/testcases/incremental/changing_modules_2.yaml.world.2.expect b/pkg/front_end/testcases/incremental/changing_modules_2.yaml.world.2.expect
index 41e48cc..ad8a087 100644
--- a/pkg/front_end/testcases/incremental/changing_modules_2.yaml.world.2.expect
+++ b/pkg/front_end/testcases/incremental/changing_modules_2.yaml.world.2.expect
@@ -6,8 +6,8 @@
}
library from "package:foo/foo.dart" as foo {
additionalExports = (a::example,
- a::a,
- a::example)
+ a::example,
+ a::a)
export "package:example/a.dart";
diff --git a/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.1.expect b/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.1.expect
index 83a60c98..cc2970c 100644
--- a/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.1.expect
+++ b/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.1.expect
@@ -10,8 +10,8 @@
}
library from "org-dartlang-test:///libExporter.dart" as lib2 {
additionalExports = (lib::libField,
- lib::requireStuffFromLibExporter,
- lib::libField)
+ lib::libField,
+ lib::requireStuffFromLibExporter)
export "org-dartlang-test:///lib.dart";
diff --git a/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.2.expect b/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.2.expect
index 83a60c98..cc2970c 100644
--- a/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.2.expect
+++ b/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.2.expect
@@ -10,8 +10,8 @@
}
library from "org-dartlang-test:///libExporter.dart" as lib2 {
additionalExports = (lib::libField,
- lib::requireStuffFromLibExporter,
- lib::libField)
+ lib::libField,
+ lib::requireStuffFromLibExporter)
export "org-dartlang-test:///lib.dart";
diff --git a/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.3.expect b/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.3.expect
index 83a60c98..cc2970c 100644
--- a/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.3.expect
+++ b/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.3.expect
@@ -10,8 +10,8 @@
}
library from "org-dartlang-test:///libExporter.dart" as lib2 {
additionalExports = (lib::libField,
- lib::requireStuffFromLibExporter,
- lib::libField)
+ lib::libField,
+ lib::requireStuffFromLibExporter)
export "org-dartlang-test:///lib.dart";
diff --git a/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.4.expect b/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.4.expect
index 83a60c98..cc2970c 100644
--- a/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.4.expect
+++ b/pkg/front_end/testcases/incremental/no_outline_change_43.yaml.world.4.expect
@@ -10,8 +10,8 @@
}
library from "org-dartlang-test:///libExporter.dart" as lib2 {
additionalExports = (lib::libField,
- lib::requireStuffFromLibExporter,
- lib::libField)
+ lib::libField,
+ lib::requireStuffFromLibExporter)
export "org-dartlang-test:///lib.dart";
diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md
index d9daf4b..529d2c76 100644
--- a/pkg/kernel/binary.md
+++ b/pkg/kernel/binary.md
@@ -147,7 +147,7 @@
type ComponentFile {
UInt32 magic = 0x90ABCDEF;
- UInt32 formatVersion = 56;
+ UInt32 formatVersion = 55;
Byte[10] shortSdkHash;
List<String> problemsAsJson; // Described in problems.md.
Library[] libraries;
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
index 02d356e..54dae35 100644
--- a/pkg/kernel/lib/binary/ast_from_binary.dart
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -678,6 +678,8 @@
for (CanonicalName child in parentChildren) {
if (child.name != '@methods' &&
child.name != '@typedefs' &&
+ child.name != '@fields' &&
+ child.name != '@=fields' &&
child.name != '@getters' &&
child.name != '@setters' &&
child.name != '@factories' &&
diff --git a/pkg/kernel/lib/binary/tag.dart b/pkg/kernel/lib/binary/tag.dart
index 57c0a74..4653eec 100644
--- a/pkg/kernel/lib/binary/tag.dart
+++ b/pkg/kernel/lib/binary/tag.dart
@@ -173,7 +173,7 @@
/// Internal version of kernel binary format.
/// Bump it when making incompatible changes in kernel binaries.
/// Keep in sync with runtime/vm/kernel_binary.h, pkg/kernel/binary.md.
- static const int BinaryFormatVersion = 56;
+ static const int BinaryFormatVersion = 55;
}
abstract class ConstantTag {
diff --git a/pkg/kernel/lib/canonical_name.dart b/pkg/kernel/lib/canonical_name.dart
index 0b9d2c6..af7344e 100644
--- a/pkg/kernel/lib/canonical_name.dart
+++ b/pkg/kernel/lib/canonical_name.dart
@@ -30,14 +30,9 @@
/// "@constructors"
/// Qualified name
///
-/// Field or the implicit getter of a field:
+/// Field:
/// Canonical name of enclosing class or library
-/// "@getters"
-/// Qualified name
-///
-/// Implicit setter of a field:
-/// Canonical name of enclosing class or library
-/// "@setters"
+/// "@fields"
/// Qualified name
///
/// Typedef:
@@ -137,11 +132,11 @@
}
CanonicalName getChildFromField(Field field) {
- return getChild('@getters').getChildFromQualifiedName(field.name!);
+ return getChild('@fields').getChildFromQualifiedName(field.name!);
}
CanonicalName getChildFromFieldSetter(Field field) {
- return getChild('@setters').getChildFromQualifiedName(field.name!);
+ return getChild('@=fields').getChildFromQualifiedName(field.name!);
}
CanonicalName getChildFromConstructor(Constructor constructor) {
@@ -156,11 +151,11 @@
}
CanonicalName getChildFromFieldWithName(Name name) {
- return getChild('@getters').getChildFromQualifiedName(name);
+ return getChild('@fields').getChildFromQualifiedName(name);
}
CanonicalName getChildFromFieldSetterWithName(Name name) {
- return getChild('@setters').getChildFromQualifiedName(name);
+ return getChild('@=fields').getChildFromQualifiedName(name);
}
CanonicalName getChildFromTypedef(Typedef typedef_) {
diff --git a/pkg/kernel/test/convert_field_to_setter_getter.dart b/pkg/kernel/test/convert_field_to_setter_getter.dart
index 1ae22d8..8cc17a4 100644
--- a/pkg/kernel/test/convert_field_to_setter_getter.dart
+++ b/pkg/kernel/test/convert_field_to_setter_getter.dart
@@ -37,14 +37,12 @@
List<int> writtenBytesFieldOriginal = serialize(lib1, lib2);
// Canonical names are now set: Verify that the field is marked as such,
// canonical-name-wise.
- String getterCanonicalName = '${field.getterCanonicalName}';
- if (field.getterCanonicalName.parent.name != "@getters") {
- throw "Expected @getters parent, but had "
+ if (field.getterCanonicalName.parent.name != "@fields") {
+ throw "Expected @fields parent, but had "
"${field.getterCanonicalName.parent.name}";
}
- String setterCanonicalName = '${field.setterCanonicalName}';
- if (field.setterCanonicalName.parent.name != "@setters") {
- throw "Expected @setters parent, but had "
+ if (field.setterCanonicalName.parent.name != "@=fields") {
+ throw "Expected @=fields parent, but had "
"${field.setterCanonicalName.parent.name}";
}
@@ -82,18 +80,10 @@
throw "Expected @getters parent, but had "
"${getter.canonicalName.parent.name}";
}
- if ('${getter.canonicalName}' != getterCanonicalName) {
- throw "Unexpected getter canonical name. "
- "Expected $getterCanonicalName, actual ${getter.canonicalName}.";
- }
if (setter.canonicalName.parent.name != "@setters") {
throw "Expected @setters parent, but had "
"${setter.canonicalName.parent.name}";
}
- if ('${setter.canonicalName}' != setterCanonicalName) {
- throw "Unexpected setter canonical name. "
- "Expected $setterCanonicalName, actual ${setter.canonicalName}.";
- }
// Replace getter/setter with field.
lib1.procedures.remove(getter);
@@ -111,12 +101,12 @@
List<int> writtenBytesFieldNew = serialize(lib1, lib2);
// Canonical names are now set: Verify that the field is marked as such,
// canonical-name-wise.
- if (fieldReplacement.getterCanonicalName.parent.name != "@getters") {
- throw "Expected @getters parent, but had "
+ if (fieldReplacement.getterCanonicalName.parent.name != "@fields") {
+ throw "Expected @fields parent, but had "
"${fieldReplacement.getterCanonicalName.parent.name}";
}
- if (fieldReplacement.setterCanonicalName.parent.name != "@setters") {
- throw "Expected @setters parent, but had "
+ if (fieldReplacement.setterCanonicalName.parent.name != "@=fields") {
+ throw "Expected @=fields parent, but had "
"${fieldReplacement.setterCanonicalName.parent.name}";
}
diff --git a/pkg/kernel/test/text_serializer_from_kernel_nodes_test.dart b/pkg/kernel/test/text_serializer_from_kernel_nodes_test.dart
index 25be591..41daa56 100644
--- a/pkg/kernel/test/text_serializer_from_kernel_nodes_test.dart
+++ b/pkg/kernel/test/text_serializer_from_kernel_nodes_test.dart
@@ -133,7 +133,7 @@
name: '/* suppose top-level: dynamic field; */ field;',
node: new ExpressionStatement(new StaticGet(field)),
expectation: ''
- '(expr (get-static "package:foo/bar.dart::@getters::field"))',
+ '(expr (get-static "package:foo/bar.dart::@fields::field"))',
makeSerializationState: () => new SerializationState(null),
makeDeserializationState: () =>
new DeserializationState(null, component.root),
@@ -151,7 +151,7 @@
name: '/* suppose top-level: dynamic field; */ field;',
node: new ExpressionStatement(new StaticGet(field)),
expectation: ''
- '(expr (get-static "package:foo/bar.dart::@getters::field"))',
+ '(expr (get-static "package:foo/bar.dart::@fields::field"))',
makeSerializationState: () => new SerializationState(null),
makeDeserializationState: () =>
new DeserializationState(null, component.root),
@@ -171,7 +171,7 @@
new ExpressionStatement(new StaticSet(field, new IntLiteral(1))),
expectation: ''
'(expr'
- ' (set-static "package:foo/bar.dart::@setters::field" (int 1)))',
+ ' (set-static "package:foo/bar.dart::@=fields::field" (int 1)))',
makeSerializationState: () => new SerializationState(null),
makeDeserializationState: () =>
new DeserializationState(null, component.root),
diff --git a/pkg/vm/lib/transformations/ffi_definitions.dart b/pkg/vm/lib/transformations/ffi_definitions.dart
index 8371488..586d009 100644
--- a/pkg/vm/lib/transformations/ffi_definitions.dart
+++ b/pkg/vm/lib/transformations/ffi_definitions.dart
@@ -510,29 +510,17 @@
List<Procedure> _generateMethodsForField(Field field, NativeTypeCfe type,
Map<Abi, int> offsets, IndexedClass indexedClass) {
- // TODO(johnniwinther): Avoid passing [indexedClass]. When compiling
- // incrementally, [field] should already carry the references from
- // [indexedClass].
final getterStatement = type.generateGetterStatement(
field.type, field.fileOffset, offsets, this);
- Reference getterReference =
- indexedClass?.lookupGetterReference(field.name) ??
- field.getterReference;
- assert(getterReference == field.getterReference,
- "Unexpected getter reference for ${field}, found $getterReference.");
final Procedure getter = Procedure(field.name, ProcedureKind.Getter,
FunctionNode(getterStatement, returnType: field.type),
- fileUri: field.fileUri, reference: getterReference)
+ fileUri: field.fileUri,
+ reference: indexedClass?.lookupGetterReference(field.name))
..fileOffset = field.fileOffset
..isNonNullableByDefault = field.isNonNullableByDefault;
Procedure setter = null;
if (!field.isFinal) {
- Reference setterReference =
- indexedClass?.lookupSetterReference(field.name) ??
- field.setterReference;
- assert(setterReference == field.setterReference,
- "Unexpected setter reference for ${field}, found $setterReference.");
final VariableDeclaration argument =
VariableDeclaration('#v', type: field.type)
..fileOffset = field.fileOffset;
@@ -544,7 +532,7 @@
FunctionNode(setterStatement,
returnType: VoidType(), positionalParameters: [argument]),
fileUri: field.fileUri,
- reference: setterReference)
+ reference: indexedClass?.lookupSetterReference(field.name))
..fileOffset = field.fileOffset
..isNonNullableByDefault = field.isNonNullableByDefault;
}
diff --git a/pkg/vm/lib/transformations/type_flow/transformer.dart b/pkg/vm/lib/transformations/type_flow/transformer.dart
index da4ca73..ac88a41 100644
--- a/pkg/vm/lib/transformations/type_flow/transformer.dart
+++ b/pkg/vm/lib/transformations/type_flow/transformer.dart
@@ -1324,12 +1324,7 @@
if (!shaker.isMemberUsed(node) && !_preserveSpecialMember(node)) {
// Ensure that kernel file writer will not be able to
// write a dangling reference to the deleted member.
- if (node is Field) {
- node.getterCanonicalName?.reference = null;
- node.setterCanonicalName?.reference = null;
- } else {
- node.canonicalName?.reference = null;
- }
+ node.reference.canonicalName = null;
Statistics.membersDropped++;
return removalSentinel;
}
diff --git a/runtime/vm/compiler/frontend/constant_reader.cc b/runtime/vm/compiler/frontend/constant_reader.cc
index 7c0d3ad..f968c45 100644
--- a/runtime/vm/compiler/frontend/constant_reader.cc
+++ b/runtime/vm/compiler/frontend/constant_reader.cc
@@ -264,8 +264,7 @@
Field& field = Field::Handle(Z);
Instance& constant = Instance::Handle(Z);
for (intptr_t j = 0; j < number_of_fields; ++j) {
- field = H.LookupFieldByKernelGetterOrSetter(
- reader.ReadCanonicalNameReference());
+ field = H.LookupFieldByKernelField(reader.ReadCanonicalNameReference());
// Recurse into lazily evaluating all "sub" constants
// needed to evaluate the current constant.
const intptr_t entry_offset = reader.ReadUInt();
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index 7fda645..1bb096e 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -237,7 +237,7 @@
ReadBool();
const NameIndex field_name = ReadCanonicalNameReference();
const Field& field =
- Field::Handle(Z, H.LookupFieldByKernelGetterOrSetter(field_name));
+ Field::Handle(Z, H.LookupFieldByKernelField(field_name));
initializer_fields[i] = &field;
SkipExpression();
continue;
@@ -2180,7 +2180,8 @@
const Function* tearoff_interface_target = &Function::null_function();
const NameIndex itarget_name =
ReadInterfaceMemberNameReference(); // read interface_target_reference.
- if (!H.IsRoot(itarget_name) && H.IsGetter(itarget_name)) {
+ if (!H.IsRoot(itarget_name) &&
+ (H.IsGetter(itarget_name) || H.IsField(itarget_name))) {
interface_target = &Function::ZoneHandle(
Z,
H.LookupMethodByMember(itarget_name, H.DartGetterName(itarget_name)));
@@ -2548,11 +2549,10 @@
inferred_type_metadata_helper_.GetInferredType(offset);
NameIndex target = ReadCanonicalNameReference(); // read target_reference.
- ASSERT(H.IsGetter(target));
- const Field& field = Field::ZoneHandle(
- Z, H.LookupFieldByKernelGetterOrSetter(target, /*required=*/false));
- if (!field.IsNull()) {
+ if (H.IsField(target)) {
+ const Field& field =
+ Field::ZoneHandle(Z, H.LookupFieldByKernelField(target));
if (field.is_const()) {
// Since the CFE inlines all references to const variables and fields,
// it never emits a StaticGet of a const field.
@@ -2605,39 +2605,44 @@
if (p != NULL) *p = position;
NameIndex target = ReadCanonicalNameReference(); // read target_reference.
- ASSERT(H.IsSetter(target));
- // Evaluate the expression on the right hand side.
- Fragment instructions = BuildExpression(); // read expression.
+ if (H.IsField(target)) {
+ const Field& field =
+ Field::ZoneHandle(Z, H.LookupFieldByKernelField(target));
+ const Class& owner = Class::Handle(Z, field.Owner());
+ const String& setter_name = H.DartSetterName(target);
+ const Function& setter =
+ Function::ZoneHandle(Z, owner.LookupStaticFunction(setter_name));
+ Fragment instructions = BuildExpression(); // read expression.
+ if (NeedsDebugStepCheck(stack(), position)) {
+ instructions = DebugStepCheck(position) + instructions;
+ }
+ LocalVariable* variable = MakeTemporary();
+ instructions += LoadLocal(variable);
+ if (!setter.IsNull() && field.NeedsSetter()) {
+ instructions += StaticCall(position, setter, 1, ICData::kStatic);
+ instructions += Drop();
+ } else {
+ instructions += StoreStaticField(position, field);
+ }
+ return instructions;
+ } else {
+ ASSERT(H.IsProcedure(target));
- // Look up the target as a setter first and, if not present, as a field
- // second. This order is needed to avoid looking up a final field as the
- // target.
- const Function& function = Function::ZoneHandle(
- Z, H.LookupStaticMethodByKernelProcedure(target, /*required=*/false));
-
- if (!function.IsNull()) {
+ // Evaluate the expression on the right hand side.
+ Fragment instructions = BuildExpression(); // read expression.
LocalVariable* variable = MakeTemporary();
// Prepare argument.
instructions += LoadLocal(variable);
// Invoke the setter function.
+ const Function& function =
+ Function::ZoneHandle(Z, H.LookupStaticMethodByKernelProcedure(target));
instructions += StaticCall(position, function, 1, ICData::kStatic);
// Drop the unused result & leave the stored value on the stack.
return instructions + Drop();
- } else {
- const Field& field =
- Field::ZoneHandle(Z, H.LookupFieldByKernelGetterOrSetter(target));
- ASSERT(!field.NeedsSetter());
- if (NeedsDebugStepCheck(stack(), position)) {
- instructions = DebugStepCheck(position) + instructions;
- }
- LocalVariable* variable = MakeTemporary();
- instructions += LoadLocal(variable);
- instructions += StoreStaticField(position, field);
- return instructions;
}
}
@@ -2765,7 +2770,8 @@
// TODO(dartbug.com/34497): Once front-end desugars calls via
// fields/getters, filtering of field and getter interface targets here
// can be turned into assertions.
- if (!H.IsRoot(itarget_name) && !H.IsGetter(itarget_name)) {
+ if (!H.IsRoot(itarget_name) && !H.IsField(itarget_name) &&
+ !H.IsGetter(itarget_name)) {
interface_target = &Function::ZoneHandle(
Z, H.LookupMethodByMember(itarget_name,
H.DartProcedureName(itarget_name)));
diff --git a/runtime/vm/compiler/frontend/kernel_fingerprints.cc b/runtime/vm/compiler/frontend/kernel_fingerprints.cc
index 0e16c36..9f7415c 100644
--- a/runtime/vm/compiler/frontend/kernel_fingerprints.cc
+++ b/runtime/vm/compiler/frontend/kernel_fingerprints.cc
@@ -323,7 +323,7 @@
void KernelFingerprintHelper::CalculateGetterNameFingerprint() {
const NameIndex name = ReadCanonicalNameReference();
- if (!H.IsRoot(name) && H.IsGetter(name)) {
+ if (!H.IsRoot(name) && (H.IsGetter(name) || H.IsField(name))) {
BuildHash(H.DartGetterName(name).Hash());
}
ReadCanonicalNameReference(); // read interface_target_origin_reference
@@ -340,7 +340,7 @@
void KernelFingerprintHelper::CalculateMethodNameFingerprint() {
const NameIndex name =
ReadCanonicalNameReference(); // read interface_target_reference.
- if (!H.IsRoot(name)) {
+ if (!H.IsRoot(name) && !H.IsField(name)) {
BuildHash(H.DartProcedureName(name).Hash());
}
ReadCanonicalNameReference(); // read interface_target_origin_reference
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.cc b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
index 9f82df8..06aeae2 100644
--- a/runtime/vm/compiler/frontend/kernel_translation_helper.cc
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
@@ -235,7 +235,22 @@
}
bool TranslationHelper::IsMember(NameIndex name) {
- return IsConstructor(name) || IsProcedure(name);
+ return IsConstructor(name) || IsField(name) || IsProcedure(name);
+}
+
+bool TranslationHelper::IsField(NameIndex name) {
+ // Fields with private names have the import URI of the library where they are
+ // visible as the parent and the string "@fields" as the parent's parent.
+ // Fields with non-private names have the string "@fields' as the parent.
+ if (IsRoot(name)) {
+ return false;
+ }
+ NameIndex kind = CanonicalNameParent(name);
+ if (IsPrivate(name)) {
+ kind = CanonicalNameParent(kind);
+ }
+ return StringEquals(CanonicalNameString(kind), "@fields") ||
+ StringEquals(CanonicalNameString(kind), "@=fields");
}
bool TranslationHelper::IsConstructor(NameIndex name) {
@@ -315,7 +330,7 @@
}
NameIndex TranslationHelper::EnclosingName(NameIndex name) {
- ASSERT(IsConstructor(name) || IsProcedure(name));
+ ASSERT(IsField(name) || IsConstructor(name) || IsProcedure(name));
NameIndex enclosing = CanonicalNameParent(CanonicalNameParent(name));
if (IsPrivate(name)) {
enclosing = CanonicalNameParent(enclosing);
@@ -569,10 +584,8 @@
return info_.InsertClass(thread_, name_index_handle_, klass);
}
-FieldPtr TranslationHelper::LookupFieldByKernelGetterOrSetter(
- NameIndex kernel_field,
- bool required) {
- ASSERT(IsGetter(kernel_field) || IsSetter(kernel_field));
+FieldPtr TranslationHelper::LookupFieldByKernelField(NameIndex kernel_field) {
+ ASSERT(IsField(kernel_field));
NameIndex enclosing = EnclosingName(kernel_field);
Class& klass = Class::Handle(Z);
@@ -588,15 +601,12 @@
Field& field = Field::Handle(
Z, klass.LookupFieldAllowPrivate(
DartSymbolObfuscate(CanonicalNameString(kernel_field))));
- if (required) {
- CheckStaticLookup(field);
- }
+ CheckStaticLookup(field);
return field.ptr();
}
FunctionPtr TranslationHelper::LookupStaticMethodByKernelProcedure(
- NameIndex procedure,
- bool required) {
+ NameIndex procedure) {
const String& procedure_name = DartProcedureName(procedure);
// The parent is either a library or a class (in which case the procedure is a
@@ -607,9 +617,7 @@
Library::Handle(Z, LookupLibraryByKernelLibrary(enclosing));
Function& function =
Function::Handle(Z, library.LookupFunctionAllowPrivate(procedure_name));
- if (required) {
- CheckStaticLookup(function);
- }
+ CheckStaticLookup(function);
return function.ptr();
} else {
ASSERT(IsClass(enclosing));
@@ -618,9 +626,7 @@
ASSERT(error == Error::null());
Function& function = Function::ZoneHandle(
Z, klass.LookupFunctionAllowPrivate(procedure_name));
- if (required) {
- CheckStaticLookup(function);
- }
+ CheckStaticLookup(function);
return function.ptr();
}
}
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.h b/runtime/vm/compiler/frontend/kernel_translation_helper.h
index d5d39fe..b76603a 100644
--- a/runtime/vm/compiler/frontend/kernel_translation_helper.h
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.h
@@ -101,6 +101,7 @@
bool IsLibrary(NameIndex name);
bool IsClass(NameIndex name);
bool IsMember(NameIndex name);
+ bool IsField(NameIndex name);
bool IsConstructor(NameIndex name);
bool IsProcedure(NameIndex name);
bool IsMethod(NameIndex name);
@@ -163,10 +164,8 @@
virtual LibraryPtr LookupLibraryByKernelLibrary(NameIndex library);
virtual ClassPtr LookupClassByKernelClass(NameIndex klass);
- FieldPtr LookupFieldByKernelGetterOrSetter(NameIndex field,
- bool required = true);
- FunctionPtr LookupStaticMethodByKernelProcedure(NameIndex procedure,
- bool required = true);
+ FieldPtr LookupFieldByKernelField(NameIndex field);
+ FunctionPtr LookupStaticMethodByKernelProcedure(NameIndex procedure);
FunctionPtr LookupConstructorByKernelConstructor(NameIndex constructor);
FunctionPtr LookupConstructorByKernelConstructor(const Class& owner,
NameIndex constructor);
diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h
index 472de49..3afc431 100644
--- a/runtime/vm/kernel_binary.h
+++ b/runtime/vm/kernel_binary.h
@@ -20,8 +20,8 @@
static const uint32_t kMagicProgramFile = 0x90ABCDEFu;
// Both version numbers are inclusive.
-static const uint32_t kMinSupportedKernelFormatVersion = 56;
-static const uint32_t kMaxSupportedKernelFormatVersion = 56;
+static const uint32_t kMinSupportedKernelFormatVersion = 55;
+static const uint32_t kMaxSupportedKernelFormatVersion = 55;
// Keep in sync with package:kernel/lib/binary/tag.dart
#define KERNEL_TAG_LIST(V) \
diff --git a/tools/VERSION b/tools/VERSION
index 680a21d..739aa1d 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 13
PATCH 0
-PRERELEASE 60
+PRERELEASE 61
PRERELEASE_PATCH 0
\ No newline at end of file