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