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