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 "vm/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
6 #include "vm/exceptions.h" | 6 #include "vm/exceptions.h" |
7 #include "vm/object_store.h" | 7 #include "vm/object_store.h" |
8 #include "vm/runtime_entry.h" | 8 #include "vm/runtime_entry.h" |
9 #include "vm/stack_frame.h" | 9 #include "vm/stack_frame.h" |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 DEFINE_NATIVE_ENTRY(TypeError_throwNew, 5) { | 60 DEFINE_NATIVE_ENTRY(TypeError_throwNew, 5) { |
61 // No need to type check the arguments. This function can only be called | 61 // No need to type check the arguments. This function can only be called |
62 // internally from the VM. | 62 // internally from the VM. |
63 intptr_t location = Smi::CheckedHandle(arguments->NativeArgAt(0)).Value(); | 63 intptr_t location = Smi::CheckedHandle(arguments->NativeArgAt(0)).Value(); |
64 const Instance& src_value = | 64 const Instance& src_value = |
65 Instance::CheckedHandle(arguments->NativeArgAt(1)); | 65 Instance::CheckedHandle(arguments->NativeArgAt(1)); |
66 const String& dst_type_name = | 66 const String& dst_type_name = |
67 String::CheckedHandle(arguments->NativeArgAt(2)); | 67 String::CheckedHandle(arguments->NativeArgAt(2)); |
68 const String& dst_name = String::CheckedHandle(arguments->NativeArgAt(3)); | 68 const String& dst_name = String::CheckedHandle(arguments->NativeArgAt(3)); |
69 const String& error_msg = String::CheckedHandle(arguments->NativeArgAt(4)); | 69 const String& error_msg = String::CheckedHandle(arguments->NativeArgAt(4)); |
70 const String& src_type_name = | 70 const String& src_type_name = String::Handle( |
71 String::Handle(Type::Handle(src_value.GetType()).UserVisibleName()); | 71 AbstractType::Handle(src_value.GetType()).UserVisibleName()); |
72 Exceptions::CreateAndThrowTypeError(location, src_type_name, | 72 Exceptions::CreateAndThrowTypeError(location, src_type_name, |
73 dst_type_name, dst_name, error_msg); | 73 dst_type_name, dst_name, error_msg); |
74 UNREACHABLE(); | 74 UNREACHABLE(); |
75 return Object::null(); | 75 return Object::null(); |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 // Allocate and throw a new FallThroughError. | 79 // Allocate and throw a new FallThroughError. |
80 // Arg0: index of the case clause token into which we fall through. | 80 // Arg0: index of the case clause token into which we fall through. |
81 // Return value: none, throws an exception. | 81 // Return value: none, throws an exception. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 // Rethrow an error with a stacktrace. | 129 // Rethrow an error with a stacktrace. |
130 DEFINE_NATIVE_ENTRY(Async_rethrow, 2) { | 130 DEFINE_NATIVE_ENTRY(Async_rethrow, 2) { |
131 GET_NON_NULL_NATIVE_ARGUMENT(Instance, error, arguments->NativeArgAt(0)); | 131 GET_NON_NULL_NATIVE_ARGUMENT(Instance, error, arguments->NativeArgAt(0)); |
132 GET_NON_NULL_NATIVE_ARGUMENT(Instance, stacktrace, arguments->NativeArgAt(1)); | 132 GET_NON_NULL_NATIVE_ARGUMENT(Instance, stacktrace, arguments->NativeArgAt(1)); |
133 Exceptions::ReThrow(thread, error, stacktrace); | 133 Exceptions::ReThrow(thread, error, stacktrace); |
134 return Object::null(); | 134 return Object::null(); |
135 } | 135 } |
136 | 136 |
137 } // namespace dart | 137 } // namespace dart |
OLD | NEW |