OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_S390 | 5 #if V8_TARGET_ARCH_S390 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 __ bind(&byte_loop); | 2195 __ bind(&byte_loop); |
2196 __ LoadlB(scratch, MemOperand(src)); | 2196 __ LoadlB(scratch, MemOperand(src)); |
2197 __ la(src, MemOperand(src, 1)); | 2197 __ la(src, MemOperand(src, 1)); |
2198 __ stc(scratch, MemOperand(dest)); | 2198 __ stc(scratch, MemOperand(dest)); |
2199 __ la(dest, MemOperand(dest, 1)); | 2199 __ la(dest, MemOperand(dest, 1)); |
2200 __ BranchOnCount(count, &byte_loop); | 2200 __ BranchOnCount(count, &byte_loop); |
2201 | 2201 |
2202 __ bind(&done); | 2202 __ bind(&done); |
2203 } | 2203 } |
2204 | 2204 |
2205 void ToStringStub::Generate(MacroAssembler* masm) { | |
2206 // The ToString stub takes one argument in r2. | |
2207 Label done; | |
2208 Label is_number; | |
2209 __ JumpIfSmi(r2, &is_number); | |
2210 | |
2211 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); | |
2212 // r2: receiver | |
2213 // r3: receiver instance type | |
2214 __ blt(&done); | |
2215 | |
2216 Label not_heap_number; | |
2217 __ CmpP(r3, Operand(HEAP_NUMBER_TYPE)); | |
2218 __ bne(¬_heap_number); | |
2219 __ bind(&is_number); | |
2220 NumberToStringStub stub(isolate()); | |
2221 __ TailCallStub(&stub); | |
2222 __ bind(¬_heap_number); | |
2223 | |
2224 Label not_oddball; | |
2225 __ CmpP(r3, Operand(ODDBALL_TYPE)); | |
2226 __ bne(¬_oddball); | |
2227 __ LoadP(r2, FieldMemOperand(r2, Oddball::kToStringOffset)); | |
2228 __ Ret(); | |
2229 __ bind(¬_oddball); | |
2230 | |
2231 __ push(r2); // Push argument. | |
2232 __ TailCallRuntime(Runtime::kToString); | |
2233 | |
2234 __ bind(&done); | |
2235 __ Ret(); | |
2236 } | |
2237 | 2205 |
2238 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 2206 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
2239 Register left, | 2207 Register left, |
2240 Register right, | 2208 Register right, |
2241 Register scratch1, | 2209 Register scratch1, |
2242 Register scratch2) { | 2210 Register scratch2) { |
2243 Register length = scratch1; | 2211 Register length = scratch1; |
2244 | 2212 |
2245 // Compare lengths. | 2213 // Compare lengths. |
2246 Label strings_not_equal, check_zero_length; | 2214 Label strings_not_equal, check_zero_length; |
(...skipping 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5126 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5094 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5127 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5095 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5128 } | 5096 } |
5129 | 5097 |
5130 #undef __ | 5098 #undef __ |
5131 | 5099 |
5132 } // namespace internal | 5100 } // namespace internal |
5133 } // namespace v8 | 5101 } // namespace v8 |
5134 | 5102 |
5135 #endif // V8_TARGET_ARCH_S390 | 5103 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |