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

Side by Side Diff: runtime/lib/mirrors.cc

Issue 363473004: Hide synthetic metadata field exposed in r35926. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "lib/invocation_mirror.h" 5 #include "lib/invocation_mirror.h"
6 #include "vm/bootstrap_natives.h" 6 #include "vm/bootstrap_natives.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 const Array& functions = Array::Handle(klass.functions()); 1050 const Array& functions = Array::Handle(klass.functions());
1051 const intptr_t num_functions = functions.Length(); 1051 const intptr_t num_functions = functions.Length();
1052 1052
1053 Instance& member_mirror = Instance::Handle(); 1053 Instance& member_mirror = Instance::Handle();
1054 const GrowableObjectArray& member_mirrors = GrowableObjectArray::Handle( 1054 const GrowableObjectArray& member_mirrors = GrowableObjectArray::Handle(
1055 GrowableObjectArray::New(num_fields + num_functions)); 1055 GrowableObjectArray::New(num_fields + num_functions));
1056 1056
1057 Field& field = Field::Handle(); 1057 Field& field = Field::Handle();
1058 for (intptr_t i = 0; i < num_fields; i++) { 1058 for (intptr_t i = 0; i < num_fields; i++) {
1059 field ^= fields.At(i); 1059 field ^= fields.At(i);
1060 member_mirror = CreateVariableMirror(field, owner_mirror); 1060 if (!field.is_synthetic()) {
1061 member_mirrors.Add(member_mirror); 1061 member_mirror = CreateVariableMirror(field, owner_mirror);
1062 member_mirrors.Add(member_mirror);
1063 }
1062 } 1064 }
1063 1065
1064 Function& func = Function::Handle(); 1066 Function& func = Function::Handle();
1065 for (intptr_t i = 0; i < num_functions; i++) { 1067 for (intptr_t i = 0; i < num_functions; i++) {
1066 func ^= functions.At(i); 1068 func ^= functions.At(i);
1067 if (func.is_visible() && 1069 if (func.is_visible() &&
1068 (func.kind() == RawFunction::kRegularFunction || 1070 (func.kind() == RawFunction::kRegularFunction ||
1069 func.kind() == RawFunction::kGetterFunction || 1071 func.kind() == RawFunction::kGetterFunction ||
1070 func.kind() == RawFunction::kSetterFunction)) { 1072 func.kind() == RawFunction::kSetterFunction)) {
1071 member_mirror = CreateMethodMirror(func, owner_mirror); 1073 member_mirror = CreateMethodMirror(func, owner_mirror);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 !klass.IsMixinApplication()) { 1140 !klass.IsMixinApplication()) {
1139 type = klass.DeclarationType(); 1141 type = klass.DeclarationType();
1140 member_mirror = CreateClassMirror(klass, 1142 member_mirror = CreateClassMirror(klass,
1141 type, 1143 type,
1142 Bool::True(), // is_declaration 1144 Bool::True(), // is_declaration
1143 owner_mirror); 1145 owner_mirror);
1144 member_mirrors.Add(member_mirror); 1146 member_mirrors.Add(member_mirror);
1145 } 1147 }
1146 } else if (entry.IsField()) { 1148 } else if (entry.IsField()) {
1147 const Field& field = Field::Cast(entry); 1149 const Field& field = Field::Cast(entry);
1148 member_mirror = CreateVariableMirror(field, owner_mirror); 1150 if (!field.is_synthetic()) {
1149 member_mirrors.Add(member_mirror); 1151 member_mirror = CreateVariableMirror(field, owner_mirror);
1152 member_mirrors.Add(member_mirror);
1153 }
1150 } else if (entry.IsFunction()) { 1154 } else if (entry.IsFunction()) {
1151 const Function& func = Function::Cast(entry); 1155 const Function& func = Function::Cast(entry);
1152 if (func.kind() == RawFunction::kRegularFunction || 1156 if (func.kind() == RawFunction::kRegularFunction ||
1153 func.kind() == RawFunction::kGetterFunction || 1157 func.kind() == RawFunction::kGetterFunction ||
1154 func.kind() == RawFunction::kSetterFunction) { 1158 func.kind() == RawFunction::kSetterFunction) {
1155 member_mirror = CreateMethodMirror(func, owner_mirror); 1159 member_mirror = CreateMethodMirror(func, owner_mirror);
1156 member_mirrors.Add(member_mirror); 1160 member_mirrors.Add(member_mirror);
1157 } 1161 }
1158 } 1162 }
1159 } 1163 }
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 } 1982 }
1979 1983
1980 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { 1984 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) {
1981 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); 1985 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0));
1982 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); 1986 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1));
1983 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); 1987 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw();
1984 } 1988 }
1985 1989
1986 1990
1987 } // namespace dart 1991 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698