Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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): Convert to use with class-ids instead of types. |
| 776 return Type::DynamicType(); | 777 if (operands_type() == kMintOperands) { |
| 778 ObjectStore* object_store = Isolate::Current()->object_store(); | |
| 779 return Type::NewNonParameterizedType( | |
| 780 Class::Handle(object_store->mint_class())); | |
|
regis
2012/08/10 23:18:49
Add a TODO to add SmiType, MintType, and DoubleTyp
srdjan
2012/08/10 23:30:05
Done.
| |
| 781 } else if (op_kind() == Token::kSHL) { | |
| 782 return Type::IntInterface(); | |
| 783 } else { | |
| 784 ASSERT(operands_type() == kSmiOperands); | |
| 785 ObjectStore* object_store = Isolate::Current()->object_store(); | |
| 786 return Type::NewNonParameterizedType( | |
| 787 Class::Handle(object_store->smi_class())); | |
| 788 } | |
| 777 } | 789 } |
| 778 | 790 |
| 779 | 791 |
| 780 RawAbstractType* DoubleBinaryOpComp::CompileType() const { | 792 RawAbstractType* DoubleBinaryOpComp::CompileType() const { |
| 781 return Type::DoubleInterface(); | 793 return Type::DoubleInterface(); |
| 782 } | 794 } |
| 783 | 795 |
| 784 | 796 |
| 785 RawAbstractType* UnarySmiOpComp::CompileType() const { | 797 RawAbstractType* UnarySmiOpComp::CompileType() const { |
| 786 return Type::IntInterface(); | 798 return Type::IntInterface(); |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1234 if (compiler->is_ssa()) { | 1246 if (compiler->is_ssa()) { |
| 1235 ASSERT(locs()->in(0).IsRegister()); | 1247 ASSERT(locs()->in(0).IsRegister()); |
| 1236 __ PushRegister(locs()->in(0).reg()); | 1248 __ PushRegister(locs()->in(0).reg()); |
| 1237 } | 1249 } |
| 1238 } | 1250 } |
| 1239 | 1251 |
| 1240 | 1252 |
| 1241 #undef __ | 1253 #undef __ |
| 1242 | 1254 |
| 1243 } // namespace dart | 1255 } // namespace dart |
| OLD | NEW |