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/mirrors.h" | 5 #include "lib/mirrors.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/bootstrap_natives.h" | 8 #include "vm/bootstrap_natives.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 | 89 |
90 Thread* thread = Thread::Current(); | 90 Thread* thread = Thread::Current(); |
91 Zone* zone = thread->zone(); | 91 Zone* zone = thread->zone(); |
92 const Class& cls = Class::Handle(zone, func.Owner()); | 92 const Class& cls = Class::Handle(zone, func.Owner()); |
93 const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread)); | 93 const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread)); |
94 if (!error.IsNull()) { | 94 if (!error.IsNull()) { |
95 Exceptions::PropagateError(error); | 95 Exceptions::PropagateError(error); |
96 UNREACHABLE(); | 96 UNREACHABLE(); |
97 } | 97 } |
98 if (!func.HasCode()) { | 98 if (!func.HasCode()) { |
99 const Error& error = | 99 const Object& result = |
Vyacheslav Egorov (Google)
2017/03/30 09:58:52
There are a lot of places that do this. Maybe you
erikcorry
2017/03/30 12:26:33
Done.
| |
100 Error::Handle(zone, Compiler::CompileFunction(thread, func)); | 100 Object::Handle(zone, Compiler::CompileFunction(thread, func)); |
101 if (!error.IsNull()) { | 101 if (result.IsError()) { |
102 Exceptions::PropagateError(error); | 102 Exceptions::PropagateError(Error::Cast(result)); |
103 UNREACHABLE(); | 103 UNREACHABLE(); |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 static RawInstance* CreateParameterMirrorList(const Function& func, | 108 static RawInstance* CreateParameterMirrorList(const Function& func, |
109 const Instance& owner_mirror) { | 109 const Instance& owner_mirror) { |
110 HANDLESCOPE(Thread::Current()); | 110 HANDLESCOPE(Thread::Current()); |
111 const intptr_t implicit_param_count = func.NumImplicitParameters(); | 111 const intptr_t implicit_param_count = func.NumImplicitParameters(); |
112 const intptr_t non_implicit_param_count = | 112 const intptr_t non_implicit_param_count = |
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2094 | 2094 |
2095 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2095 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
2096 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2096 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2097 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2097 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2098 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); | 2098 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); |
2099 } | 2099 } |
2100 | 2100 |
2101 #endif // !PRODUCT && !DART_PRECOMPILED_RUNTIME | 2101 #endif // !PRODUCT && !DART_PRECOMPILED_RUNTIME |
2102 | 2102 |
2103 } // namespace dart | 2103 } // namespace dart |
OLD | NEW |