| 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 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1960 } | 1961 } |
| 1961 | 1962 |
| 1962 | 1963 |
| 1963 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { | 1964 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { |
| 1964 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1965 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 1965 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1966 const Field& field = Field::Handle(ref.GetFieldReferent()); |
| 1966 return field.type(); | 1967 return field.type(); |
| 1967 } | 1968 } |
| 1968 | 1969 |
| 1969 } // namespace dart | 1970 } // namespace dart |
| OLD | NEW |