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 2872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2883 virtual void ReportSwitchingCode(const Code& code) { | 2883 virtual void ReportSwitchingCode(const Code& code) { |
2884 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { | 2884 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { |
2885 Function& function = Function::Handle(code.function()); | 2885 Function& function = Function::Handle(code.function()); |
2886 THR_Print("Switching %s to unoptimized code because CHA invalid" | 2886 THR_Print("Switching %s to unoptimized code because CHA invalid" |
2887 " (%s)\n", | 2887 " (%s)\n", |
2888 function.ToFullyQualifiedCString(), | 2888 function.ToFullyQualifiedCString(), |
2889 cls_.ToCString()); | 2889 cls_.ToCString()); |
2890 } | 2890 } |
2891 } | 2891 } |
2892 | 2892 |
| 2893 virtual void IncrementInvalidationGen() { |
| 2894 Isolate::Current()->IncrCHAInvalidationGen(); |
| 2895 } |
| 2896 |
2893 private: | 2897 private: |
2894 const Class& cls_; | 2898 const Class& cls_; |
2895 DISALLOW_COPY_AND_ASSIGN(CHACodeArray); | 2899 DISALLOW_COPY_AND_ASSIGN(CHACodeArray); |
2896 }; | 2900 }; |
2897 | 2901 |
2898 | 2902 |
2899 void Class::RegisterCHACode(const Code& code) { | 2903 void Class::RegisterCHACode(const Code& code) { |
2900 if (FLAG_trace_cha) { | 2904 if (FLAG_trace_cha) { |
2901 THR_Print("RegisterCHACode %s class %s\n", | 2905 THR_Print("RegisterCHACode %s class %s\n", |
2902 Function::Handle(code.function()).ToQualifiedCString(), ToCString()); | 2906 Function::Handle(code.function()).ToQualifiedCString(), ToCString()); |
(...skipping 4864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7767 virtual void ReportSwitchingCode(const Code& code) { | 7771 virtual void ReportSwitchingCode(const Code& code) { |
7768 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { | 7772 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { |
7769 Function& function = Function::Handle(code.function()); | 7773 Function& function = Function::Handle(code.function()); |
7770 THR_Print("Switching %s to unoptimized code because guard" | 7774 THR_Print("Switching %s to unoptimized code because guard" |
7771 " on field %s was violated.\n", | 7775 " on field %s was violated.\n", |
7772 function.ToFullyQualifiedCString(), | 7776 function.ToFullyQualifiedCString(), |
7773 field_.ToCString()); | 7777 field_.ToCString()); |
7774 } | 7778 } |
7775 } | 7779 } |
7776 | 7780 |
| 7781 virtual void IncrementInvalidationGen() { |
| 7782 Isolate::Current()->IncrFieldInvalidationGen(); |
| 7783 } |
| 7784 |
7777 private: | 7785 private: |
7778 const Field& field_; | 7786 const Field& field_; |
7779 DISALLOW_COPY_AND_ASSIGN(FieldDependentArray); | 7787 DISALLOW_COPY_AND_ASSIGN(FieldDependentArray); |
7780 }; | 7788 }; |
7781 | 7789 |
7782 | 7790 |
7783 void Field::RegisterDependentCode(const Code& code) const { | 7791 void Field::RegisterDependentCode(const Code& code) const { |
7784 ASSERT(code.is_optimized()); | 7792 ASSERT(code.is_optimized()); |
7785 FieldDependentArray a(*this); | 7793 FieldDependentArray a(*this); |
7786 a.Register(code); | 7794 a.Register(code); |
(...skipping 3020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10807 virtual void ReportSwitchingCode(const Code& code) { | 10815 virtual void ReportSwitchingCode(const Code& code) { |
10808 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { | 10816 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { |
10809 THR_Print("Prefix '%s': disabling %s code for %s function '%s'\n", | 10817 THR_Print("Prefix '%s': disabling %s code for %s function '%s'\n", |
10810 String::Handle(prefix_.name()).ToCString(), | 10818 String::Handle(prefix_.name()).ToCString(), |
10811 code.is_optimized() ? "optimized" : "unoptimized", | 10819 code.is_optimized() ? "optimized" : "unoptimized", |
10812 code.IsDisabled() ? "'patched'" : "'unpatched'", | 10820 code.IsDisabled() ? "'patched'" : "'unpatched'", |
10813 Function::Handle(code.function()).ToCString()); | 10821 Function::Handle(code.function()).ToCString()); |
10814 } | 10822 } |
10815 } | 10823 } |
10816 | 10824 |
| 10825 virtual void IncrementInvalidationGen() { |
| 10826 Isolate::Current()->IncrPrefixInvalidationGen(); |
| 10827 } |
| 10828 |
10817 private: | 10829 private: |
10818 const LibraryPrefix& prefix_; | 10830 const LibraryPrefix& prefix_; |
10819 DISALLOW_COPY_AND_ASSIGN(PrefixDependentArray); | 10831 DISALLOW_COPY_AND_ASSIGN(PrefixDependentArray); |
10820 }; | 10832 }; |
10821 | 10833 |
10822 | 10834 |
10823 void LibraryPrefix::RegisterDependentCode(const Code& code) const { | 10835 void LibraryPrefix::RegisterDependentCode(const Code& code) const { |
10824 ASSERT(is_deferred_load()); | 10836 ASSERT(is_deferred_load()); |
10825 ASSERT(!is_loaded()); | 10837 ASSERT(!is_loaded()); |
10826 PrefixDependentArray a(*this); | 10838 PrefixDependentArray a(*this); |
(...skipping 11086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21913 return tag_label.ToCString(); | 21925 return tag_label.ToCString(); |
21914 } | 21926 } |
21915 | 21927 |
21916 | 21928 |
21917 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21929 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21918 Instance::PrintJSONImpl(stream, ref); | 21930 Instance::PrintJSONImpl(stream, ref); |
21919 } | 21931 } |
21920 | 21932 |
21921 | 21933 |
21922 } // namespace dart | 21934 } // namespace dart |
OLD | NEW |