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

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

Issue 13474009: Implements optional parameter handling in MIPS vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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
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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 15 matching lines...) Expand all
26 // Generic summary for call instructions that have all arguments pushed 26 // Generic summary for call instructions that have all arguments pushed
27 // on the stack and return the result in a fixed register V0. 27 // on the stack and return the result in a fixed register V0.
28 LocationSummary* Instruction::MakeCallSummary() { 28 LocationSummary* Instruction::MakeCallSummary() {
29 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); 29 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall);
30 result->set_out(Location::RegisterLocation(V0)); 30 result->set_out(Location::RegisterLocation(V0));
31 return result; 31 return result;
32 } 32 }
33 33
34 34
35 LocationSummary* PushArgumentInstr::MakeLocationSummary() const { 35 LocationSummary* PushArgumentInstr::MakeLocationSummary() const {
36 UNIMPLEMENTED(); 36 const intptr_t kNumInputs = 1;
37 return NULL; 37 const intptr_t kNumTemps= 0;
38 LocationSummary* locs =
39 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
40 locs->set_in(0, Location::AnyOrConstant(value()));
41 return locs;
38 } 42 }
39 43
40 44
41 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 45 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
42 UNIMPLEMENTED(); 46 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
47 // where PushArgument is handled by BindInstr::EmitNativeCode.
48 if (compiler->is_optimizing()) {
49 Location value = locs()->in(0);
50 if (value.IsRegister()) {
51 __ Push(value.reg());
52 } else if (value.IsConstant()) {
53 __ PushObject(value.constant());
54 } else {
55 ASSERT(value.IsStackSlot());
56 __ lw(TMP, value.ToStackSlotAddress());
57 __ Push(TMP);
58 }
59 }
43 } 60 }
44 61
45 62
46 LocationSummary* ReturnInstr::MakeLocationSummary() const { 63 LocationSummary* ReturnInstr::MakeLocationSummary() const {
47 const intptr_t kNumInputs = 1; 64 const intptr_t kNumInputs = 1;
48 const intptr_t kNumTemps = 0; 65 const intptr_t kNumTemps = 0;
49 LocationSummary* locs = 66 LocationSummary* locs =
50 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 67 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
51 locs->set_in(0, Location::RegisterLocation(V0)); 68 locs->set_in(0, Location::RegisterLocation(V0));
52 return locs; 69 return locs;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 107 }
91 108
92 109
93 LocationSummary* ClosureCallInstr::MakeLocationSummary() const { 110 LocationSummary* ClosureCallInstr::MakeLocationSummary() const {
94 UNIMPLEMENTED(); 111 UNIMPLEMENTED();
95 return NULL; 112 return NULL;
96 } 113 }
97 114
98 115
99 LocationSummary* LoadLocalInstr::MakeLocationSummary() const { 116 LocationSummary* LoadLocalInstr::MakeLocationSummary() const {
100 UNIMPLEMENTED(); 117 return LocationSummary::Make(0,
101 return NULL; 118 Location::RequiresRegister(),
119 LocationSummary::kNoCall);
102 } 120 }
103 121
104 122
105 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 123 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
106 UNIMPLEMENTED(); 124 Register result = locs()->out().reg();
125 __ lw(result, Address(FP, local().index() * kWordSize));
107 } 126 }
108 127
109 128
110 LocationSummary* StoreLocalInstr::MakeLocationSummary() const { 129 LocationSummary* StoreLocalInstr::MakeLocationSummary() const {
111 UNIMPLEMENTED(); 130 return LocationSummary::Make(1,
112 return NULL; 131 Location::SameAsFirstInput(),
132 LocationSummary::kNoCall);
113 } 133 }
114 134
115 135
116 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 136 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
117 UNIMPLEMENTED(); 137 Register value = locs()->in(0).reg();
138 Register result = locs()->out().reg();
139 ASSERT(result == value); // Assert that register assignment is correct.
140 __ sw(value, Address(FP, local().index() * kWordSize));
118 } 141 }
119 142
120 143
121 LocationSummary* ConstantInstr::MakeLocationSummary() const { 144 LocationSummary* ConstantInstr::MakeLocationSummary() const {
122 return LocationSummary::Make(0, 145 return LocationSummary::Make(0,
123 Location::RequiresRegister(), 146 Location::RequiresRegister(),
124 LocationSummary::kNoCall); 147 LocationSummary::kNoCall);
125 } 148 }
126 149
127 150
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 912
890 913
891 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 914 void CreateClosureInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
892 UNIMPLEMENTED(); 915 UNIMPLEMENTED();
893 } 916 }
894 917
895 } // namespace dart 918 } // namespace dart
896 919
897 #endif // defined TARGET_ARCH_MIPS 920 #endif // defined TARGET_ARCH_MIPS
898 921
OLDNEW
« runtime/vm/flow_graph_compiler_mips.cc ('K') | « runtime/vm/flow_graph_compiler_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698