| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 Exceptions::ThrowByType(Exceptions::kMirroredCompilationError, args); | 45 Exceptions::ThrowByType(Exceptions::kMirroredCompilationError, args); |
| 46 UNREACHABLE(); | 46 UNREACHABLE(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 static void ThrowInvokeError(const Error& error) { | 50 static void ThrowInvokeError(const Error& error) { |
| 51 if (FLAG_use_mirrored_compilation_error && error.IsLanguageError()) { | 51 if (FLAG_use_mirrored_compilation_error && error.IsLanguageError()) { |
| 52 // A compilation error that was delayed by lazy compilation. | 52 // A compilation error that was delayed by lazy compilation. |
| 53 const LanguageError& compilation_error = LanguageError::Cast(error); | 53 const LanguageError& compilation_error = LanguageError::Cast(error); |
| 54 String& message = String::Handle(compilation_error.message()); | 54 String& message = String::Handle(compilation_error.FormatMessage()); |
| 55 ThrowMirroredCompilationError(message); | 55 ThrowMirroredCompilationError(message); |
| 56 UNREACHABLE(); | 56 UNREACHABLE(); |
| 57 } | 57 } |
| 58 Exceptions::PropagateError(error); | 58 Exceptions::PropagateError(error); |
| 59 UNREACHABLE(); | 59 UNREACHABLE(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 // Conventions: | 63 // Conventions: |
| 64 // * For throwing a NSM in a class klass we use its runtime type as receiver, | 64 // * For throwing a NSM in a class klass we use its runtime type as receiver, |
| (...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1945 | 1945 |
| 1946 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { | 1946 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { |
| 1947 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1947 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 1948 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1948 const Field& field = Field::Handle(ref.GetFieldReferent()); |
| 1949 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); | 1949 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); |
| 1950 const AbstractType& type = AbstractType::Handle(field.type()); | 1950 const AbstractType& type = AbstractType::Handle(field.type()); |
| 1951 return InstantiateType(type, instantiator); | 1951 return InstantiateType(type, instantiator); |
| 1952 } | 1952 } |
| 1953 | 1953 |
| 1954 } // namespace dart | 1954 } // namespace dart |
| OLD | NEW |