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

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

Issue 10910003: Only store IC data with instructions that collect type feedback. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('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/il_printer.h" 5 #include "vm/il_printer.h"
6 6
7 #include "vm/intermediate_language.h" 7 #include "vm/intermediate_language.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 #include "vm/parser.h" 9 #include "vm/parser.h"
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 f->Print("]"); 129 f->Print("]");
130 } 130 }
131 131
132 132
133 void Computation::PrintTo(BufferFormatter* f) const { 133 void Computation::PrintTo(BufferFormatter* f) const {
134 // Do not access 'deopt_id()' as it asserts that the computation can 134 // Do not access 'deopt_id()' as it asserts that the computation can
135 // deoptimize. 135 // deoptimize.
136 f->Print("%s:%d(", DebugName(), deopt_id_); 136 f->Print("%s:%d(", DebugName(), deopt_id_);
137 PrintOperandsTo(f); 137 PrintOperandsTo(f);
138 f->Print(")"); 138 f->Print(")");
139 if (HasICData()) {
140 PrintICData(f, *ic_data());
141 }
142 } 139 }
143 140
144 141
145 void Computation::PrintOperandsTo(BufferFormatter* f) const { 142 void Computation::PrintOperandsTo(BufferFormatter* f) const {
146 for (int i = 0; i < InputCount(); ++i) { 143 for (int i = 0; i < InputCount(); ++i) {
147 if (i > 0) f->Print(", "); 144 if (i > 0) f->Print(", ");
148 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f); 145 if (InputAt(i) != NULL) InputAt(i)->PrintTo(f);
149 } 146 }
150 } 147 }
151 148
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 189 }
193 } 190 }
194 191
195 192
196 void InstanceCallComp::PrintOperandsTo(BufferFormatter* f) const { 193 void InstanceCallComp::PrintOperandsTo(BufferFormatter* f) const {
197 f->Print("%s", function_name().ToCString()); 194 f->Print("%s", function_name().ToCString());
198 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 195 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
199 f->Print(", "); 196 f->Print(", ");
200 ArgumentAt(i)->value()->PrintTo(f); 197 ArgumentAt(i)->value()->PrintTo(f);
201 } 198 }
199 if (HasICData()) {
200 PrintICData(f, *ic_data());
201 }
202 } 202 }
203 203
204 204
205 void PolymorphicInstanceCallComp::PrintTo(BufferFormatter* f) const { 205 void PolymorphicInstanceCallComp::PrintTo(BufferFormatter* f) const {
206 f->Print("%s(", DebugName()); 206 f->Print("%s(", DebugName());
207 instance_call()->PrintOperandsTo(f); 207 instance_call()->PrintOperandsTo(f);
208 f->Print(") "); 208 f->Print(") ");
209 if (HasICData()) { 209 PrintICData(f, ic_data());
210 PrintICData(f, *ic_data());
211 }
212 } 210 }
213 211
214 212
215 void StrictCompareComp::PrintOperandsTo(BufferFormatter* f) const { 213 void StrictCompareComp::PrintOperandsTo(BufferFormatter* f) const {
216 f->Print("%s, ", Token::Str(kind())); 214 f->Print("%s, ", Token::Str(kind()));
217 left()->PrintTo(f); 215 left()->PrintTo(f);
218 f->Print(", "); 216 f->Print(", ");
219 right()->PrintTo(f); 217 right()->PrintTo(f);
220 } 218 }
221 219
222 220
223 void EqualityCompareComp::PrintOperandsTo(BufferFormatter* f) const { 221 void EqualityCompareComp::PrintOperandsTo(BufferFormatter* f) const {
224 left()->PrintTo(f); 222 left()->PrintTo(f);
225 f->Print(" %s ", Token::Str(kind())); 223 f->Print(" %s ", Token::Str(kind()));
226 right()->PrintTo(f); 224 right()->PrintTo(f);
225 if (HasICData()) {
226 PrintICData(f, *ic_data());
227 }
227 } 228 }
228 229
229 230
230 void StaticCallComp::PrintOperandsTo(BufferFormatter* f) const { 231 void StaticCallComp::PrintOperandsTo(BufferFormatter* f) const {
231 f->Print("%s ", String::Handle(function().name()).ToCString()); 232 f->Print("%s ", String::Handle(function().name()).ToCString());
232 for (intptr_t i = 0; i < ArgumentCount(); ++i) { 233 for (intptr_t i = 0; i < ArgumentCount(); ++i) {
233 if (i > 0) f->Print(", "); 234 if (i > 0) f->Print(", ");
234 ArgumentAt(i)->value()->PrintTo(f); 235 ArgumentAt(i)->value()->PrintTo(f);
235 } 236 }
236 } 237 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 instantiator_type_arguments()->PrintTo(f); 291 instantiator_type_arguments()->PrintTo(f);
291 f->Print(")"); 292 f->Print(")");
292 } 293 }
293 294
294 295
295 void RelationalOpComp::PrintOperandsTo(BufferFormatter* f) const { 296 void RelationalOpComp::PrintOperandsTo(BufferFormatter* f) const {
296 f->Print("%s, ", Token::Str(kind())); 297 f->Print("%s, ", Token::Str(kind()));
297 left()->PrintTo(f); 298 left()->PrintTo(f);
298 f->Print(", "); 299 f->Print(", ");
299 right()->PrintTo(f); 300 right()->PrintTo(f);
301 if (HasICData()) {
302 PrintICData(f, *ic_data());
303 }
300 } 304 }
301 305
302 306
303 void AllocateObjectComp::PrintOperandsTo(BufferFormatter* f) const { 307 void AllocateObjectComp::PrintOperandsTo(BufferFormatter* f) const {
304 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); 308 f->Print("%s", Class::Handle(constructor().Owner()).ToCString());
305 for (intptr_t i = 0; i < ArgumentCount(); i++) { 309 for (intptr_t i = 0; i < ArgumentCount(); i++) {
306 f->Print(", "); 310 f->Print(", ");
307 ArgumentAt(i)->value()->PrintTo(f); 311 ArgumentAt(i)->value()->PrintTo(f);
308 } 312 }
309 } 313 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 412
409 413
410 void UnarySmiOpComp::PrintOperandsTo(BufferFormatter* f) const { 414 void UnarySmiOpComp::PrintOperandsTo(BufferFormatter* f) const {
411 f->Print("%s, ", Token::Str(op_kind())); 415 f->Print("%s, ", Token::Str(op_kind()));
412 value()->PrintTo(f); 416 value()->PrintTo(f);
413 } 417 }
414 418
415 419
416 void CheckClassComp::PrintOperandsTo(BufferFormatter* f) const { 420 void CheckClassComp::PrintOperandsTo(BufferFormatter* f) const {
417 value()->PrintTo(f); 421 value()->PrintTo(f);
418 f->Print(", cid={"); 422 PrintICData(f, unary_checks());
419 for (intptr_t i = 0; i < ic_data()->NumberOfChecks(); i++) {
420 f->Print("%d ", ic_data()->GetReceiverClassIdAt(i));
421 }
422 f->Print("}");
423 } 423 }
424 424
425 425
426 void GraphEntryInstr::PrintTo(BufferFormatter* f) const { 426 void GraphEntryInstr::PrintTo(BufferFormatter* f) const {
427 f->Print("%2d: [graph]", block_id()); 427 f->Print("%2d: [graph]", block_id());
428 if (start_env_ != NULL) { 428 if (start_env_ != NULL) {
429 f->Print("\n{\n"); 429 f->Print("\n{\n");
430 const GrowableArray<Value*>& values = start_env_->values(); 430 const GrowableArray<Value*>& values = start_env_->values();
431 for (intptr_t i = 0; i < values.length(); i++) { 431 for (intptr_t i = 0; i < values.length(); i++) {
432 Definition* def = values[i]->definition(); 432 Definition* def = values[i]->definition();
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 if ((locations_ != NULL) && !locations_[i].IsInvalid()) { 808 if ((locations_ != NULL) && !locations_[i].IsInvalid()) {
809 f->Print(" ["); 809 f->Print(" [");
810 locations_[i].PrintTo(f); 810 locations_[i].PrintTo(f);
811 f->Print("]"); 811 f->Print("]");
812 } 812 }
813 } 813 }
814 f->Print(" }"); 814 f->Print(" }");
815 } 815 }
816 816
817 } // namespace dart 817 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698