| 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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 result); | 526 result); |
| 527 } | 527 } |
| 528 if (FLAG_trace_type_checks) { | 528 if (FLAG_trace_type_checks) { |
| 529 AbstractType& test_type = AbstractType::Handle(type.raw()); | 529 AbstractType& test_type = AbstractType::Handle(type.raw()); |
| 530 if (!test_type.IsInstantiated()) { | 530 if (!test_type.IsInstantiated()) { |
| 531 Error& malformed_error = Error::Handle(); | 531 Error& malformed_error = Error::Handle(); |
| 532 test_type = type.InstantiateFrom(instantiator_type_arguments, | 532 test_type = type.InstantiateFrom(instantiator_type_arguments, |
| 533 &malformed_error); | 533 &malformed_error); |
| 534 ASSERT(malformed_error.IsNull()); // Malformed types are not optimized. | 534 ASSERT(malformed_error.IsNull()); // Malformed types are not optimized. |
| 535 } | 535 } |
| 536 OS::PrintErr(" Updated test cache %p ix: %"Pd" with (%"Pd", %p, %p, %s)\n" | 536 OS::PrintErr(" Updated test cache %p ix: %"Pd" with " |
| 537 " [%p %s %"Pd", %p %s]\n" | 537 "(cid: %"Pd", type-args: %p, instantiator: %p, result: %s)\n" |
| 538 " [%p %s %"Pd", %p %s] %s\n", | 538 " instance [class: (%p '%s' cid: %"Pd"), type-args: %p %s]\n" |
| 539 " test-type [class: (%p '%s' cid: %"Pd"), in-type-args: %p %s]\n", |
| 539 new_cache.raw(), | 540 new_cache.raw(), |
| 540 len, | 541 len, |
| 542 |
| 541 instance_class.id(), | 543 instance_class.id(), |
| 542 | |
| 543 instance_type_arguments.raw(), | 544 instance_type_arguments.raw(), |
| 544 instantiator_type_arguments.raw(), | 545 instantiator_type_arguments.raw(), |
| 545 result.ToCString(), | 546 result.ToCString(), |
| 546 | 547 |
| 547 instance_class.raw(), | 548 instance_class.raw(), |
| 548 instance_class.ToCString(), | 549 String::Handle(instance_class.Name()).ToCString(), |
| 549 instance_class.id(), | 550 instance_class.id(), |
| 550 instance_type_arguments.raw(), | 551 instance_type_arguments.raw(), |
| 551 instance_type_arguments.ToCString(), | 552 instance_type_arguments.ToCString(), |
| 552 | 553 |
| 553 test_type.type_class(), | 554 test_type.type_class(), |
| 554 Class::Handle(test_type.type_class()).ToCString(), | 555 String::Handle(Class::Handle(test_type.type_class()).Name()). |
| 556 ToCString(), |
| 555 Class::Handle(test_type.type_class()).id(), | 557 Class::Handle(test_type.type_class()).id(), |
| 556 instantiator_type_arguments.raw(), | 558 instantiator_type_arguments.raw(), |
| 557 instantiator_type_arguments.ToCString(), | 559 instantiator_type_arguments.ToCString()); |
| 558 result.ToCString()); | |
| 559 } | 560 } |
| 560 } | 561 } |
| 561 | 562 |
| 562 | 563 |
| 563 // Check that the given instance is an instance of the given type. | 564 // Check that the given instance is an instance of the given type. |
| 564 // Tested instance may not be null, because the null test is inlined. | 565 // Tested instance may not be null, because the null test is inlined. |
| 565 // Arg0: instance being checked. | 566 // Arg0: instance being checked. |
| 566 // Arg1: type. | 567 // Arg1: type. |
| 567 // Arg2: instantiator (or null). | 568 // Arg2: instantiator (or null). |
| 568 // Arg3: type arguments of the instantiator of the type. | 569 // Arg3: type arguments of the instantiator of the type. |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1869 // Arg1: Value that is being stored. | 1870 // Arg1: Value that is being stored. |
| 1870 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1871 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
| 1871 ASSERT(arguments.ArgCount() == kUpdateFieldCidRuntimeEntry.argument_count()); | 1872 ASSERT(arguments.ArgCount() == kUpdateFieldCidRuntimeEntry.argument_count()); |
| 1872 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1873 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
| 1873 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1874 const Object& value = Object::Handle(arguments.ArgAt(1)); |
| 1874 | 1875 |
| 1875 field.UpdateCid(value.GetClassId()); | 1876 field.UpdateCid(value.GetClassId()); |
| 1876 } | 1877 } |
| 1877 | 1878 |
| 1878 } // namespace dart | 1879 } // namespace dart |
| OLD | NEW |