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, thin_string; | 84 Label cons_string; |
85 __ LoadRR(ip, result); | 85 __ mov(ip, Operand(kSlicedNotConsMask)); |
86 __ nilf(ip, Operand(kStringRepresentationMask)); | 86 __ LoadRR(r0, result); |
87 __ CmpP(ip, Operand(kConsStringTag)); | 87 __ AndP(r0, ip /*, SetRC*/); // Should be okay to remove RC |
88 __ beq(&cons_string); | 88 __ beq(&cons_string, Label::kNear /*, cr0*/); |
89 __ CmpP(ip, Operand(kThinStringTag)); | |
90 __ beq(&thin_string); | |
91 | 89 |
92 // Handle slices. | 90 // Handle slices. |
93 Label indirect_string_loaded; | 91 Label indirect_string_loaded; |
94 __ LoadP(result, FieldMemOperand(string, SlicedString::kOffsetOffset)); | 92 __ LoadP(result, FieldMemOperand(string, SlicedString::kOffsetOffset)); |
95 __ LoadP(string, FieldMemOperand(string, SlicedString::kParentOffset)); | 93 __ LoadP(string, FieldMemOperand(string, SlicedString::kParentOffset)); |
96 __ SmiUntag(ip, result); | 94 __ SmiUntag(ip, result); |
97 __ AddP(index, ip); | 95 __ AddP(index, ip); |
98 __ b(&indirect_string_loaded, Label::kNear); | 96 __ b(&indirect_string_loaded, Label::kNear); |
99 | 97 |
100 // Handle thin strings. | |
101 __ bind(&thin_string); | |
102 __ LoadP(string, FieldMemOperand(string, ThinString::kActualOffset)); | |
103 __ b(&indirect_string_loaded, Label::kNear); | |
104 | |
105 // Handle cons strings. | 98 // Handle cons strings. |
106 // Check whether the right hand side is the empty string (i.e. if | 99 // Check whether the right hand side is the empty string (i.e. if |
107 // this is really a flat string in a cons string). If that is not | 100 // this is really a flat string in a cons string). If that is not |
108 // the case we would rather go to the runtime system now to flatten | 101 // the case we would rather go to the runtime system now to flatten |
109 // the string. | 102 // the string. |
110 __ bind(&cons_string); | 103 __ bind(&cons_string); |
111 __ LoadP(result, FieldMemOperand(string, ConsString::kSecondOffset)); | 104 __ LoadP(result, FieldMemOperand(string, ConsString::kSecondOffset)); |
112 __ CompareRoot(result, Heap::kempty_stringRootIndex); | 105 __ CompareRoot(result, Heap::kempty_stringRootIndex); |
113 __ bne(call_runtime); | 106 __ bne(call_runtime); |
114 // Get the first of the two strings and load its instance type. | 107 // 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... |
232 // (kNoCodeAgeSequenceLength - kCodeAgingSequenceLength) bytes. | 225 // (kNoCodeAgeSequenceLength - kCodeAgingSequenceLength) bytes. |
233 patcher.masm()->nop(); // 2-byte nops(). | 226 patcher.masm()->nop(); // 2-byte nops(). |
234 } | 227 } |
235 } | 228 } |
236 } | 229 } |
237 | 230 |
238 } // namespace internal | 231 } // namespace internal |
239 } // namespace v8 | 232 } // namespace v8 |
240 | 233 |
241 #endif // V8_TARGET_ARCH_S390 | 234 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |