| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 // Return value: true or false, or may throw a type error in checked mode. | 538 // Return value: true or false, or may throw a type error in checked mode. |
| 539 DEFINE_RUNTIME_ENTRY(Instanceof, 5) { | 539 DEFINE_RUNTIME_ENTRY(Instanceof, 5) { |
| 540 const Instance& instance = Instance::CheckedHandle(arguments.ArgAt(0)); | 540 const Instance& instance = Instance::CheckedHandle(arguments.ArgAt(0)); |
| 541 const AbstractType& type = AbstractType::CheckedHandle(arguments.ArgAt(1)); | 541 const AbstractType& type = AbstractType::CheckedHandle(arguments.ArgAt(1)); |
| 542 const Instance& instantiator = Instance::CheckedHandle(arguments.ArgAt(2)); | 542 const Instance& instantiator = Instance::CheckedHandle(arguments.ArgAt(2)); |
| 543 const AbstractTypeArguments& instantiator_type_arguments = | 543 const AbstractTypeArguments& instantiator_type_arguments = |
| 544 AbstractTypeArguments::CheckedHandle(arguments.ArgAt(3)); | 544 AbstractTypeArguments::CheckedHandle(arguments.ArgAt(3)); |
| 545 const SubtypeTestCache& cache = | 545 const SubtypeTestCache& cache = |
| 546 SubtypeTestCache::CheckedHandle(arguments.ArgAt(4)); | 546 SubtypeTestCache::CheckedHandle(arguments.ArgAt(4)); |
| 547 ASSERT(type.IsFinalized()); | 547 ASSERT(type.IsFinalized()); |
| 548 ASSERT(!type.IsDynamicType()); // No need to check assignment. |
| 549 ASSERT(!type.IsMalformed()); // Already checked in code generator. |
| 550 ASSERT(!type.IsMalbounded()); // Already checked in code generator. |
| 548 Error& bound_error = Error::Handle(); | 551 Error& bound_error = Error::Handle(); |
| 549 const Bool& result = | 552 const Bool& result = |
| 550 Bool::Get(instance.IsInstanceOf(type, | 553 Bool::Get(instance.IsInstanceOf(type, |
| 551 instantiator_type_arguments, | 554 instantiator_type_arguments, |
| 552 &bound_error)); | 555 &bound_error)); |
| 553 if (FLAG_trace_type_checks) { | 556 if (FLAG_trace_type_checks) { |
| 554 PrintTypeCheck("InstanceOf", | 557 PrintTypeCheck("InstanceOf", |
| 555 instance, type, instantiator_type_arguments, result); | 558 instance, type, instantiator_type_arguments, result); |
| 556 } | 559 } |
| 557 if (!result.value() && !bound_error.IsNull()) { | 560 if (!result.value() && !bound_error.IsNull()) { |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 // of the given value. | 1701 // of the given value. |
| 1699 // Arg0: Field object; | 1702 // Arg0: Field object; |
| 1700 // Arg1: Value that is being stored. | 1703 // Arg1: Value that is being stored. |
| 1701 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1704 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
| 1702 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1705 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
| 1703 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1706 const Object& value = Object::Handle(arguments.ArgAt(1)); |
| 1704 field.UpdateGuardedCidAndLength(value); | 1707 field.UpdateGuardedCidAndLength(value); |
| 1705 } | 1708 } |
| 1706 | 1709 |
| 1707 } // namespace dart | 1710 } // namespace dart |
| OLD | NEW |