OLD | NEW |
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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 293 } |
294 | 294 |
295 | 295 |
296 static RawInstance* CreateVariableMirror(const Field& field, | 296 static RawInstance* CreateVariableMirror(const Field& field, |
297 const Instance& owner_mirror) { | 297 const Instance& owner_mirror) { |
298 const MirrorReference& field_ref = | 298 const MirrorReference& field_ref = |
299 MirrorReference::Handle(MirrorReference::New(field)); | 299 MirrorReference::Handle(MirrorReference::New(field)); |
300 | 300 |
301 const String& name = String::Handle(field.name()); | 301 const String& name = String::Handle(field.name()); |
302 | 302 |
303 const Array& args = Array::Handle(Array::New(6)); | 303 const Array& args = Array::Handle(Array::New(7)); |
304 args.SetAt(0, field_ref); | 304 args.SetAt(0, field_ref); |
305 args.SetAt(1, name); | 305 args.SetAt(1, name); |
306 args.SetAt(2, owner_mirror); | 306 args.SetAt(2, owner_mirror); |
307 args.SetAt(3, Object::null_instance()); // Null for type. | 307 args.SetAt(3, Object::null_instance()); // Null for type. |
308 args.SetAt(4, Bool::Get(field.is_static())); | 308 args.SetAt(4, Bool::Get(field.is_static())); |
309 args.SetAt(5, Bool::Get(field.is_final())); | 309 args.SetAt(5, Bool::Get(field.is_final())); |
| 310 args.SetAt(6, Bool::Get(field.is_const())); |
310 | 311 |
311 return CreateMirror(Symbols::_LocalVariableMirrorImpl(), args); | 312 return CreateMirror(Symbols::_LocalVariableMirrorImpl(), args); |
312 } | 313 } |
313 | 314 |
314 static RawFunction* CallMethod(const Class& cls) { | 315 static RawFunction* CallMethod(const Class& cls) { |
315 if (cls.IsSignatureClass()) { | 316 if (cls.IsSignatureClass()) { |
316 return cls.signature_function(); | 317 return cls.signature_function(); |
317 } | 318 } |
318 | 319 |
319 Class& lookup_cls = Class::Handle(cls.raw()); | 320 Class& lookup_cls = Class::Handle(cls.raw()); |
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 | 1955 |
1955 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { | 1956 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { |
1956 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1957 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
1957 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1958 const Field& field = Field::Handle(ref.GetFieldReferent()); |
1958 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); | 1959 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); |
1959 const AbstractType& type = AbstractType::Handle(field.type()); | 1960 const AbstractType& type = AbstractType::Handle(field.type()); |
1960 return InstantiateType(type, instantiator); | 1961 return InstantiateType(type, instantiator); |
1961 } | 1962 } |
1962 | 1963 |
1963 } // namespace dart | 1964 } // namespace dart |
OLD | NEW |