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

Unified Diff: src/compiler/code-assembler.cc

Issue 2157363003: [stubs] Suppress shifts with immediate shift of zero. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/compiler/code-assembler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-assembler.cc
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc
index 46208751cd7bbdc2bf5a26833a4d44ecae9abcf5..3ef8243a50865a4fde987a413f306c5452c24665 100644
--- a/src/compiler/code-assembler.cc
+++ b/src/compiler/code-assembler.cc
@@ -209,11 +209,18 @@ CODE_ASSEMBLER_BINARY_OP_LIST(DEFINE_CODE_ASSEMBLER_BINARY_OP)
#undef DEFINE_CODE_ASSEMBLER_BINARY_OP
Node* CodeAssembler::WordShl(Node* value, int shift) {
- return raw_assembler_->WordShl(value, IntPtrConstant(shift));
+ return (shift != 0) ? raw_assembler_->WordShl(value, IntPtrConstant(shift))
+ : value;
}
Node* CodeAssembler::WordShr(Node* value, int shift) {
- return raw_assembler_->WordShr(value, IntPtrConstant(shift));
+ return (shift != 0) ? raw_assembler_->WordShr(value, IntPtrConstant(shift))
+ : value;
+}
+
+Node* CodeAssembler::Word32Shr(Node* value, int shift) {
+ return (shift != 0) ? raw_assembler_->Word32Shr(value, IntPtrConstant(shift))
+ : value;
}
Node* CodeAssembler::ChangeUint32ToWord(Node* value) {
« no previous file with comments | « src/compiler/code-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698