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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 Exceptions::ThrowByType(Exceptions::kNoSuchMethod, args); | 67 Exceptions::ThrowByType(Exceptions::kNoSuchMethod, args); |
68 UNREACHABLE(); | 68 UNREACHABLE(); |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 static void EnsureConstructorsAreCompiled(const Function& func) { | 72 static void EnsureConstructorsAreCompiled(const Function& func) { |
73 // Only generative constructors can have initializing formals. | 73 // Only generative constructors can have initializing formals. |
74 if (!func.IsGenerativeConstructor()) return; | 74 if (!func.IsGenerativeConstructor()) return; |
75 | 75 |
76 Isolate* isolate = Isolate::Current(); | 76 Thread* thread = Thread::Current(); |
77 const Class& cls = Class::Handle(isolate, func.Owner()); | 77 Zone* zone = thread->zone(); |
| 78 const Class& cls = Class::Handle(zone, func.Owner()); |
78 const Error& error = Error::Handle( | 79 const Error& error = Error::Handle( |
79 isolate, cls.EnsureIsFinalized(Isolate::Current())); | 80 zone, cls.EnsureIsFinalized(thread->isolate())); |
80 if (!error.IsNull()) { | 81 if (!error.IsNull()) { |
81 Exceptions::PropagateError(error); | 82 Exceptions::PropagateError(error); |
82 UNREACHABLE(); | 83 UNREACHABLE(); |
83 } | 84 } |
84 if (!func.HasCode()) { | 85 if (!func.HasCode()) { |
85 const Error& error = Error::Handle( | 86 const Error& error = Error::Handle( |
86 isolate, Compiler::CompileFunction(isolate, func)); | 87 zone, Compiler::CompileFunction(thread, func)); |
87 if (!error.IsNull()) { | 88 if (!error.IsNull()) { |
88 Exceptions::PropagateError(error); | 89 Exceptions::PropagateError(error); |
89 UNREACHABLE(); | 90 UNREACHABLE(); |
90 } | 91 } |
91 } | 92 } |
92 } | 93 } |
93 | 94 |
94 static RawInstance* CreateParameterMirrorList(const Function& func, | 95 static RawInstance* CreateParameterMirrorList(const Function& func, |
95 const Instance& owner_mirror) { | 96 const Instance& owner_mirror) { |
96 HANDLESCOPE(Isolate::Current()); | 97 HANDLESCOPE(Isolate::Current()); |
(...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2028 } | 2029 } |
2029 | 2030 |
2030 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { | 2031 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { |
2031 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2032 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2032 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2033 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2033 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); | 2034 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); |
2034 } | 2035 } |
2035 | 2036 |
2036 | 2037 |
2037 } // namespace dart | 2038 } // namespace dart |
OLD | NEW |