[stubs] Suppress shift by zero.

LOG=N
BUG=

Review-Url: https://codereview.chromium.org/2157363003
Cr-Commit-Position: refs/heads/master@{#37886}
This commit is contained in:
oth 2016-07-20 01:07:04 -07:00 committed by Commit bot
parent d4ad10b30f
commit ac69e74fbf
3 changed files with 11 additions and 3 deletions

View File

@ -1770,7 +1770,7 @@ Node* CodeStubAssembler::StringFromCharCode(Node* code) {
Node* CodeStubAssembler::BitFieldDecode(Node* word32, uint32_t shift,
uint32_t mask) {
return Word32Shr(Word32And(word32, Int32Constant(mask)),
Int32Constant(shift));
static_cast<int>(shift));
}
void CodeStubAssembler::SetCounter(StatsCounter* counter, int value) {

View File

@ -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) {

View File

@ -285,6 +285,7 @@ class CodeAssembler {
Node* WordShl(Node* value, int shift);
Node* WordShr(Node* value, int shift);
Node* Word32Shr(Node* value, int shift);
// Unary
#define DECLARE_CODE_ASSEMBLER_UNARY_OP(name) Node* name(Node* a);