OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/s390/codegen-s390.h" | 5 #include "src/s390/codegen-s390.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_S390 | 7 #if V8_TARGET_ARCH_S390 |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 __ LoadP(result, FieldMemOperand(string, HeapObject::kMapOffset)); | 74 __ LoadP(result, FieldMemOperand(string, HeapObject::kMapOffset)); |
75 __ LoadlB(result, FieldMemOperand(result, Map::kInstanceTypeOffset)); | 75 __ LoadlB(result, FieldMemOperand(result, Map::kInstanceTypeOffset)); |
76 | 76 |
77 // We need special handling for indirect strings. | 77 // We need special handling for indirect strings. |
78 Label check_sequential; | 78 Label check_sequential; |
79 __ mov(r0, Operand(kIsIndirectStringMask)); | 79 __ mov(r0, Operand(kIsIndirectStringMask)); |
80 __ AndP(r0, result); | 80 __ AndP(r0, result); |
81 __ beq(&check_sequential, Label::kNear /*, cr0*/); | 81 __ beq(&check_sequential, Label::kNear /*, cr0*/); |
82 | 82 |
83 // Dispatch on the indirect string shape: slice or cons. | 83 // Dispatch on the indirect string shape: slice or cons. |
84 Label cons_string; | 84 Label cons_string, thin_string; |
85 __ mov(ip, Operand(kSlicedNotConsMask)); | 85 __ LoadRR(ip, result); |
86 __ LoadRR(r0, result); | 86 __ nilf(ip, Operand(kStringRepresentationMask)); |
87 __ AndP(r0, ip /*, SetRC*/); // Should be okay to remove RC | 87 __ CmpP(ip, Operand(kConsStringTag)); |
88 __ beq(&cons_string, Label::kNear /*, cr0*/); | 88 __ beq(&cons_string); |
| 89 __ CmpP(ip, Operand(kThinStringTag)); |
| 90 __ beq(&thin_string); |
89 | 91 |
90 // Handle slices. | 92 // Handle slices. |
91 Label indirect_string_loaded; | 93 Label indirect_string_loaded; |
92 __ LoadP(result, FieldMemOperand(string, SlicedString::kOffsetOffset)); | 94 __ LoadP(result, FieldMemOperand(string, SlicedString::kOffsetOffset)); |
93 __ LoadP(string, FieldMemOperand(string, SlicedString::kParentOffset)); | 95 __ LoadP(string, FieldMemOperand(string, SlicedString::kParentOffset)); |
94 __ SmiUntag(ip, result); | 96 __ SmiUntag(ip, result); |
95 __ AddP(index, ip); | 97 __ AddP(index, ip); |
96 __ b(&indirect_string_loaded, Label::kNear); | 98 __ b(&indirect_string_loaded, Label::kNear); |
97 | 99 |
| 100 // Handle thin strings. |
| 101 __ bind(&thin_string); |
| 102 __ LoadP(string, FieldMemOperand(string, ThinString::kActualOffset)); |
| 103 __ b(&indirect_string_loaded, Label::kNear); |
| 104 |
98 // Handle cons strings. | 105 // Handle cons strings. |
99 // Check whether the right hand side is the empty string (i.e. if | 106 // Check whether the right hand side is the empty string (i.e. if |
100 // this is really a flat string in a cons string). If that is not | 107 // this is really a flat string in a cons string). If that is not |
101 // the case we would rather go to the runtime system now to flatten | 108 // the case we would rather go to the runtime system now to flatten |
102 // the string. | 109 // the string. |
103 __ bind(&cons_string); | 110 __ bind(&cons_string); |
104 __ LoadP(result, FieldMemOperand(string, ConsString::kSecondOffset)); | 111 __ LoadP(result, FieldMemOperand(string, ConsString::kSecondOffset)); |
105 __ CompareRoot(result, Heap::kempty_stringRootIndex); | 112 __ CompareRoot(result, Heap::kempty_stringRootIndex); |
106 __ bne(call_runtime); | 113 __ bne(call_runtime); |
107 // Get the first of the two strings and load its instance type. | 114 // Get the first of the two strings and load its instance type. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // (kNoCodeAgeSequenceLength - kCodeAgingSequenceLength) bytes. | 232 // (kNoCodeAgeSequenceLength - kCodeAgingSequenceLength) bytes. |
226 patcher.masm()->nop(); // 2-byte nops(). | 233 patcher.masm()->nop(); // 2-byte nops(). |
227 } | 234 } |
228 } | 235 } |
229 } | 236 } |
230 | 237 |
231 } // namespace internal | 238 } // namespace internal |
232 } // namespace v8 | 239 } // namespace v8 |
233 | 240 |
234 #endif // V8_TARGET_ARCH_S390 | 241 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |