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

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

Issue 19256021: Merges ARM load/store type enums into one enum. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/flow_graph_compiler_arm.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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 LocationSummary* LoadLocalInstr::MakeLocationSummary() const { 166 LocationSummary* LoadLocalInstr::MakeLocationSummary() const {
167 return LocationSummary::Make(0, 167 return LocationSummary::Make(0,
168 Location::RequiresRegister(), 168 Location::RequiresRegister(),
169 LocationSummary::kNoCall); 169 LocationSummary::kNoCall);
170 } 170 }
171 171
172 172
173 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 173 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
174 Register result = locs()->out().reg(); 174 Register result = locs()->out().reg();
175 __ LoadFromOffset(kLoadWord, result, FP, local().index() * kWordSize); 175 __ LoadFromOffset(kWord, result, FP, local().index() * kWordSize);
176 } 176 }
177 177
178 178
179 LocationSummary* StoreLocalInstr::MakeLocationSummary() const { 179 LocationSummary* StoreLocalInstr::MakeLocationSummary() const {
180 return LocationSummary::Make(1, 180 return LocationSummary::Make(1,
181 Location::SameAsFirstInput(), 181 Location::SameAsFirstInput(),
182 LocationSummary::kNoCall); 182 LocationSummary::kNoCall);
183 } 183 }
184 184
185 185
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 const intptr_t kNumInputs = 1; 1037 const intptr_t kNumInputs = 1;
1038 return LocationSummary::Make(kNumInputs, 1038 return LocationSummary::Make(kNumInputs,
1039 Location::RequiresRegister(), 1039 Location::RequiresRegister(),
1040 LocationSummary::kNoCall); 1040 LocationSummary::kNoCall);
1041 } 1041 }
1042 1042
1043 1043
1044 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1044 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1045 Register object = locs()->in(0).reg(); 1045 Register object = locs()->in(0).reg();
1046 Register result = locs()->out().reg(); 1046 Register result = locs()->out().reg();
1047 __ LoadFromOffset(kLoadWord, result, object, offset() - kHeapObjectTag); 1047 __ LoadFromOffset(kWord, result, object, offset() - kHeapObjectTag);
1048 } 1048 }
1049 1049
1050 1050
1051 LocationSummary* LoadClassIdInstr::MakeLocationSummary() const { 1051 LocationSummary* LoadClassIdInstr::MakeLocationSummary() const {
1052 const intptr_t kNumInputs = 1; 1052 const intptr_t kNumInputs = 1;
1053 return LocationSummary::Make(kNumInputs, 1053 return LocationSummary::Make(kNumInputs,
1054 Location::RequiresRegister(), 1054 Location::RequiresRegister(),
1055 LocationSummary::kNoCall); 1055 LocationSummary::kNoCall);
1056 } 1056 }
1057 1057
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 1694
1695 1695
1696 // When the parser is building an implicit static getter for optimization, 1696 // When the parser is building an implicit static getter for optimization,
1697 // it can generate a function body where deoptimization ids do not line up 1697 // it can generate a function body where deoptimization ids do not line up
1698 // with the unoptimized code. 1698 // with the unoptimized code.
1699 // 1699 //
1700 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. 1700 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
1701 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1701 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1702 Register field = locs()->in(0).reg(); 1702 Register field = locs()->in(0).reg();
1703 Register result = locs()->out().reg(); 1703 Register result = locs()->out().reg();
1704 __ LoadFromOffset(kLoadWord, result, 1704 __ LoadFromOffset(kWord, result,
1705 field, Field::value_offset() - kHeapObjectTag); 1705 field, Field::value_offset() - kHeapObjectTag);
1706 } 1706 }
1707 1707
1708 1708
1709 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const { 1709 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
1710 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall); 1710 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall);
1711 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() 1711 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
1712 : Location::RequiresRegister()); 1712 : Location::RequiresRegister());
1713 locs->set_temp(0, Location::RequiresRegister()); 1713 locs->set_temp(0, Location::RequiresRegister());
1714 return locs; 1714 return locs;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1802 return LocationSummary::Make(1, 1802 return LocationSummary::Make(1,
1803 Location::RequiresRegister(), 1803 Location::RequiresRegister(),
1804 LocationSummary::kNoCall); 1804 LocationSummary::kNoCall);
1805 } 1805 }
1806 1806
1807 1807
1808 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1808 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1809 Register instance_reg = locs()->in(0).reg(); 1809 Register instance_reg = locs()->in(0).reg();
1810 Register result_reg = locs()->out().reg(); 1810 Register result_reg = locs()->out().reg();
1811 1811
1812 __ LoadFromOffset(kLoadWord, result_reg, 1812 __ LoadFromOffset(kWord, result_reg,
1813 instance_reg, offset_in_bytes() - kHeapObjectTag); 1813 instance_reg, offset_in_bytes() - kHeapObjectTag);
1814 } 1814 }
1815 1815
1816 1816
1817 LocationSummary* InstantiateTypeInstr::MakeLocationSummary() const { 1817 LocationSummary* InstantiateTypeInstr::MakeLocationSummary() const {
1818 const intptr_t kNumInputs = 1; 1818 const intptr_t kNumInputs = 1;
1819 const intptr_t kNumTemps = 0; 1819 const intptr_t kNumTemps = 0;
1820 LocationSummary* locs = 1820 LocationSummary* locs =
1821 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1821 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1822 locs->set_in(0, Location::RegisterLocation(R0)); 1822 locs->set_in(0, Location::RegisterLocation(R0));
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2037 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2037 void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2038 // Restore SP from FP as we are coming from a throw and the code for 2038 // Restore SP from FP as we are coming from a throw and the code for
2039 // popping arguments has not been run. 2039 // popping arguments has not been run.
2040 const intptr_t fp_sp_dist = 2040 const intptr_t fp_sp_dist =
2041 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; 2041 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize;
2042 ASSERT(fp_sp_dist <= 0); 2042 ASSERT(fp_sp_dist <= 0);
2043 __ AddImmediate(SP, FP, fp_sp_dist); 2043 __ AddImmediate(SP, FP, fp_sp_dist);
2044 2044
2045 ASSERT(!exception_var().is_captured()); 2045 ASSERT(!exception_var().is_captured());
2046 ASSERT(!stacktrace_var().is_captured()); 2046 ASSERT(!stacktrace_var().is_captured());
2047 __ StoreToOffset(kStoreWord, kExceptionObjectReg, 2047 __ StoreToOffset(kWord, kExceptionObjectReg,
2048 FP, exception_var().index() * kWordSize); 2048 FP, exception_var().index() * kWordSize);
2049 __ StoreToOffset(kStoreWord, kStackTraceObjectReg, 2049 __ StoreToOffset(kWord, kStackTraceObjectReg,
2050 FP, stacktrace_var().index() * kWordSize); 2050 FP, stacktrace_var().index() * kWordSize);
2051 2051
2052 // Restore the pool pointer. 2052 // Restore the pool pointer.
2053 __ LoadPoolPointer(); 2053 __ LoadPoolPointer();
2054 } 2054 }
2055 2055
2056 2056
2057 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const { 2057 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary() const {
2058 const intptr_t kNumInputs = 0; 2058 const intptr_t kNumInputs = 0;
2059 const intptr_t kNumTemps = 1; 2059 const intptr_t kNumTemps = 1;
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3193 compiler->GenerateStaticCall(deopt_id(), 3193 compiler->GenerateStaticCall(deopt_id(),
3194 instance_call()->token_pos(), 3194 instance_call()->token_pos(),
3195 target, 3195 target,
3196 instance_call()->ArgumentCount(), 3196 instance_call()->ArgumentCount(),
3197 instance_call()->argument_names(), 3197 instance_call()->argument_names(),
3198 locs()); 3198 locs());
3199 return; 3199 return;
3200 } 3200 }
3201 3201
3202 // Load receiver into R0. 3202 // Load receiver into R0.
3203 __ LoadFromOffset(kLoadWord, R0, SP, 3203 __ LoadFromOffset(kWord, R0, SP,
3204 (instance_call()->ArgumentCount() - 1) * kWordSize); 3204 (instance_call()->ArgumentCount() - 1) * kWordSize);
3205 3205
3206 LoadValueCid(compiler, R2, R0, 3206 LoadValueCid(compiler, R2, R0,
3207 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); 3207 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt);
3208 3208
3209 compiler->EmitTestAndCall(ic_data(), 3209 compiler->EmitTestAndCall(ic_data(),
3210 R2, // Class id register. 3210 R2, // Class id register.
3211 instance_call()->ArgumentCount(), 3211 instance_call()->ArgumentCount(),
3212 instance_call()->argument_names(), 3212 instance_call()->argument_names(),
3213 deopt, 3213 deopt,
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
3673 compiler->GenerateCall(token_pos(), 3673 compiler->GenerateCall(token_pos(),
3674 &label, 3674 &label,
3675 PcDescriptors::kOther, 3675 PcDescriptors::kOther,
3676 locs()); 3676 locs());
3677 __ Drop(2); // Discard type arguments and receiver. 3677 __ Drop(2); // Discard type arguments and receiver.
3678 } 3678 }
3679 3679
3680 } // namespace dart 3680 } // namespace dart
3681 3681
3682 #endif // defined TARGET_ARCH_ARM 3682 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698