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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 11125)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -989,34 +989,36 @@
}
-RawAbstractType* BinaryOpComp::CompileType() const {
+RawAbstractType* BinarySmiOpComp::CompileType() const {
ObjectStore* object_store = Isolate::Current()->object_store();
- if (operands_type() == kMintOperands) {
- return object_store->mint_type();
- }
- if (op_kind() == Token::kSHL) {
- return Type::IntInterface();
- }
- ASSERT(operands_type() == kSmiOperands);
- return object_store->smi_type();
+ return (op_kind() == Token::kSHL)
Vyacheslav Egorov (Google) 2012/08/22 11:15:23 I would prefer if-statement when ?: does not fit o
+ ? Type::IntInterface()
+ : object_store->smi_type();
}
-intptr_t BinaryOpComp::ResultCid() const {
- if (operands_type() == kMintOperands) {
- return kMintCid;
- }
- ASSERT(operands_type() == kSmiOperands);
+intptr_t BinarySmiOpComp::ResultCid() const {
return (op_kind() == Token::kSHL) ? kDynamicCid : kSmiCid;
}
-RawAbstractType* DoubleBinaryOpComp::CompileType() const {
+RawAbstractType* BinaryMintOpComp::CompileType() const {
+ ObjectStore* object_store = Isolate::Current()->object_store();
+ return object_store->mint_type();
+}
+
+
+intptr_t BinaryMintOpComp::ResultCid() const {
+ return kMintCid;
+}
+
+
+RawAbstractType* BinaryDoubleOpComp::CompileType() const {
return Type::DoubleInterface();
}
-intptr_t DoubleBinaryOpComp::ResultCid() const {
+intptr_t BinaryDoubleOpComp::ResultCid() const {
return kDoubleCid;
}
« 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