Index: src/crankshaft/s390/lithium-codegen-s390.cc |
diff --git a/src/crankshaft/s390/lithium-codegen-s390.cc b/src/crankshaft/s390/lithium-codegen-s390.cc |
index b8fa2bc8089c889d31580fd43236d7f455eff5b1..864f2495d6a89295d0dc9bf8e44d2e01827b3986 100644 |
--- a/src/crankshaft/s390/lithium-codegen-s390.cc |
+++ b/src/crankshaft/s390/lithium-codegen-s390.cc |
@@ -4875,14 +4875,42 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) { |
void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
LOperand* input = instr->value(); |
- __ TestIfSmi(ToRegister(input)); |
+ if (input->IsRegister()) { |
+ __ TestIfSmi(ToRegister(input)); |
+ } else if (input->IsStackSlot()) { |
+ MemOperand value = ToMemOperand(input); |
+#if !V8_TARGET_LITTLE_ENDIAN |
+#if V8_TARGET_ARCH_S390X |
+ __ TestIfSmi(MemOperand(value.rb(), value.offset() + 7)); |
+#else |
+ __ TestIfSmi(MemOperand(value.rb(), value.offset() + 3)); |
+#endif |
+#else |
+ __ TestIfSmi(value); |
+#endif |
+ } |
DeoptimizeIf(ne, instr, DeoptimizeReason::kNotASmi, cr0); |
} |
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
LOperand* input = instr->value(); |
- __ TestIfSmi(ToRegister(input)); |
+ if (input->IsRegister()) { |
+ __ TestIfSmi(ToRegister(input)); |
+ } else if (input->IsStackSlot()) { |
+ MemOperand value = ToMemOperand(input); |
+#if !V8_TARGET_LITTLE_ENDIAN |
+#if V8_TARGET_ARCH_S390X |
+ __ TestIfSmi(MemOperand(value.rb(), value.offset() + 7)); |
+#else |
+ __ TestIfSmi(MemOperand(value.rb(), value.offset() + 3)); |
+#endif |
+#else |
+ __ TestIfSmi(value); |
+#endif |
+ } else { |
+ UNIMPLEMENTED(); |
+ } |
DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, cr0); |
} |
} |