| Index: runtime/vm/parser.cc
|
| diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
|
| index e20ff435075b15f3315162a21f60b7f66545722c..40bc39ed53be57eda6367f55a1991cca8590682f 100644
|
| --- a/runtime/vm/parser.cc
|
| +++ b/runtime/vm/parser.cc
|
| @@ -3967,7 +3967,7 @@ void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) {
|
| if (library_.is_dart_scheme() && library_.IsPrivate(*method->name)) {
|
| func.set_is_reflectable(false);
|
| }
|
| - if (method->metadata_pos > 0) {
|
| + if (FLAG_enable_mirrors && (method->metadata_pos > 0)) {
|
| library_.AddFunctionMetadata(func, method->metadata_pos);
|
| }
|
| if (method->has_native) {
|
| @@ -4067,7 +4067,7 @@ void Parser::ParseFieldDefinition(ClassDesc* members, MemberDesc* field) {
|
| class_field.set_has_initializer(has_initializer);
|
| members->AddField(class_field);
|
| field->field_ = &class_field;
|
| - if (field->metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (field->metadata_pos >= 0)) {
|
| library_.AddFieldMetadata(class_field, field->metadata_pos);
|
| }
|
|
|
| @@ -4464,7 +4464,7 @@ void Parser::ParseEnumDeclaration(const GrowableObjectArray& pending_classes,
|
| library_.AddClass(cls);
|
| cls.set_is_synthesized_class();
|
| cls.set_is_enum_class();
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddClassMetadata(cls, tl_owner, metadata_pos);
|
| }
|
| cls.set_super_type(Type::Handle(Z, Type::ObjectType()));
|
| @@ -4587,7 +4587,7 @@ void Parser::ParseClassDeclaration(const GrowableObjectArray& pending_classes,
|
| if (is_abstract) {
|
| cls.set_is_abstract();
|
| }
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddClassMetadata(cls, tl_owner, metadata_pos);
|
| }
|
|
|
| @@ -5020,7 +5020,7 @@ void Parser::ParseMixinAppAlias(
|
| }
|
| ExpectSemicolon();
|
| pending_classes.Add(mixin_application, Heap::kOld);
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddClassMetadata(mixin_application, tl_owner, metadata_pos);
|
| }
|
| }
|
| @@ -5186,7 +5186,7 @@ void Parser::ParseTypedef(const GrowableObjectArray& pending_classes,
|
| ASSERT(!function_type_alias.IsCanonicalSignatureClass());
|
| ASSERT(!function_type_alias.is_finalized());
|
| pending_classes.Add(function_type_alias, Heap::kOld);
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddClassMetadata(function_type_alias,
|
| tl_owner,
|
| metadata_pos);
|
| @@ -5309,7 +5309,7 @@ void Parser::ParseTypeParameters(const Class& cls) {
|
| declaration_pos);
|
| type_parameters_array.Add(
|
| &AbstractType::ZoneHandle(Z, type_parameter.raw()));
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddTypeParameterMetadata(type_parameter, metadata_pos);
|
| }
|
| index++;
|
| @@ -5468,7 +5468,7 @@ void Parser::ParseTopLevelVariable(TopLevel* top_level,
|
| field.SetStaticValue(Object::null_instance(), true);
|
| top_level->AddField(field);
|
| library_.AddObject(field, var_name);
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddFieldMetadata(field, metadata_pos);
|
| }
|
| if (CurrentToken() == Token::kASSIGN) {
|
| @@ -5659,7 +5659,7 @@ void Parser::ParseTopLevelFunction(TopLevel* top_level,
|
| toplevel_cls.RemoveFunction(replaced_func);
|
| library_.ReplaceObject(func, func_name);
|
| }
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddFunctionMetadata(func, metadata_pos);
|
| }
|
| }
|
| @@ -5824,7 +5824,7 @@ void Parser::ParseTopLevelAccessor(TopLevel* top_level,
|
| toplevel_cls.RemoveFunction(replaced_func);
|
| library_.ReplaceObject(func, accessor_name);
|
| }
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddFunctionMetadata(func, metadata_pos);
|
| }
|
| }
|
| @@ -5986,7 +5986,7 @@ void Parser::ParseLibraryImportExport(const Object& tl_owner,
|
|
|
| Namespace& ns = Namespace::Handle(Z,
|
| Namespace::New(library, show_names, hide_names));
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| ns.AddMetadata(tl_owner, metadata_pos);
|
| }
|
|
|
| @@ -6072,7 +6072,7 @@ void Parser::ParseLibraryDefinition(const Object& tl_owner) {
|
| ReportError("patch cannot override library name");
|
| }
|
| ParseLibraryName();
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddLibraryMetadata(tl_owner, metadata_pos);
|
| }
|
| rewind_pos = TokenPos();
|
| @@ -7661,7 +7661,7 @@ AstNode* Parser::ParseFunctionStatement(bool is_literal) {
|
| innermost_function(),
|
| function_pos);
|
| function.set_result_type(result_type);
|
| - if (metadata_pos >= 0) {
|
| + if (FLAG_enable_mirrors && (metadata_pos >= 0)) {
|
| library_.AddFunctionMetadata(function, metadata_pos);
|
| }
|
| }
|
|
|