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

Side by Side Diff: runtime/vm/locations.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: 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
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/locations.h" 5 #include "vm/locations.h"
6 6
7 #include "vm/assembler.h"
7 #include "vm/il_printer.h" 8 #include "vm/il_printer.h"
8 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
9 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
10 11
11 namespace dart { 12 namespace dart {
12 13
13 LocationSummary::LocationSummary(intptr_t input_count, 14 LocationSummary::LocationSummary(intptr_t input_count,
14 intptr_t temp_count, 15 intptr_t temp_count,
15 LocationSummary::ContainsCall contains_call) 16 LocationSummary::ContainsCall contains_call)
16 : input_locations_(input_count), 17 : input_locations_(input_count),
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 71
71 72
72 Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) { 73 Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) {
73 ConstantInstr* constant = value->definition()->AsConstant(); 74 ConstantInstr* constant = value->definition()->AsConstant();
74 return ((constant != NULL) && constant->value().IsSmi()) 75 return ((constant != NULL) && constant->value().IsSmi())
75 ? Location::Constant(constant->value()) 76 ? Location::Constant(constant->value())
76 : Location::RegisterLocation(reg); 77 : Location::RegisterLocation(reg);
77 } 78 }
78 79
79 80
81 Address Location::ToStackSlotAddress() const {
82 const intptr_t index = stack_index();
83 if (index < 0) {
84 const intptr_t offset = (1 - index) * kWordSize;
85 return Address(FPREG, offset);
86 } else {
87 const intptr_t offset =
88 (ParsedFunction::kFirstLocalSlotIndex - index) * kWordSize;
89 return Address(FPREG, offset);
90 }
91 }
92
93
80 const char* Location::Name() const { 94 const char* Location::Name() const {
81 switch (kind()) { 95 switch (kind()) {
82 case kInvalid: return "?"; 96 case kInvalid: return "?";
83 case kRegister: return Assembler::RegisterName(reg()); 97 case kRegister: return Assembler::RegisterName(reg());
84 case kXmmRegister: return Assembler::XmmRegisterName(xmm_reg()); 98 case kXmmRegister: return Assembler::XmmRegisterName(xmm_reg());
85 case kStackSlot: return "S"; 99 case kStackSlot: return "S";
86 case kDoubleStackSlot: return "DS"; 100 case kDoubleStackSlot: return "DS";
87 case kUnallocated: 101 case kUnallocated:
88 switch (policy()) { 102 switch (policy()) {
89 case kAny: 103 case kAny:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 163
150 if (!out().IsInvalid()) { 164 if (!out().IsInvalid()) {
151 f->Print(" => "); 165 f->Print(" => ");
152 out().PrintTo(f); 166 out().PrintTo(f);
153 } 167 }
154 168
155 if (always_calls()) f->Print(" C"); 169 if (always_calls()) f->Print(" C");
156 } 170 }
157 171
158 } // namespace dart 172 } // namespace dart
OLDNEW
« runtime/vm/intermediate_language_x64.cc ('K') | « runtime/vm/locations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698