Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 51653006: Track live instance and allocation counts for classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/globals.h" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 DRegister value = locs()->in(1).fpu_reg(); 1734 DRegister value = locs()->in(1).fpu_reg();
1735 Register temp = locs()->temp(0).reg(); 1735 Register temp = locs()->temp(0).reg();
1736 Register temp2 = locs()->temp(1).reg(); 1736 Register temp2 = locs()->temp(1).reg();
1737 1737
1738 if (is_initialization_) { 1738 if (is_initialization_) {
1739 StoreInstanceFieldSlowPath* slow_path = 1739 StoreInstanceFieldSlowPath* slow_path =
1740 new StoreInstanceFieldSlowPath(this); 1740 new StoreInstanceFieldSlowPath(this);
1741 compiler->AddSlowPathCode(slow_path); 1741 compiler->AddSlowPathCode(slow_path);
1742 __ TryAllocate(compiler->double_class(), 1742 __ TryAllocate(compiler->double_class(),
1743 slow_path->entry_label(), 1743 slow_path->entry_label(),
1744 temp); 1744 temp,
1745 temp2);
1745 __ Bind(slow_path->exit_label()); 1746 __ Bind(slow_path->exit_label());
1746 __ mov(temp2, temp); 1747 __ mov(temp2, temp);
1747 __ StoreIntoObject(instance_reg, 1748 __ StoreIntoObject(instance_reg,
1748 FieldAddress(instance_reg, field().Offset()), 1749 FieldAddress(instance_reg, field().Offset()),
1749 temp2); 1750 temp2);
1750 } else { 1751 } else {
1751 __ lw(temp, FieldAddress(instance_reg, field().Offset())); 1752 __ lw(temp, FieldAddress(instance_reg, field().Offset()));
1752 } 1753 }
1753 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag); 1754 __ StoreDToOffset(value, temp, Double::value_offset() - kHeapObjectTag);
1754 return; 1755 return;
(...skipping 23 matching lines...) Expand all
1778 new StoreInstanceFieldSlowPath(this); 1779 new StoreInstanceFieldSlowPath(this);
1779 compiler->AddSlowPathCode(slow_path); 1780 compiler->AddSlowPathCode(slow_path);
1780 1781
1781 if (!compiler->is_optimizing()) { 1782 if (!compiler->is_optimizing()) {
1782 locs()->live_registers()->Add(locs()->in(0)); 1783 locs()->live_registers()->Add(locs()->in(0));
1783 locs()->live_registers()->Add(locs()->in(1)); 1784 locs()->live_registers()->Add(locs()->in(1));
1784 } 1785 }
1785 1786
1786 __ TryAllocate(compiler->double_class(), 1787 __ TryAllocate(compiler->double_class(),
1787 slow_path->entry_label(), 1788 slow_path->entry_label(),
1788 temp); 1789 temp,
1790 temp2);
1789 __ Bind(slow_path->exit_label()); 1791 __ Bind(slow_path->exit_label());
1790 __ mov(temp2, temp); 1792 __ mov(temp2, temp);
1791 __ StoreIntoObject(instance_reg, 1793 __ StoreIntoObject(instance_reg,
1792 FieldAddress(instance_reg, field().Offset()), 1794 FieldAddress(instance_reg, field().Offset()),
1793 temp2); 1795 temp2);
1794 1796
1795 __ Bind(&copy_payload); 1797 __ Bind(&copy_payload);
1796 __ LoadDFromOffset(fpu_temp, 1798 __ LoadDFromOffset(fpu_temp,
1797 value_reg, 1799 value_reg,
1798 Double::value_offset() - kHeapObjectTag); 1800 Double::value_offset() - kHeapObjectTag);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
2032 2034
2033 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); 2035 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
2034 compiler->AddSlowPathCode(slow_path); 2036 compiler->AddSlowPathCode(slow_path);
2035 2037
2036 if (!compiler->is_optimizing()) { 2038 if (!compiler->is_optimizing()) {
2037 locs()->live_registers()->Add(locs()->in(0)); 2039 locs()->live_registers()->Add(locs()->in(0));
2038 } 2040 }
2039 2041
2040 __ TryAllocate(compiler->double_class(), 2042 __ TryAllocate(compiler->double_class(),
2041 slow_path->entry_label(), 2043 slow_path->entry_label(),
2042 result_reg); 2044 result_reg,
2045 temp);
2043 __ Bind(slow_path->exit_label()); 2046 __ Bind(slow_path->exit_label());
2044 __ lw(temp, FieldAddress(instance_reg, offset_in_bytes())); 2047 __ lw(temp, FieldAddress(instance_reg, offset_in_bytes()));
2045 __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag); 2048 __ LoadDFromOffset(value, temp, Double::value_offset() - kHeapObjectTag);
2046 __ StoreDToOffset(value, 2049 __ StoreDToOffset(value,
2047 result_reg, 2050 result_reg,
2048 Double::value_offset() - kHeapObjectTag); 2051 Double::value_offset() - kHeapObjectTag);
2049 __ b(&done); 2052 __ b(&done);
2050 __ Bind(&load_pointer); 2053 __ Bind(&load_pointer);
2051 } 2054 }
2052 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag)); 2055 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag));
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 } else { 2893 } else {
2891 __ or_(TMP, left, right); 2894 __ or_(TMP, left, right);
2892 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); 2895 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask));
2893 } 2896 }
2894 __ beq(CMPRES1, ZR, deopt); 2897 __ beq(CMPRES1, ZR, deopt);
2895 } 2898 }
2896 2899
2897 2900
2898 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { 2901 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const {
2899 const intptr_t kNumInputs = 1; 2902 const intptr_t kNumInputs = 1;
2900 const intptr_t kNumTemps = 0; 2903 const intptr_t kNumTemps = 1;
2901 LocationSummary* summary = 2904 LocationSummary* summary =
2902 new LocationSummary(kNumInputs, 2905 new LocationSummary(kNumInputs,
2903 kNumTemps, 2906 kNumTemps,
2904 LocationSummary::kCallOnSlowPath); 2907 LocationSummary::kCallOnSlowPath);
2905 summary->set_in(0, Location::RequiresFpuRegister()); 2908 summary->set_in(0, Location::RequiresFpuRegister());
2909 summary->set_temp(0, Location::RequiresRegister());
2906 summary->set_out(Location::RequiresRegister()); 2910 summary->set_out(Location::RequiresRegister());
2907 return summary; 2911 return summary;
2908 } 2912 }
2909 2913
2910 2914
2911 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2915 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2912 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); 2916 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this);
2913 compiler->AddSlowPathCode(slow_path); 2917 compiler->AddSlowPathCode(slow_path);
2914 2918
2915 Register out_reg = locs()->out().reg(); 2919 Register out_reg = locs()->out().reg();
2916 DRegister value = locs()->in(0).fpu_reg(); 2920 DRegister value = locs()->in(0).fpu_reg();
2917 2921
2918 __ TryAllocate(compiler->double_class(), 2922 __ TryAllocate(compiler->double_class(),
2919 slow_path->entry_label(), 2923 slow_path->entry_label(),
2920 out_reg); 2924 out_reg,
2925 locs()->temp(0).reg());
2921 __ Bind(slow_path->exit_label()); 2926 __ Bind(slow_path->exit_label());
2922 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); 2927 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag);
2923 } 2928 }
2924 2929
2925 2930
2926 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { 2931 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const {
2927 const intptr_t kNumInputs = 1; 2932 const intptr_t kNumInputs = 1;
2928 const intptr_t value_cid = value()->Type()->ToCid(); 2933 const intptr_t value_cid = value()->Type()->ToCid();
2929 const bool needs_writable_input = (value_cid == kSmiCid); 2934 const bool needs_writable_input = (value_cid == kSmiCid);
2930 const intptr_t kNumTemps = 0; 2935 const intptr_t kNumTemps = 0;
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
4202 compiler->GenerateCall(token_pos(), 4207 compiler->GenerateCall(token_pos(),
4203 &label, 4208 &label,
4204 PcDescriptors::kOther, 4209 PcDescriptors::kOther,
4205 locs()); 4210 locs());
4206 __ Drop(2); // Discard type arguments and receiver. 4211 __ Drop(2); // Discard type arguments and receiver.
4207 } 4212 }
4208 4213
4209 } // namespace dart 4214 } // namespace dart
4210 4215
4211 #endif // defined TARGET_ARCH_MIPS 4216 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698