OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 6250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6261 // in a little endian mode) | 6261 // in a little endian mode) |
6262 __ mov(r6, Operand(2)); | 6262 __ mov(r6, Operand(2)); |
6263 __ AllocateAsciiString(r0, r6, r4, r5, r9, &call_runtime); | 6263 __ AllocateAsciiString(r0, r6, r4, r5, r9, &call_runtime); |
6264 __ strh(r2, FieldMemOperand(r0, SeqAsciiString::kHeaderSize)); | 6264 __ strh(r2, FieldMemOperand(r0, SeqAsciiString::kHeaderSize)); |
6265 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); | 6265 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); |
6266 __ add(sp, sp, Operand(2 * kPointerSize)); | 6266 __ add(sp, sp, Operand(2 * kPointerSize)); |
6267 __ Ret(); | 6267 __ Ret(); |
6268 | 6268 |
6269 __ bind(&longer_than_two); | 6269 __ bind(&longer_than_two); |
6270 // Check if resulting string will be flat. | 6270 // Check if resulting string will be flat. |
6271 __ cmp(r6, Operand(String::kMinNonFlatLength)); | 6271 __ cmp(r6, Operand(ConsString::kMinLength)); |
6272 __ b(lt, &string_add_flat_result); | 6272 __ b(lt, &string_add_flat_result); |
6273 // Handle exceptionally long strings in the runtime system. | 6273 // Handle exceptionally long strings in the runtime system. |
6274 STATIC_ASSERT((String::kMaxLength & 0x80000000) == 0); | 6274 STATIC_ASSERT((String::kMaxLength & 0x80000000) == 0); |
6275 ASSERT(IsPowerOf2(String::kMaxLength + 1)); | 6275 ASSERT(IsPowerOf2(String::kMaxLength + 1)); |
6276 // kMaxLength + 1 is representable as shifted literal, kMaxLength is not. | 6276 // kMaxLength + 1 is representable as shifted literal, kMaxLength is not. |
6277 __ cmp(r6, Operand(String::kMaxLength + 1)); | 6277 __ cmp(r6, Operand(String::kMaxLength + 1)); |
6278 __ b(hs, &call_runtime); | 6278 __ b(hs, &call_runtime); |
6279 | 6279 |
6280 // If result is not supposed to be flat, allocate a cons string object. | 6280 // If result is not supposed to be flat, allocate a cons string object. |
6281 // If both strings are ASCII the result is an ASCII cons string. | 6281 // If both strings are ASCII the result is an ASCII cons string. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6315 STATIC_ASSERT(kAsciiStringTag != 0 && kAsciiDataHintTag != 0); | 6315 STATIC_ASSERT(kAsciiStringTag != 0 && kAsciiDataHintTag != 0); |
6316 __ and_(r4, r4, Operand(kAsciiStringTag | kAsciiDataHintTag)); | 6316 __ and_(r4, r4, Operand(kAsciiStringTag | kAsciiDataHintTag)); |
6317 __ cmp(r4, Operand(kAsciiStringTag | kAsciiDataHintTag)); | 6317 __ cmp(r4, Operand(kAsciiStringTag | kAsciiDataHintTag)); |
6318 __ b(eq, &ascii_data); | 6318 __ b(eq, &ascii_data); |
6319 | 6319 |
6320 // Allocate a two byte cons string. | 6320 // Allocate a two byte cons string. |
6321 __ AllocateTwoByteConsString(r7, r6, r4, r5, &call_runtime); | 6321 __ AllocateTwoByteConsString(r7, r6, r4, r5, &call_runtime); |
6322 __ jmp(&allocated); | 6322 __ jmp(&allocated); |
6323 | 6323 |
6324 // We cannot encounter sliced strings or cons strings here since: | 6324 // We cannot encounter sliced strings or cons strings here since: |
6325 STATIC_ASSERT(SlicedString::kMinLength >= String::kMinNonFlatLength); | 6325 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); |
6326 // Handle creating a flat result from either external or sequential strings. | 6326 // Handle creating a flat result from either external or sequential strings. |
6327 // Locate the first characters' locations. | 6327 // Locate the first characters' locations. |
6328 // r0: first string | 6328 // r0: first string |
6329 // r1: second string | 6329 // r1: second string |
6330 // r2: length of first string | 6330 // r2: length of first string |
6331 // r3: length of second string | 6331 // r3: length of second string |
6332 // r4: first string instance type (if flags_ == NO_STRING_ADD_FLAGS) | 6332 // r4: first string instance type (if flags_ == NO_STRING_ADD_FLAGS) |
6333 // r5: second string instance type (if flags_ == NO_STRING_ADD_FLAGS) | 6333 // r5: second string instance type (if flags_ == NO_STRING_ADD_FLAGS) |
6334 // r6: sum of lengths. | 6334 // r6: sum of lengths. |
6335 Label first_prepared, second_prepared; | 6335 Label first_prepared, second_prepared; |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7314 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, | 7314 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, |
7315 &slow_elements); | 7315 &slow_elements); |
7316 __ Ret(); | 7316 __ Ret(); |
7317 } | 7317 } |
7318 | 7318 |
7319 #undef __ | 7319 #undef __ |
7320 | 7320 |
7321 } } // namespace v8::internal | 7321 } } // namespace v8::internal |
7322 | 7322 |
7323 #endif // V8_TARGET_ARCH_ARM | 7323 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |