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

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

Issue 178193020: Better inlining of type tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 const AbstractType& type, 493 const AbstractType& type,
494 Label* is_instance_lbl, 494 Label* is_instance_lbl,
495 Label* is_not_instance_lbl) { 495 Label* is_not_instance_lbl) {
496 __ TraceSimMsg("InlineInstanceof"); 496 __ TraceSimMsg("InlineInstanceof");
497 __ Comment("InlineInstanceof"); 497 __ Comment("InlineInstanceof");
498 if (type.IsVoidType()) { 498 if (type.IsVoidType()) {
499 // A non-null value is returned from a void function, which will result in a 499 // A non-null value is returned from a void function, which will result in a
500 // type error. A null value is handled prior to executing this inline code. 500 // type error. A null value is handled prior to executing this inline code.
501 return SubtypeTestCache::null(); 501 return SubtypeTestCache::null();
502 } 502 }
503 if (TypeCheckAsClassEquality(type)) {
504 const intptr_t type_cid = Class::Handle(type.type_class()).id();
505 const Register kInstanceReg = A0;
506 __ andi(CMPRES1, kInstanceReg, Immediate(kSmiTagMask));
507 if (type_cid == kSmiCid) {
508 __ beq(CMPRES1, ZR, is_instance_lbl);
509 } else {
510 __ beq(CMPRES1, ZR, is_not_instance_lbl);
511 __ LoadClassId(T0, kInstanceReg);
512 __ BranchEqual(T0, type_cid, is_instance_lbl);
513 }
514 __ b(is_not_instance_lbl);
515 return SubtypeTestCache::null();
516 }
517 if (type.IsInstantiated()) { 503 if (type.IsInstantiated()) {
518 const Class& type_class = Class::ZoneHandle(type.type_class()); 504 const Class& type_class = Class::ZoneHandle(type.type_class());
519 // A class equality check is only applicable with a dst type of a 505 // A class equality check is only applicable with a dst type of a
520 // non-parameterized class, non-signature class, or with a raw dst type of 506 // non-parameterized class, non-signature class, or with a raw dst type of
521 // a parameterized class. 507 // a parameterized class.
522 if (type_class.IsSignatureClass() || (type_class.NumTypeArguments() > 0)) { 508 if (type_class.IsSignatureClass() || (type_class.NumTypeArguments() > 0)) {
523 return GenerateInstantiatedTypeWithArgumentsTest(token_pos, 509 return GenerateInstantiatedTypeWithArgumentsTest(token_pos,
524 type, 510 type,
525 is_instance_lbl, 511 is_instance_lbl,
526 is_not_instance_lbl); 512 is_not_instance_lbl);
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 __ AddImmediate(SP, kDoubleSize); 1857 __ AddImmediate(SP, kDoubleSize);
1872 } 1858 }
1873 1859
1874 1860
1875 #undef __ 1861 #undef __
1876 1862
1877 1863
1878 } // namespace dart 1864 } // namespace dart
1879 1865
1880 #endif // defined TARGET_ARCH_MIPS 1866 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698