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

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

Issue 11280230: Optimize checked mode asserts with uninstantiated types and known constant type-arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 DartEntry::ArgumentsDescriptor(argument_count, argument_names); 566 DartEntry::ArgumentsDescriptor(argument_count, argument_names);
567 EmitStaticCall(function, arguments_descriptor, argument_count, 567 EmitStaticCall(function, arguments_descriptor, argument_count,
568 deopt_id, token_pos, locs); 568 deopt_id, token_pos, locs);
569 } 569 }
570 570
571 571
572 void FlowGraphCompiler::GenerateNumberTypeCheck(Register kClassIdReg, 572 void FlowGraphCompiler::GenerateNumberTypeCheck(Register kClassIdReg,
573 const AbstractType& type, 573 const AbstractType& type,
574 Label* is_instance_lbl, 574 Label* is_instance_lbl,
575 Label* is_not_instance_lbl) { 575 Label* is_not_instance_lbl) {
576 assembler()->Comment("NumberTypeCheck");
576 GrowableArray<intptr_t> args; 577 GrowableArray<intptr_t> args;
577 if (type.IsNumberType()) { 578 if (type.IsNumberType()) {
578 args.Add(kDoubleCid); 579 args.Add(kDoubleCid);
579 args.Add(kMintCid); 580 args.Add(kMintCid);
580 args.Add(kBigintCid); 581 args.Add(kBigintCid);
581 } else if (type.IsIntType()) { 582 } else if (type.IsIntType()) {
582 args.Add(kMintCid); 583 args.Add(kMintCid);
583 args.Add(kBigintCid); 584 args.Add(kBigintCid);
584 } else if (type.IsDoubleType()) { 585 } else if (type.IsDoubleType()) {
585 args.Add(kDoubleCid); 586 args.Add(kDoubleCid);
586 } 587 }
587 CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl); 588 CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl);
588 } 589 }
589 590
590 591
591 void FlowGraphCompiler::GenerateStringTypeCheck(Register kClassIdReg, 592 void FlowGraphCompiler::GenerateStringTypeCheck(Register kClassIdReg,
592 Label* is_instance_lbl, 593 Label* is_instance_lbl,
593 Label* is_not_instance_lbl) { 594 Label* is_not_instance_lbl) {
595 assembler()->Comment("StringTypeCheck");
594 GrowableArray<intptr_t> args; 596 GrowableArray<intptr_t> args;
595 args.Add(kOneByteStringCid); 597 args.Add(kOneByteStringCid);
596 args.Add(kTwoByteStringCid); 598 args.Add(kTwoByteStringCid);
597 args.Add(kExternalOneByteStringCid); 599 args.Add(kExternalOneByteStringCid);
598 args.Add(kExternalTwoByteStringCid); 600 args.Add(kExternalTwoByteStringCid);
599 CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl); 601 CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl);
600 } 602 }
601 603
602 604
603 void FlowGraphCompiler::GenerateListTypeCheck(Register kClassIdReg, 605 void FlowGraphCompiler::GenerateListTypeCheck(Register kClassIdReg,
604 Label* is_instance_lbl) { 606 Label* is_instance_lbl) {
607 assembler()->Comment("ListTypeCheck");
605 Label unknown; 608 Label unknown;
606 GrowableArray<intptr_t> args; 609 GrowableArray<intptr_t> args;
607 args.Add(kArrayCid); 610 args.Add(kArrayCid);
608 args.Add(kGrowableObjectArrayCid); 611 args.Add(kGrowableObjectArrayCid);
609 args.Add(kImmutableArrayCid); 612 args.Add(kImmutableArrayCid);
610 CheckClassIds(kClassIdReg, args, is_instance_lbl, &unknown); 613 CheckClassIds(kClassIdReg, args, is_instance_lbl, &unknown);
611 assembler()->Bind(&unknown); 614 assembler()->Bind(&unknown);
612 } 615 }
613 616
614 617
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 return FieldAddress(array, index, TIMES_4, Float64Array::data_offset()); 1001 return FieldAddress(array, index, TIMES_4, Float64Array::data_offset());
999 case kUint8ArrayCid: 1002 case kUint8ArrayCid:
1000 return FieldAddress(array, index, TIMES_1, Uint8Array::data_offset()); 1003 return FieldAddress(array, index, TIMES_1, Uint8Array::data_offset());
1001 default: 1004 default:
1002 UNIMPLEMENTED(); 1005 UNIMPLEMENTED();
1003 return FieldAddress(SPREG, 0); 1006 return FieldAddress(SPREG, 0);
1004 } 1007 }
1005 } 1008 }
1006 1009
1007 } // namespace dart 1010 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_x64.cc » ('j') | runtime/vm/intermediate_language.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698