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/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 if (!bound_error.IsNull()) { | 220 if (!bound_error.IsNull()) { |
221 // Throw a dynamic type error. | 221 // Throw a dynamic type error. |
222 const intptr_t location = GetCallerLocation(); | 222 const intptr_t location = GetCallerLocation(); |
223 String& bound_error_message = String::Handle( | 223 String& bound_error_message = String::Handle( |
224 String::New(bound_error.ToErrorCString())); | 224 String::New(bound_error.ToErrorCString())); |
225 Exceptions::CreateAndThrowTypeError( | 225 Exceptions::CreateAndThrowTypeError( |
226 location, Symbols::Empty(), Symbols::Empty(), | 226 location, Symbols::Empty(), Symbols::Empty(), |
227 Symbols::Empty(), bound_error_message); | 227 Symbols::Empty(), bound_error_message); |
228 UNREACHABLE(); | 228 UNREACHABLE(); |
229 } | 229 } |
| 230 if (type.IsTypeRef()) { |
| 231 type = TypeRef::Cast(type).type(); |
| 232 ASSERT(!type.IsTypeRef()); |
| 233 ASSERT(type.IsCanonical()); |
| 234 } |
230 ASSERT(!type.IsNull() && type.IsInstantiated()); | 235 ASSERT(!type.IsNull() && type.IsInstantiated()); |
231 arguments.SetReturn(type); | 236 arguments.SetReturn(type); |
232 } | 237 } |
233 | 238 |
234 | 239 |
235 // Instantiate type arguments. | 240 // Instantiate type arguments. |
236 // Arg0: uninstantiated type arguments. | 241 // Arg0: uninstantiated type arguments. |
237 // Arg1: instantiator type arguments. | 242 // Arg1: instantiator type arguments. |
238 // Return value: instantiated type arguments. | 243 // Return value: instantiated type arguments. |
239 DEFINE_RUNTIME_ENTRY(InstantiateTypeArguments, 2) { | 244 DEFINE_RUNTIME_ENTRY(InstantiateTypeArguments, 2) { |
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 // of the given value. | 1720 // of the given value. |
1716 // Arg0: Field object; | 1721 // Arg0: Field object; |
1717 // Arg1: Value that is being stored. | 1722 // Arg1: Value that is being stored. |
1718 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1723 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
1719 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1724 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
1720 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1725 const Object& value = Object::Handle(arguments.ArgAt(1)); |
1721 field.UpdateGuardedCidAndLength(value); | 1726 field.UpdateGuardedCidAndLength(value); |
1722 } | 1727 } |
1723 | 1728 |
1724 } // namespace dart | 1729 } // namespace dart |
OLD | NEW |