OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/code_generator.h" | 5 #include "vm/code_generator.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // Arg0: uninstantiated type. | 198 // Arg0: uninstantiated type. |
199 // Arg1: instantiator type arguments. | 199 // Arg1: instantiator type arguments. |
200 // Return value: instantiated type. | 200 // Return value: instantiated type. |
201 DEFINE_RUNTIME_ENTRY(InstantiateType, 2) { | 201 DEFINE_RUNTIME_ENTRY(InstantiateType, 2) { |
202 AbstractType& type = AbstractType::CheckedHandle(arguments.ArgAt(0)); | 202 AbstractType& type = AbstractType::CheckedHandle(arguments.ArgAt(0)); |
203 const TypeArguments& instantiator = | 203 const TypeArguments& instantiator = |
204 TypeArguments::CheckedHandle(arguments.ArgAt(1)); | 204 TypeArguments::CheckedHandle(arguments.ArgAt(1)); |
205 ASSERT(!type.IsNull() && !type.IsInstantiated()); | 205 ASSERT(!type.IsNull() && !type.IsInstantiated()); |
206 ASSERT(instantiator.IsNull() || instantiator.IsInstantiated()); | 206 ASSERT(instantiator.IsNull() || instantiator.IsInstantiated()); |
207 Error& bound_error = Error::Handle(); | 207 Error& bound_error = Error::Handle(); |
208 type = type.InstantiateFrom(instantiator, &bound_error, NULL, Heap::kOld); | 208 type = |
| 209 type.InstantiateFrom(instantiator, &bound_error, NULL, NULL, Heap::kOld); |
209 if (!bound_error.IsNull()) { | 210 if (!bound_error.IsNull()) { |
210 // Throw a dynamic type error. | 211 // Throw a dynamic type error. |
211 const TokenPosition location = GetCallerLocation(); | 212 const TokenPosition location = GetCallerLocation(); |
212 String& bound_error_message = String::Handle( | 213 String& bound_error_message = String::Handle( |
213 String::New(bound_error.ToErrorCString())); | 214 String::New(bound_error.ToErrorCString())); |
214 Exceptions::CreateAndThrowTypeError( | 215 Exceptions::CreateAndThrowTypeError( |
215 location, Symbols::Empty(), Symbols::Empty(), | 216 location, Symbols::Empty(), Symbols::Empty(), |
216 Symbols::Empty(), bound_error_message); | 217 Symbols::Empty(), bound_error_message); |
217 UNREACHABLE(); | 218 UNREACHABLE(); |
218 } | 219 } |
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1899 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
1899 const TypedData& new_data = | 1900 const TypedData& new_data = |
1900 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1901 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
1901 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1902 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
1902 typed_data_cell.SetAt(0, new_data); | 1903 typed_data_cell.SetAt(0, new_data); |
1903 arguments.SetReturn(new_data); | 1904 arguments.SetReturn(new_data); |
1904 } | 1905 } |
1905 | 1906 |
1906 | 1907 |
1907 } // namespace dart | 1908 } // namespace dart |
OLD | NEW |