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

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

Issue 3003793002: [vm,aot] Improve performance of certain 'is' operations (Closed)
Patch Set: Created 3 years, 4 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
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 eliminated ? "more" : "not more", 159 eliminated ? "more" : "not more",
160 String::Handle(dst_type.Name()).ToCString(), dst_name.ToCString()); 160 String::Handle(dst_type.Name()).ToCString(), dst_name.ToCString());
161 } 161 }
162 162
163 void CompileType::PrintTo(BufferFormatter* f) const { 163 void CompileType::PrintTo(BufferFormatter* f) const {
164 const char* type_name = "?"; 164 const char* type_name = "?";
165 if ((cid_ != kIllegalCid) && (cid_ != kDynamicCid)) { 165 if ((cid_ != kIllegalCid) && (cid_ != kDynamicCid)) {
166 const Class& cls = 166 const Class& cls =
167 Class::Handle(Isolate::Current()->class_table()->At(cid_)); 167 Class::Handle(Isolate::Current()->class_table()->At(cid_));
168 type_name = String::Handle(cls.ScrubbedName()).ToCString(); 168 type_name = String::Handle(cls.ScrubbedName()).ToCString();
169 } else if (type_ != NULL && 169 } else if (type_ != NULL && !type_->IsDynamicType()) {
170 !type_->Equals(Type::Handle(Type::DynamicType()))) {
171 type_name = type_->ToCString(); 170 type_name = type_->ToCString();
172 } else if (!is_nullable()) { 171 } else if (!is_nullable()) {
173 type_name = "!null"; 172 type_name = "!null";
174 } 173 }
175 174
176 f->Print("T{%s%s}", type_name, is_nullable_ ? "?" : ""); 175 f->Print("T{%s%s}", type_name, is_nullable_ ? "?" : "");
177 } 176 }
178 177
179 const char* CompileType::ToCString() const { 178 const char* CompileType::ToCString() const {
180 char buffer[1024]; 179 char buffer[1024];
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 f->Print("%s(", DebugName()); 360 f->Print("%s(", DebugName());
362 } 361 }
363 PrintOperandsTo(f); 362 PrintOperandsTo(f);
364 f->Print(")"); 363 f->Print(")");
365 if (range_ != NULL) { 364 if (range_ != NULL) {
366 f->Print(" "); 365 f->Print(" ");
367 range_->PrintTo(f); 366 range_->PrintTo(f);
368 } 367 }
369 368
370 if (type_ != NULL && 369 if (type_ != NULL &&
371 ((type_->ToNullableCid() != kDynamicCid) || !type_->is_nullable())) { 370 ((type_->ToNullableCid() != kDynamicCid) ||
371 !type_->ToAbstractType()->IsDynamicType() || !type_->is_nullable())) {
372 f->Print(" "); 372 f->Print(" ");
373 type_->PrintTo(f); 373 type_->PrintTo(f);
374 } 374 }
375 } 375 }
376 376
377 void Definition::PrintOperandsTo(BufferFormatter* f) const { 377 void Definition::PrintOperandsTo(BufferFormatter* f) const {
378 for (int i = 0; i < InputCount(); ++i) { 378 for (int i = 0; i < InputCount(); ++i) {
379 if (i > 0) f->Print(", "); 379 if (i > 0) f->Print(", ");
380 if (InputAt(i) != NULL) { 380 if (InputAt(i) != NULL) {
381 InputAt(i)->PrintTo(f); 381 InputAt(i)->PrintTo(f);
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 UNREACHABLE(); 1289 UNREACHABLE();
1290 } 1290 }
1291 1291
1292 bool FlowGraphPrinter::ShouldPrint(const Function& function) { 1292 bool FlowGraphPrinter::ShouldPrint(const Function& function) {
1293 return false; 1293 return false;
1294 } 1294 }
1295 1295
1296 #endif // !PRODUCT 1296 #endif // !PRODUCT
1297 1297
1298 } // namespace dart 1298 } // namespace dart
OLDNEW
« runtime/vm/flow_graph_type_propagator.cc ('K') | « runtime/vm/flow_graph_type_propagator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698