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

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

Issue 10879005: Split BinaryOp into BinarySmiOp and BinaryMintOp. (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/intermediate_language.h ('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"
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 RawAbstractType* CatchEntryComp::CompileType() const { 982 RawAbstractType* CatchEntryComp::CompileType() const {
983 return AbstractType::null(); 983 return AbstractType::null();
984 } 984 }
985 985
986 986
987 RawAbstractType* CheckStackOverflowComp::CompileType() const { 987 RawAbstractType* CheckStackOverflowComp::CompileType() const {
988 return AbstractType::null(); 988 return AbstractType::null();
989 } 989 }
990 990
991 991
992 RawAbstractType* BinaryOpComp::CompileType() const { 992 RawAbstractType* BinarySmiOpComp::CompileType() const {
993 ObjectStore* object_store = Isolate::Current()->object_store(); 993 ObjectStore* object_store = Isolate::Current()->object_store();
994 if (operands_type() == kMintOperands) { 994 return (op_kind() == Token::kSHL)
Vyacheslav Egorov (Google) 2012/08/22 11:15:23 I would prefer if-statement when ?: does not fit o
995 return object_store->mint_type(); 995 ? Type::IntInterface()
996 } 996 : object_store->smi_type();
997 if (op_kind() == Token::kSHL) {
998 return Type::IntInterface();
999 }
1000 ASSERT(operands_type() == kSmiOperands);
1001 return object_store->smi_type();
1002 } 997 }
1003 998
1004 999
1005 intptr_t BinaryOpComp::ResultCid() const { 1000 intptr_t BinarySmiOpComp::ResultCid() const {
1006 if (operands_type() == kMintOperands) {
1007 return kMintCid;
1008 }
1009 ASSERT(operands_type() == kSmiOperands);
1010 return (op_kind() == Token::kSHL) ? kDynamicCid : kSmiCid; 1001 return (op_kind() == Token::kSHL) ? kDynamicCid : kSmiCid;
1011 } 1002 }
1012 1003
1013 1004
1014 RawAbstractType* DoubleBinaryOpComp::CompileType() const { 1005 RawAbstractType* BinaryMintOpComp::CompileType() const {
1006 ObjectStore* object_store = Isolate::Current()->object_store();
1007 return object_store->mint_type();
1008 }
1009
1010
1011 intptr_t BinaryMintOpComp::ResultCid() const {
1012 return kMintCid;
1013 }
1014
1015
1016 RawAbstractType* BinaryDoubleOpComp::CompileType() const {
1015 return Type::DoubleInterface(); 1017 return Type::DoubleInterface();
1016 } 1018 }
1017 1019
1018 1020
1019 intptr_t DoubleBinaryOpComp::ResultCid() const { 1021 intptr_t BinaryDoubleOpComp::ResultCid() const {
1020 return kDoubleCid; 1022 return kDoubleCid;
1021 } 1023 }
1022 1024
1023 1025
1024 RawAbstractType* UnarySmiOpComp::CompileType() const { 1026 RawAbstractType* UnarySmiOpComp::CompileType() const {
1025 return Type::IntInterface(); 1027 return Type::IntInterface();
1026 } 1028 }
1027 1029
1028 1030
1029 RawAbstractType* NumberNegateComp::CompileType() const { 1031 RawAbstractType* NumberNegateComp::CompileType() const {
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 fixed_parameter_count_(fixed_parameter_count) { 1526 fixed_parameter_count_(fixed_parameter_count) {
1525 for (intptr_t i = 0; i < definitions.length(); ++i) { 1527 for (intptr_t i = 0; i < definitions.length(); ++i) {
1526 values_.Add(UseDefinition(definitions[i])); 1528 values_.Add(UseDefinition(definitions[i]));
1527 } 1529 }
1528 } 1530 }
1529 1531
1530 1532
1531 #undef __ 1533 #undef __
1532 1534
1533 } // namespace dart 1535 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698