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

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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.cc » ('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/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/cha.h" 9 #include "vm/cha.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 DartEntry::ArgumentsDescriptor(argument_count, argument_names); 568 DartEntry::ArgumentsDescriptor(argument_count, argument_names);
569 EmitStaticCall(function, arguments_descriptor, argument_count, 569 EmitStaticCall(function, arguments_descriptor, argument_count,
570 deopt_id, token_pos, locs); 570 deopt_id, token_pos, locs);
571 } 571 }
572 572
573 573
574 void FlowGraphCompiler::GenerateNumberTypeCheck(Register kClassIdReg, 574 void FlowGraphCompiler::GenerateNumberTypeCheck(Register kClassIdReg,
575 const AbstractType& type, 575 const AbstractType& type,
576 Label* is_instance_lbl, 576 Label* is_instance_lbl,
577 Label* is_not_instance_lbl) { 577 Label* is_not_instance_lbl) {
578 assembler()->Comment("NumberTypeCheck");
578 GrowableArray<intptr_t> args; 579 GrowableArray<intptr_t> args;
579 if (type.IsNumberType()) { 580 if (type.IsNumberType()) {
580 args.Add(kDoubleCid); 581 args.Add(kDoubleCid);
581 args.Add(kMintCid); 582 args.Add(kMintCid);
582 args.Add(kBigintCid); 583 args.Add(kBigintCid);
583 } else if (type.IsIntType()) { 584 } else if (type.IsIntType()) {
584 args.Add(kMintCid); 585 args.Add(kMintCid);
585 args.Add(kBigintCid); 586 args.Add(kBigintCid);
586 } else if (type.IsDoubleType()) { 587 } else if (type.IsDoubleType()) {
587 args.Add(kDoubleCid); 588 args.Add(kDoubleCid);
588 } 589 }
589 CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl); 590 CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl);
590 } 591 }
591 592
592 593
593 void FlowGraphCompiler::GenerateStringTypeCheck(Register kClassIdReg, 594 void FlowGraphCompiler::GenerateStringTypeCheck(Register kClassIdReg,
594 Label* is_instance_lbl, 595 Label* is_instance_lbl,
595 Label* is_not_instance_lbl) { 596 Label* is_not_instance_lbl) {
597 assembler()->Comment("StringTypeCheck");
596 GrowableArray<intptr_t> args; 598 GrowableArray<intptr_t> args;
597 args.Add(kOneByteStringCid); 599 args.Add(kOneByteStringCid);
598 args.Add(kTwoByteStringCid); 600 args.Add(kTwoByteStringCid);
599 args.Add(kExternalOneByteStringCid); 601 args.Add(kExternalOneByteStringCid);
600 args.Add(kExternalTwoByteStringCid); 602 args.Add(kExternalTwoByteStringCid);
601 CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl); 603 CheckClassIds(kClassIdReg, args, is_instance_lbl, is_not_instance_lbl);
602 } 604 }
603 605
604 606
605 void FlowGraphCompiler::GenerateListTypeCheck(Register kClassIdReg, 607 void FlowGraphCompiler::GenerateListTypeCheck(Register kClassIdReg,
606 Label* is_instance_lbl) { 608 Label* is_instance_lbl) {
609 assembler()->Comment("ListTypeCheck");
607 Label unknown; 610 Label unknown;
608 GrowableArray<intptr_t> args; 611 GrowableArray<intptr_t> args;
609 args.Add(kArrayCid); 612 args.Add(kArrayCid);
610 args.Add(kGrowableObjectArrayCid); 613 args.Add(kGrowableObjectArrayCid);
611 args.Add(kImmutableArrayCid); 614 args.Add(kImmutableArrayCid);
612 CheckClassIds(kClassIdReg, args, is_instance_lbl, &unknown); 615 CheckClassIds(kClassIdReg, args, is_instance_lbl, &unknown);
613 assembler()->Bind(&unknown); 616 assembler()->Bind(&unknown);
614 } 617 }
615 618
616 619
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 const AbstractTypeArguments& type_arguments = 1027 const AbstractTypeArguments& type_arguments =
1025 AbstractTypeArguments::Handle(type.arguments()); 1028 AbstractTypeArguments::Handle(type.arguments());
1026 const bool is_raw_type = type_arguments.IsNull() || 1029 const bool is_raw_type = type_arguments.IsNull() ||
1027 type_arguments.IsRaw(type_arguments.Length()); 1030 type_arguments.IsRaw(type_arguments.Length());
1028 return is_raw_type; 1031 return is_raw_type;
1029 } 1032 }
1030 return true; 1033 return true;
1031 } 1034 }
1032 1035
1033 } // namespace dart 1036 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698