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

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

Issue 490573003: Small improvements in array code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/flow_graph_range_analysis.h" 7 #include "vm/flow_graph_range_analysis.h"
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 void MaterializeObjectInstr::PrintOperandsTo(BufferFormatter* f) const { 515 void MaterializeObjectInstr::PrintOperandsTo(BufferFormatter* f) const {
516 f->Print("%s", String::Handle(cls_.Name()).ToCString()); 516 f->Print("%s", String::Handle(cls_.Name()).ToCString());
517 for (intptr_t i = 0; i < InputCount(); i++) { 517 for (intptr_t i = 0; i < InputCount(); i++) {
518 f->Print(", "); 518 f->Print(", ");
519 f->Print("%s: ", slots_[i]->ToCString()); 519 f->Print("%s: ", slots_[i]->ToCString());
520 InputAt(i)->PrintTo(f); 520 InputAt(i)->PrintTo(f);
521 } 521 }
522 } 522 }
523 523
524 524
525 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const {
526 for (int i = 0; i < ArgumentCount(); ++i) {
527 if (i != 0) f->Print(", ");
528 PushArgumentAt(i)->value()->PrintTo(f);
529 }
530 if (ArgumentCount() > 0) f->Print(", ");
531 element_type()->PrintTo(f);
532 }
533
534
535 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { 525 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const {
536 instance()->PrintTo(f); 526 instance()->PrintTo(f);
537 f->Print(", %" Pd, offset_in_bytes()); 527 f->Print(", %" Pd, offset_in_bytes());
538 528
539 if (field() != NULL) { 529 if (field() != NULL) {
540 f->Print(" {%s}", String::Handle(field()->name()).ToCString()); 530 f->Print(" {%s}", String::Handle(field()->name()).ToCString());
541 const char* expected = "?"; 531 const char* expected = "?";
542 if (field()->guarded_cid() != kIllegalCid) { 532 if (field()->guarded_cid() != kIllegalCid) {
543 const Class& cls = Class::Handle( 533 const Class& cls = Class::Handle(
544 Isolate::Current()->class_table()->At(field()->guarded_cid())); 534 Isolate::Current()->class_table()->At(field()->guarded_cid()));
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 } 1094 }
1105 1095
1106 const char* Environment::ToCString() const { 1096 const char* Environment::ToCString() const {
1107 char buffer[1024]; 1097 char buffer[1024];
1108 BufferFormatter bf(buffer, 1024); 1098 BufferFormatter bf(buffer, 1024);
1109 PrintTo(&bf); 1099 PrintTo(&bf);
1110 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); 1100 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer);
1111 } 1101 }
1112 1102
1113 } // namespace dart 1103 } // 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