OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2445 | 2445 |
2446 Bind(&loop); | 2446 Bind(&loop); |
2447 Sub(length, length, 1); | 2447 Sub(length, length, 1); |
2448 Ldrb(scratch, MemOperand(src, 1, PostIndex)); | 2448 Ldrb(scratch, MemOperand(src, 1, PostIndex)); |
2449 Strb(scratch, MemOperand(dst, 1, PostIndex)); | 2449 Strb(scratch, MemOperand(dst, 1, PostIndex)); |
2450 Cbnz(length, &loop); | 2450 Cbnz(length, &loop); |
2451 Bind(&done); | 2451 Bind(&done); |
2452 } | 2452 } |
2453 | 2453 |
2454 | 2454 |
2455 void MacroAssembler::InitializeFieldsWithFiller(Register start_offset, | 2455 void MacroAssembler::FillFields(Register dst, |
2456 Register end_offset, | 2456 Register field_count, |
2457 Register filler) { | 2457 Register filler) { |
2458 Label loop, entry; | 2458 ASSERT(!dst.Is(csp)); |
| 2459 UseScratchRegisterScope temps(this); |
| 2460 Register field_ptr = temps.AcquireX(); |
| 2461 Register counter = temps.AcquireX(); |
| 2462 Label done; |
| 2463 |
| 2464 // Decrement count. If the result < zero, count was zero, and there's nothing |
| 2465 // to do. If count was one, flags are set to fail the gt condition at the end |
| 2466 // of the pairs loop. |
| 2467 Subs(counter, field_count, 1); |
| 2468 B(lt, &done); |
| 2469 |
| 2470 // There's at least one field to fill, so do this unconditionally. |
| 2471 Str(filler, MemOperand(dst, kPointerSize, PostIndex)); |
| 2472 |
| 2473 // If the bottom bit of counter is set, there are an even number of fields to |
| 2474 // fill, so pull the start pointer back by one field, allowing the pairs loop |
| 2475 // to overwrite the field that was stored above. |
| 2476 And(field_ptr, counter, 1); |
| 2477 Sub(field_ptr, dst, Operand(field_ptr, LSL, kPointerSizeLog2)); |
| 2478 |
| 2479 // Store filler to memory in pairs. |
| 2480 Label entry, loop; |
2459 B(&entry); | 2481 B(&entry); |
2460 Bind(&loop); | 2482 Bind(&loop); |
2461 // TODO(all): consider using stp here. | 2483 Stp(filler, filler, MemOperand(field_ptr, 2 * kPointerSize, PostIndex)); |
2462 Str(filler, MemOperand(start_offset, kPointerSize, PostIndex)); | 2484 Subs(counter, counter, 2); |
2463 Bind(&entry); | 2485 Bind(&entry); |
2464 Cmp(start_offset, end_offset); | 2486 B(gt, &loop); |
2465 B(lt, &loop); | 2487 |
| 2488 Bind(&done); |
2466 } | 2489 } |
2467 | 2490 |
2468 | 2491 |
2469 void MacroAssembler::JumpIfEitherIsNotSequentialAsciiStrings( | 2492 void MacroAssembler::JumpIfEitherIsNotSequentialAsciiStrings( |
2470 Register first, | 2493 Register first, |
2471 Register second, | 2494 Register second, |
2472 Register scratch1, | 2495 Register scratch1, |
2473 Register scratch2, | 2496 Register scratch2, |
2474 Label* failure, | 2497 Label* failure, |
2475 SmiCheckType smi_check) { | 2498 SmiCheckType smi_check) { |
(...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5106 } | 5129 } |
5107 } | 5130 } |
5108 | 5131 |
5109 | 5132 |
5110 #undef __ | 5133 #undef __ |
5111 | 5134 |
5112 | 5135 |
5113 } } // namespace v8::internal | 5136 } } // namespace v8::internal |
5114 | 5137 |
5115 #endif // V8_TARGET_ARCH_A64 | 5138 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |