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

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

Issue 10823278: Use type propagation for removing Smi checks in binary operations and comparisons. Regis will adapt… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
11 #include "vm/flow_graph_compiler.h" 11 #include "vm/flow_graph_compiler.h"
12 #include "vm/locations.h" 12 #include "vm/locations.h"
13 #include "vm/object.h" 13 #include "vm/object.h"
14 #include "vm/object_store.h"
14 #include "vm/os.h" 15 #include "vm/os.h"
15 #include "vm/scopes.h" 16 #include "vm/scopes.h"
16 #include "vm/stub_code.h" 17 #include "vm/stub_code.h"
17 #include "vm/symbols.h" 18 #include "vm/symbols.h"
18 19
19 namespace dart { 20 namespace dart {
20 21
21 DECLARE_FLAG(bool, enable_type_checks); 22 DECLARE_FLAG(bool, enable_type_checks);
22 23
23 UseVal::UseVal(Definition* definition) 24 UseVal::UseVal(Definition* definition)
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 return AbstractType::null(); 761 return AbstractType::null();
761 } 762 }
762 763
763 764
764 RawAbstractType* CatchEntryComp::CompileType() const { 765 RawAbstractType* CatchEntryComp::CompileType() const {
765 return AbstractType::null(); 766 return AbstractType::null();
766 } 767 }
767 768
768 769
769 RawAbstractType* CheckStackOverflowComp::CompileType() const { 770 RawAbstractType* CheckStackOverflowComp::CompileType() const {
770 return Type::VoidType(); 771 return AbstractType::null();
771 } 772 }
772 773
773 774
774 RawAbstractType* BinaryOpComp::CompileType() const { 775 RawAbstractType* BinaryOpComp::CompileType() const {
775 // TODO(srdjan): Compute based on input types (ICData). 776 // TODO(srdjan): Add mint, smi and double type to object store.
776 return Type::DynamicType(); 777 // TODO(srdjan): Convert to use with class-ids instead of types.
778 if (operands_type() == kMintOperands) {
779 ObjectStore* object_store = Isolate::Current()->object_store();
780 return Type::NewNonParameterizedType(
781 Class::Handle(object_store->mint_class()));
782 } else if (op_kind() == Token::kSHL) {
783 return Type::IntInterface();
784 } else {
785 ASSERT(operands_type() == kSmiOperands);
786 ObjectStore* object_store = Isolate::Current()->object_store();
787 return Type::NewNonParameterizedType(
788 Class::Handle(object_store->smi_class()));
789 }
777 } 790 }
778 791
779 792
780 RawAbstractType* DoubleBinaryOpComp::CompileType() const { 793 RawAbstractType* DoubleBinaryOpComp::CompileType() const {
781 return Type::DoubleInterface(); 794 return Type::DoubleInterface();
782 } 795 }
783 796
784 797
785 RawAbstractType* UnarySmiOpComp::CompileType() const { 798 RawAbstractType* UnarySmiOpComp::CompileType() const {
786 return Type::IntInterface(); 799 return Type::IntInterface();
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 if (compiler->is_ssa()) { 1247 if (compiler->is_ssa()) {
1235 ASSERT(locs()->in(0).IsRegister()); 1248 ASSERT(locs()->in(0).IsRegister());
1236 __ PushRegister(locs()->in(0).reg()); 1249 __ PushRegister(locs()->in(0).reg());
1237 } 1250 }
1238 } 1251 }
1239 1252
1240 1253
1241 #undef __ 1254 #undef __
1242 1255
1243 } // namespace dart 1256 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698