Skip to content

Commit 3b808de

Browse files
backesCommit Bot
authored andcommitted
Reland^2 "Remove all custom CopyCharsUnsigned implementations"
This is an unmodified reland of 9febc50. Nosnap bots do not block LKGR any more: https://crbug.com/v8/9737#c10. Original change's description: > Reland "Remove all custom CopyCharsUnsigned implementations" > > This is a reland of 5d8c489 > > Original change's description: > > Remove all custom CopyCharsUnsigned implementations > > > > It's unclear whether the custom implementation have any advantage over > > the standard library one's. > > Since we update our toolchain and standard library regularly, it might > > well be the case that the custom implementations are slower by now. > > > > Thus this CL removes all {CopyCharsUnsigned} implementations and > > implements {CopyChars} generically using {std::copy_n}. > > > > Note that this does not touch the {MemMove} and {MemCopy} functions > > yet, as we have seen regressions when trying to remove them before > > (https://crbug.com/v8/8675#c5). > > > > R=leszeks@chromium.org > > > > Bug: v8:9396 > > Change-Id: I97a183afebcccd2fbb567bdba02e827331475608 > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1800577 > > Commit-Queue: Clemens Hammacher <clemensh@chromium.org> > > Reviewed-by: Leszek Swirski <leszeks@chromium.org> > > Cr-Commit-Position: refs/heads/master@{#63808} > > Bug: v8:9396 > Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng > Change-Id: I9cd754ebe6b802bb4aabd6d2a448de41da040874 > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1807357 > Reviewed-by: Leszek Swirski <leszeks@chromium.org> > Commit-Queue: Clemens Hammacher <clemensh@chromium.org> > Cr-Commit-Position: refs/heads/master@{#63823} TBR=leszeks@chromium.org Bug: v8:9396 Change-Id: I793524d76b8b9c93d2a98c73e8d72967880fe1cf Cq-Include-Trybots: luci.v8.try:v8_linux64_ubsan_rel_ng Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1809362 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#63857}
1 parent 0845441 commit 3b808de

6 files changed

Lines changed: 34 additions & 372 deletions

File tree

src/builtins/arm/builtins-arm.cc

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,51 +3167,6 @@ void Builtins::Generate_MemCopyUint8Uint8(MacroAssembler* masm) {
31673167
__ Ret();
31683168
}
31693169

3170-
void Builtins::Generate_MemCopyUint16Uint8(MacroAssembler* masm) {
3171-
Register dest = r0;
3172-
Register src = r1;
3173-
Register chars = r2;
3174-
3175-
{
3176-
UseScratchRegisterScope temps(masm);
3177-
3178-
Register temp1 = r3;
3179-
Register temp2 = temps.Acquire();
3180-
Register temp3 = lr;
3181-
Register temp4 = r4;
3182-
Label loop;
3183-
Label not_two;
3184-
3185-
__ Push(lr, r4);
3186-
__ bic(temp2, chars, Operand(0x3));
3187-
__ add(temp2, dest, Operand(temp2, LSL, 1));
3188-
3189-
__ bind(&loop);
3190-
__ ldr(temp1, MemOperand(src, 4, PostIndex));
3191-
__ uxtb16(temp3, temp1);
3192-
__ uxtb16(temp4, temp1, 8);
3193-
__ pkhbt(temp1, temp3, Operand(temp4, LSL, 16));
3194-
__ str(temp1, MemOperand(dest));
3195-
__ pkhtb(temp1, temp4, Operand(temp3, ASR, 16));
3196-
__ str(temp1, MemOperand(dest, 4));
3197-
__ add(dest, dest, Operand(8));
3198-
__ cmp(dest, temp2);
3199-
__ b(&loop, ne);
3200-
3201-
__ mov(chars, Operand(chars, LSL, 31), SetCC); // bit0 => ne, bit1 => cs
3202-
__ b(&not_two, cc);
3203-
__ ldrh(temp1, MemOperand(src, 2, PostIndex));
3204-
__ uxtb(temp3, temp1, 8);
3205-
__ mov(temp3, Operand(temp3, LSL, 16));
3206-
__ uxtab(temp3, temp3, temp1);
3207-
__ str(temp3, MemOperand(dest, 4, PostIndex));
3208-
__ bind(&not_two);
3209-
__ ldrb(temp1, MemOperand(src), ne);
3210-
__ strh(temp1, MemOperand(dest), ne);
3211-
__ Pop(pc, r4);
3212-
}
3213-
}
3214-
32153170
#undef __
32163171

32173172
} // namespace internal

src/builtins/builtins-definitions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,6 @@ namespace internal {
11101110
TFS(SetProperty, kReceiver, kKey, kValue) \
11111111
TFS(SetPropertyInLiteral, kReceiver, kKey, kValue) \
11121112
ASM(MemCopyUint8Uint8, CCall) \
1113-
ASM(MemCopyUint16Uint8, CCall) \
11141113
ASM(MemMove, CCall) \
11151114
\
11161115
/* Trace */ \

src/builtins/builtins-internal-gen.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -932,12 +932,6 @@ void Builtins::Generate_MemCopyUint8Uint8(MacroAssembler* masm) {
932932
}
933933
#endif // !defined(V8_TARGET_ARCH_ARM) && !defined(V8_TARGET_ARCH_MIPS)
934934

935-
#ifndef V8_TARGET_ARCH_ARM
936-
void Builtins::Generate_MemCopyUint16Uint8(MacroAssembler* masm) {
937-
masm->Call(BUILTIN_CODE(masm->isolate(), Illegal), RelocInfo::CODE_TARGET);
938-
}
939-
#endif // V8_TARGET_ARCH_ARM
940-
941935
#ifndef V8_TARGET_ARCH_IA32
942936
void Builtins::Generate_MemMove(MacroAssembler* masm) {
943937
masm->Call(BUILTIN_CODE(masm->isolate(), Illegal), RelocInfo::CODE_TARGET);

src/parsing/scanner-character-streams.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class BufferedCharacterStream : public Utf16CharacterStream {
265265
}
266266

267267
size_t length = Min(kBufferSize, range.length());
268-
i::CopyCharsUnsigned(buffer_, range.start, length);
268+
i::CopyChars(buffer_, range.start, length);
269269
buffer_end_ = &buffer_[length];
270270
return true;
271271
}

src/utils/memcopy.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,8 @@ V8_EXPORT_PRIVATE void MemMove(void* dest, const void* src, size_t size) {
2525
(*memmove_function)(dest, src, size);
2626
}
2727
#elif V8_OS_POSIX && V8_HOST_ARCH_ARM
28-
void MemCopyUint16Uint8Wrapper(uint16_t* dest, const uint8_t* src,
29-
size_t chars) {
30-
uint16_t* limit = dest + chars;
31-
while (dest < limit) {
32-
*dest++ = static_cast<uint16_t>(*src++);
33-
}
34-
}
35-
3628
V8_EXPORT_PRIVATE MemCopyUint8Function memcopy_uint8_function =
3729
&MemCopyUint8Wrapper;
38-
MemCopyUint16Uint8Function memcopy_uint16_uint8_function =
39-
&MemCopyUint16Uint8Wrapper;
4030
#elif V8_OS_POSIX && V8_HOST_ARCH_MIPS
4131
V8_EXPORT_PRIVATE MemCopyUint8Function memcopy_uint8_function =
4232
&MemCopyUint8Wrapper;
@@ -54,9 +44,6 @@ void init_memcopy_functions() {
5444
EmbeddedData d = EmbeddedData::FromBlob();
5545
memcopy_uint8_function = reinterpret_cast<MemCopyUint8Function>(
5646
d.InstructionStartOfBuiltin(Builtins::kMemCopyUint8Uint8));
57-
memcopy_uint16_uint8_function =
58-
reinterpret_cast<MemCopyUint16Uint8Function>(
59-
d.InstructionStartOfBuiltin(Builtins::kMemCopyUint16Uint8));
6047
}
6148
#elif V8_OS_POSIX && V8_HOST_ARCH_MIPS
6249
if (Isolate::CurrentEmbeddedBlobIsBinaryEmbedded()) {

0 commit comments

Comments
 (0)