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

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

Issue 11791051: Support immediate and memory operands for PushArgumentInstr in optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: really handle constant operands Created 7 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.cc ('k') | runtime/vm/intermediate_language_x64.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) 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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // Generic summary for call instructions that have all arguments pushed 25 // Generic summary for call instructions that have all arguments pushed
26 // on the stack and return the result in a fixed register EAX. 26 // on the stack and return the result in a fixed register EAX.
27 LocationSummary* Instruction::MakeCallSummary() { 27 LocationSummary* Instruction::MakeCallSummary() {
28 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); 28 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall);
29 result->set_out(Location::RegisterLocation(EAX)); 29 result->set_out(Location::RegisterLocation(EAX));
30 return result; 30 return result;
31 } 31 }
32 32
33 33
34 LocationSummary* PushArgumentInstr::MakeLocationSummary() const {
35 const intptr_t kNumInputs = 1;
36 const intptr_t kNumTemps= 0;
37 LocationSummary* locs =
38 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
39 locs->set_in(0, Location::AnyOrConstant(value()));
40 return locs;
41 }
42
43
44 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
45 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
46 // where PushArgument is handled by BindInstr::EmitNativeCode.
47 if (compiler->is_optimizing()) {
48 Location value = locs()->in(0);
49 if (value.IsRegister()) {
50 __ pushl(value.reg());
51 } else if (value.IsConstant()) {
52 __ PushObject(value.constant());
53 } else {
54 ASSERT(value.IsStackSlot());
55 __ pushl(value.ToStackSlotAddress());
56 }
57 }
58 }
59
60
34 LocationSummary* ReturnInstr::MakeLocationSummary() const { 61 LocationSummary* ReturnInstr::MakeLocationSummary() const {
35 const intptr_t kNumInputs = 1; 62 const intptr_t kNumInputs = 1;
36 const intptr_t kNumTemps = 1; 63 const intptr_t kNumTemps = 1;
37 LocationSummary* locs = 64 LocationSummary* locs =
38 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 65 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
39 locs->set_in(0, Location::RegisterLocation(EAX)); 66 locs->set_in(0, Location::RegisterLocation(EAX));
40 locs->set_temp(0, Location::RegisterLocation(EDX)); 67 locs->set_temp(0, Location::RegisterLocation(EDX));
41 return locs; 68 return locs;
42 } 69 }
43 70
(...skipping 2770 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. 2841 __ pcmpeqq(XMM0, XMM0); // Generate all 1's.
2815 __ pxor(value, XMM0); 2842 __ pxor(value, XMM0);
2816 } 2843 }
2817 2844
2818 2845
2819 } // namespace dart 2846 } // namespace dart
2820 2847
2821 #undef __ 2848 #undef __
2822 2849
2823 #endif // defined TARGET_ARCH_X64 2850 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698