| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2707 // Compute offsets of instance fields and instance size. | 2707 // Compute offsets of instance fields and instance size. |
| 2708 CalculateFieldOffsets(); | 2708 CalculateFieldOffsets(); |
| 2709 } | 2709 } |
| 2710 set_is_finalized(); | 2710 set_is_finalized(); |
| 2711 } | 2711 } |
| 2712 | 2712 |
| 2713 | 2713 |
| 2714 class CHACodeArray : public WeakCodeReferences { | 2714 class CHACodeArray : public WeakCodeReferences { |
| 2715 public: | 2715 public: |
| 2716 explicit CHACodeArray(const Class& cls) | 2716 explicit CHACodeArray(const Class& cls) |
| 2717 : WeakCodeReferences(Array::Handle(cls.cha_codes())), cls_(cls) { | 2717 : WeakCodeReferences(Array::Handle(cls.dependent_code())), cls_(cls) { |
| 2718 } | 2718 } |
| 2719 | 2719 |
| 2720 virtual void UpdateArrayTo(const Array& value) { | 2720 virtual void UpdateArrayTo(const Array& value) { |
| 2721 // TODO(fschneider): Fails for classes in the VM isolate. | 2721 // TODO(fschneider): Fails for classes in the VM isolate. |
| 2722 cls_.set_cha_codes(value); | 2722 cls_.set_dependent_code(value); |
| 2723 } | 2723 } |
| 2724 | 2724 |
| 2725 virtual void ReportDeoptimization(const Code& code) { | 2725 virtual void ReportDeoptimization(const Code& code) { |
| 2726 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { | 2726 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { |
| 2727 Function& function = Function::Handle(code.function()); | 2727 Function& function = Function::Handle(code.function()); |
| 2728 THR_Print("Deoptimizing %s because CHA optimized (%s).\n", | 2728 THR_Print("Deoptimizing %s because CHA optimized (%s).\n", |
| 2729 function.ToFullyQualifiedCString(), | 2729 function.ToFullyQualifiedCString(), |
| 2730 cls_.ToCString()); | 2730 cls_.ToCString()); |
| 2731 } | 2731 } |
| 2732 } | 2732 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2864 Heap::kNew, | 2864 Heap::kNew, |
| 2865 "'%s' is not private and therefore cannot be patched", | 2865 "'%s' is not private and therefore cannot be patched", |
| 2866 name.ToCString()); | 2866 name.ToCString()); |
| 2867 return false; | 2867 return false; |
| 2868 } | 2868 } |
| 2869 } | 2869 } |
| 2870 return true; | 2870 return true; |
| 2871 } | 2871 } |
| 2872 | 2872 |
| 2873 | 2873 |
| 2874 void Class::set_cha_codes(const Array& cache) const { | 2874 void Class::set_dependent_code(const Array& array) const { |
| 2875 StorePointer(&raw_ptr()->cha_codes_, cache.raw()); | 2875 StorePointer(&raw_ptr()->dependent_code_, array.raw()); |
| 2876 } | 2876 } |
| 2877 | 2877 |
| 2878 | 2878 |
| 2879 // Apply the members from the patch class to the original class. | 2879 // Apply the members from the patch class to the original class. |
| 2880 bool Class::ApplyPatch(const Class& patch, Error* error) const { | 2880 bool Class::ApplyPatch(const Class& patch, Error* error) const { |
| 2881 ASSERT(error != NULL); | 2881 ASSERT(error != NULL); |
| 2882 ASSERT(!is_finalized()); | 2882 ASSERT(!is_finalized()); |
| 2883 // Shared handles used during the iteration. | 2883 // Shared handles used during the iteration. |
| 2884 String& member_name = String::Handle(); | 2884 String& member_name = String::Handle(); |
| 2885 | 2885 |
| (...skipping 19518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22404 return UserTag::null(); | 22404 return UserTag::null(); |
| 22405 } | 22405 } |
| 22406 | 22406 |
| 22407 | 22407 |
| 22408 const char* UserTag::ToCString() const { | 22408 const char* UserTag::ToCString() const { |
| 22409 const String& tag_label = String::Handle(label()); | 22409 const String& tag_label = String::Handle(label()); |
| 22410 return tag_label.ToCString(); | 22410 return tag_label.ToCString(); |
| 22411 } | 22411 } |
| 22412 | 22412 |
| 22413 } // namespace dart | 22413 } // namespace dart |
| OLD | NEW |