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

Unified Diff: src/hydrogen-instructions.cc

Issue 8426005: Merge IR classes for different bitwise operations AND, OR and XOR into one class. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 2 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 | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
===================================================================
--- src/hydrogen-instructions.cc (revision 9842)
+++ src/hydrogen-instructions.cc (working copy)
@@ -1252,34 +1252,23 @@
}
-Range* HBitAnd::InferRange() {
+Range* HBitwise::InferRange() {
+ if (op() == Token::BIT_XOR) return HValue::InferRange();
int32_t left_mask = (left()->range() != NULL)
? left()->range()->Mask()
: 0xffffffff;
int32_t right_mask = (right()->range() != NULL)
? right()->range()->Mask()
: 0xffffffff;
- int32_t result_mask = left_mask & right_mask;
+ int32_t result_mask = (op() == Token::BIT_AND)
+ ? left_mask & right_mask
+ : left_mask | right_mask;
return (result_mask >= 0)
? new Range(0, result_mask)
: HValue::InferRange();
}
-Range* HBitOr::InferRange() {
- int32_t left_mask = (left()->range() != NULL)
- ? left()->range()->Mask()
- : 0xffffffff;
- int32_t right_mask = (right()->range() != NULL)
- ? right()->range()->Mask()
- : 0xffffffff;
- int32_t result_mask = left_mask | right_mask;
- return (result_mask >= 0)
- ? new Range(0, result_mask)
- : HValue::InferRange();
-}
-
-
Range* HSar::InferRange() {
if (right()->IsConstant()) {
HConstant* c = HConstant::cast(right());
@@ -1785,21 +1774,6 @@
}
-HType HBitAnd::CalculateInferredType() {
- return HType::TaggedNumber();
-}
-
-
-HType HBitXor::CalculateInferredType() {
- return HType::TaggedNumber();
-}
-
-
-HType HBitOr::CalculateInferredType() {
- return HType::TaggedNumber();
-}
-
-
HType HBitNot::CalculateInferredType() {
return HType::TaggedNumber();
}
@@ -1810,21 +1784,6 @@
}
-HType HShl::CalculateInferredType() {
- return HType::TaggedNumber();
-}
-
-
-HType HShr::CalculateInferredType() {
- return HType::TaggedNumber();
-}
-
-
-HType HSar::CalculateInferredType() {
- return HType::TaggedNumber();
-}
-
-
HType HStringCharFromCode::CalculateInferredType() {
return HType::String();
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698