Chromium Code Reviews| Index: src/regexp/s390/regexp-macro-assembler-s390.cc |
| diff --git a/src/regexp/s390/regexp-macro-assembler-s390.cc b/src/regexp/s390/regexp-macro-assembler-s390.cc |
| index d9ca1df3124c8c660f2ac8a41524c02d6d23f228..3b68c7b9a289e9184eb35d96fd2e8e51497bb085 100644 |
| --- a/src/regexp/s390/regexp-macro-assembler-s390.cc |
| +++ b/src/regexp/s390/regexp-macro-assembler-s390.cc |
| @@ -1232,17 +1232,52 @@ bool RegExpMacroAssemblerS390::CanReadUnaligned() { |
| void RegExpMacroAssemblerS390::LoadCurrentCharacterUnchecked(int cp_offset, |
| int characters) { |
| - DCHECK(characters == 1); |
| + DCHECK(characters == 1 || CanReadUnaligned()); |
| if (mode_ == LATIN1) { |
| - __ LoadlB(current_character(), |
| - MemOperand(current_input_offset(), end_of_input_address(), |
| - cp_offset * char_size())); |
| + // using load reverse for endian issue |
|
john.yan
2016/08/02 03:06:15
There is no 'issue' here when using reversed load.
|
| + if (characters == 4) { |
| +#if V8_TARGET_LITTLE_ENDIAN |
| + __ LoadlW(current_character(), |
| + MemOperand(current_input_offset(), end_of_input_address(), |
| + cp_offset * char_size())); |
| +#else |
| + __ LoadLogicalReversedWordP(current_character(), |
| + MemOperand(current_input_offset(), end_of_input_address(), |
| + cp_offset * char_size())); |
| +#endif |
| + } else if (characters == 2) { |
| +#if V8_TARGET_LITTLE_ENDIAN |
| + __ LoadLogicalHalfWordP(current_character(), |
| + MemOperand(current_input_offset(), end_of_input_address(), |
| + cp_offset * char_size())); |
| +#else |
| + __ LoadLogicalReversedHalfWordP(current_character(), |
| + MemOperand(current_input_offset(), end_of_input_address(), |
| + cp_offset * char_size())); |
| +#endif |
| + } else { |
| + DCHECK(characters == 1); |
| + __ LoadlB(current_character(), |
| + MemOperand(current_input_offset(), end_of_input_address(), |
| + cp_offset * char_size())); |
| + } |
| } else { |
| DCHECK(mode_ == UC16); |
| - __ LoadLogicalHalfWordP( |
| - current_character(), |
| - MemOperand(current_input_offset(), end_of_input_address(), |
| - cp_offset * char_size())); |
| + if (characters == 2) { |
| + __ LoadlW(current_character(), |
| + MemOperand(current_input_offset(), end_of_input_address(), |
| + cp_offset * char_size())); |
| +#if !V8_TARGET_LITTLE_ENDIAN |
| + // need to swap the order of the characters for endian issue |
|
john.yan
2016/08/02 03:06:15
same here.
|
| + __ rll(current_character(), current_character(), Operand(16)); |
| +#endif |
| + } else { |
| + DCHECK(characters == 1); |
| + __ LoadLogicalHalfWordP( |
| + current_character(), |
| + MemOperand(current_input_offset(), end_of_input_address(), |
| + cp_offset * char_size())); |
| + } |
| } |
| } |