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

Side by Side Diff: vm/intermediate_language_ia32.cc

Issue 10447143: Port StoreContext, CurrentContext, CreateClosure and ClosureCall to ia32 flow-graph compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 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 | « no previous file | no next file » | 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) 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/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return NULL; 139 return NULL;
140 } 140 }
141 141
142 142
143 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 143 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
144 UNIMPLEMENTED(); 144 UNIMPLEMENTED();
145 } 145 }
146 146
147 147
148 LocationSummary* CurrentContextComp::MakeLocationSummary() const { 148 LocationSummary* CurrentContextComp::MakeLocationSummary() const {
149 return NULL; 149 return LocationSummary::Make(0, Location::RequiresRegister());
150 } 150 }
151 151
152 152
153 void CurrentContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { 153 void CurrentContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
154 UNIMPLEMENTED(); 154 __ movl(locs()->out().reg(), CTX);
155 } 155 }
156 156
157 157
158 LocationSummary* StoreContextComp::MakeLocationSummary() const { 158 LocationSummary* StoreContextComp::MakeLocationSummary() const {
159 return NULL; 159 const intptr_t kNumInputs = 1;
160 const intptr_t kNumTemps = 0;
161 LocationSummary* summary = new LocationSummary(kNumInputs, kNumTemps);
162 summary->set_in(0, Location::RegisterLocation(CTX));
163 return summary;
160 } 164 }
161 165
162 166
163 void StoreContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { 167 void StoreContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
164 UNIMPLEMENTED(); 168 // Nothing to do. Context register were loaded by register allocator.
169 ASSERT(locs()->in(0).reg() == CTX);
165 } 170 }
166 171
167 172
168 LocationSummary* StrictCompareComp::MakeLocationSummary() const { 173 LocationSummary* StrictCompareComp::MakeLocationSummary() const {
169 return NULL; 174 return NULL;
170 } 175 }
171 176
172 177
173 void StrictCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) { 178 void StrictCompareComp::EmitNativeCode(FlowGraphCompiler* compiler) {
174 UNIMPLEMENTED(); 179 UNIMPLEMENTED();
175 } 180 }
176 181
177 182
178 LocationSummary* ClosureCallComp::MakeLocationSummary() const { 183 LocationSummary* ClosureCallComp::MakeLocationSummary() const {
179 return NULL; 184 return MakeCallSummary();
180 } 185 }
181 186
182 187
183 void ClosureCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { 188 void ClosureCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
184 UNIMPLEMENTED(); 189 ASSERT(VerifyCallComputation(this));
190 // The arguments to the stub include the closure. The arguments
191 // descriptor describes the closure's arguments (and so does not include
192 // the closure).
193 int argument_count = ArgumentCount();
194 const Array& arguments_descriptor =
195 CodeGenerator::ArgumentsDescriptor(argument_count - 1,
196 argument_names());
197 __ LoadObject(EDX, arguments_descriptor);
198 compiler->GenerateCall(token_index(),
199 try_index(),
200 &StubCode::CallClosureFunctionLabel(),
201 PcDescriptors::kOther);
202 __ Drop(argument_count);
185 } 203 }
186 204
187 205
188 LocationSummary* InstanceCallComp::MakeLocationSummary() const { 206 LocationSummary* InstanceCallComp::MakeLocationSummary() const {
189 return MakeCallSummary(); 207 return MakeCallSummary();
190 } 208 }
191 209
192 210
193 void InstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { 211 void InstanceCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
194 ASSERT(VerifyCallComputation(this)); 212 ASSERT(VerifyCallComputation(this));
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 return NULL; 447 return NULL;
430 } 448 }
431 449
432 450
433 void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) { 451 void CreateArrayComp::EmitNativeCode(FlowGraphCompiler* compiler) {
434 UNIMPLEMENTED(); 452 UNIMPLEMENTED();
435 } 453 }
436 454
437 455
438 LocationSummary* CreateClosureComp::MakeLocationSummary() const { 456 LocationSummary* CreateClosureComp::MakeLocationSummary() const {
439 return NULL; 457 return MakeCallSummary();
440 } 458 }
441 459
442 460
443 void CreateClosureComp::EmitNativeCode(FlowGraphCompiler* compiler) { 461 void CreateClosureComp::EmitNativeCode(FlowGraphCompiler* compiler) {
444 UNIMPLEMENTED(); 462 const Function& closure_function = function();
463 const Code& stub = Code::Handle(
464 StubCode::GetAllocationStubForClosure(closure_function));
465 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
466 compiler->GenerateCall(token_index(), try_index(), &label,
467 PcDescriptors::kOther);
468 __ Drop(2); // Discard type arguments and receiver.
445 } 469 }
446 470
447 471
448 LocationSummary* AllocateObjectComp::MakeLocationSummary() const { 472 LocationSummary* AllocateObjectComp::MakeLocationSummary() const {
449 return NULL; 473 return NULL;
450 } 474 }
451 475
452 476
453 void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) { 477 void AllocateObjectComp::EmitNativeCode(FlowGraphCompiler* compiler) {
454 UNIMPLEMENTED(); 478 UNIMPLEMENTED();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 void NumberNegateComp::EmitNativeCode(FlowGraphCompiler* compile) { 630 void NumberNegateComp::EmitNativeCode(FlowGraphCompiler* compile) {
607 UNIMPLEMENTED(); 631 UNIMPLEMENTED();
608 } 632 }
609 633
610 634
611 } // namespace dart 635 } // namespace dart
612 636
613 #undef __ 637 #undef __
614 638
615 #endif // defined TARGET_ARCH_X64 639 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698