| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
| 7 | 7 |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 4857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4868 #if V8_TARGET_ARCH_S390X | 4868 #if V8_TARGET_ARCH_S390X |
| 4869 __ SmiTag(result_reg); | 4869 __ SmiTag(result_reg); |
| 4870 #else | 4870 #else |
| 4871 __ SmiTagCheckOverflow(result_reg, r0); | 4871 __ SmiTagCheckOverflow(result_reg, r0); |
| 4872 DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0); | 4872 DeoptimizeIf(lt, instr, DeoptimizeReason::kOverflow, cr0); |
| 4873 #endif | 4873 #endif |
| 4874 } | 4874 } |
| 4875 | 4875 |
| 4876 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { | 4876 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
| 4877 LOperand* input = instr->value(); | 4877 LOperand* input = instr->value(); |
| 4878 __ TestIfSmi(ToRegister(input)); | 4878 if (input->IsRegister()) { |
| 4879 __ TestIfSmi(ToRegister(input)); |
| 4880 } else if (input->IsStackSlot()) { |
| 4881 MemOperand value = ToMemOperand(input); |
| 4882 #if !V8_TARGET_LITTLE_ENDIAN |
| 4883 #if V8_TARGET_ARCH_S390X |
| 4884 __ TestIfSmi(MemOperand(value.rb(), value.offset() + 7)); |
| 4885 #else |
| 4886 __ TestIfSmi(MemOperand(value.rb(), value.offset() + 3)); |
| 4887 #endif |
| 4888 #else |
| 4889 __ TestIfSmi(value); |
| 4890 #endif |
| 4891 } |
| 4879 DeoptimizeIf(ne, instr, DeoptimizeReason::kNotASmi, cr0); | 4892 DeoptimizeIf(ne, instr, DeoptimizeReason::kNotASmi, cr0); |
| 4880 } | 4893 } |
| 4881 | 4894 |
| 4882 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { | 4895 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
| 4883 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 4896 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
| 4884 LOperand* input = instr->value(); | 4897 LOperand* input = instr->value(); |
| 4885 __ TestIfSmi(ToRegister(input)); | 4898 if (input->IsRegister()) { |
| 4899 __ TestIfSmi(ToRegister(input)); |
| 4900 } else if (input->IsStackSlot()) { |
| 4901 MemOperand value = ToMemOperand(input); |
| 4902 #if !V8_TARGET_LITTLE_ENDIAN |
| 4903 #if V8_TARGET_ARCH_S390X |
| 4904 __ TestIfSmi(MemOperand(value.rb(), value.offset() + 7)); |
| 4905 #else |
| 4906 __ TestIfSmi(MemOperand(value.rb(), value.offset() + 3)); |
| 4907 #endif |
| 4908 #else |
| 4909 __ TestIfSmi(value); |
| 4910 #endif |
| 4911 } else { |
| 4912 UNIMPLEMENTED(); |
| 4913 } |
| 4886 DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, cr0); | 4914 DeoptimizeIf(eq, instr, DeoptimizeReason::kSmi, cr0); |
| 4887 } | 4915 } |
| 4888 } | 4916 } |
| 4889 | 4917 |
| 4890 void LCodeGen::DoCheckArrayBufferNotNeutered( | 4918 void LCodeGen::DoCheckArrayBufferNotNeutered( |
| 4891 LCheckArrayBufferNotNeutered* instr) { | 4919 LCheckArrayBufferNotNeutered* instr) { |
| 4892 Register view = ToRegister(instr->view()); | 4920 Register view = ToRegister(instr->view()); |
| 4893 Register scratch = scratch0(); | 4921 Register scratch = scratch0(); |
| 4894 | 4922 |
| 4895 __ LoadP(scratch, FieldMemOperand(view, JSArrayBufferView::kBufferOffset)); | 4923 __ LoadP(scratch, FieldMemOperand(view, JSArrayBufferView::kBufferOffset)); |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5560 __ LoadP(result, | 5588 __ LoadP(result, |
| 5561 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5589 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
| 5562 __ bind(deferred->exit()); | 5590 __ bind(deferred->exit()); |
| 5563 __ bind(&done); | 5591 __ bind(&done); |
| 5564 } | 5592 } |
| 5565 | 5593 |
| 5566 #undef __ | 5594 #undef __ |
| 5567 | 5595 |
| 5568 } // namespace internal | 5596 } // namespace internal |
| 5569 } // namespace v8 | 5597 } // namespace v8 |
| OLD | NEW |