[Webkit-unassigned] [Bug 223916] New: [JSC] Remove unnecessary copy constructor for ARMv7Assembler LinkRecord

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 30 01:29:50 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=223916

            Bug ID: 223916
           Summary: [JSC] Remove unnecessary copy constructor for
                    ARMv7Assembler LinkRecord
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: xan.lopez at gmail.com

GCC (10.2.1) complains very often and very verbosely like this:

In file included from WTF/Headers/wtf/RedBlackTree.h:33,
                 from WTF/Headers/wtf/MetaAllocatorHandle.h:33,
                 from ../../Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h:30,
                 from ../../Source/JavaScriptCore/interpreter/AbstractPC.h:28,
                 from ../../Source/JavaScriptCore/interpreter/CallFrame.h:25,
                 from ../../Source/JavaScriptCore/API/JSAPIValueWrapper.h:25,
                 from ../../Source/JavaScriptCore/API/APICast.h:29,
                 from ../../Source/JavaScriptCore/API/tests/testapi.cpp:28:
WTF/Headers/wtf/Vector.h: In instantiation of 'bool WTF::Vector< <template-parameter-1-1>, <anonymous>, <template-parameter-1-3>, <anonymous>, Malloc>::appendSlowCase(U&&) [with WTF::FailureAction <anonymous> = WTF::FailureAction::Crash; U = JSC::ARMv7Assembler::LinkRecord; T = JSC::ARMv7Assembler::LinkRecord; unsigned int inlineCapacity = 0; OverflowHandler = WTF::UnsafeVectorOverflow; unsigned int minCapacity = 16; Malloc = WTF::FastMalloc]':
WTF/Headers/wtf/Vector.h:1295:37:   required from 'bool WTF::Vector< <template-parameter-1-1>, <anonymous>, <template-parameter-1-3>, <anonymous>, Malloc>::append(U&&) [with WTF::FailureAction <anonymous> = WTF::FailureAction::Crash; U = JSC::ARMv7Assembler::LinkRecord; T = JSC::ARMv7Assembler::LinkRecord; unsigned int inlineCapacity = 0; OverflowHandler = WTF::UnsafeVectorOverflow; unsigned int minCapacity = 16; Malloc = WTF::FastMalloc]'
WTF/Headers/wtf/Vector.h:776:92:   required from 'void WTF::Vector< <template-parameter-1-1>, <anonymous>, <template-parameter-1-3>, <anonymous>, Malloc>::append(U&&) [with U = JSC::ARMv7Assembler::LinkRecord; T = JSC::ARMv7Assembler::LinkRecord; unsigned int inlineCapacity = 0; OverflowHandler = WTF::UnsafeVectorOverflow; unsigned int minCapacity = 16; Malloc = WTF::FastMalloc]'
WTF/Headers/wtf/Vector.h:775:69:   required from 'void WTF::Vector< <template-parameter-1-1>, <anonymous>, <template-parameter-1-3>, <anonymous>, Malloc>::append(WTF::Vector< <template-parameter-1-1>, <anonymous>, <template-parameter-1-3>, <anonymous>, Malloc>::ValueType&&) [with T = JSC::ARMv7Assembler::LinkRecord; unsigned int inlineCapacity = 0; OverflowHandler = WTF::UnsafeVectorOverflow; unsigned int minCapacity = 16; Malloc = WTF::FastMalloc; WTF::Vector< <template-parameter-1-1>, <anonymous>, <template-parameter-1-3>, <anonymous>, Malloc>::ValueType = JSC::ARMv7Assembler::LinkRecord]'
../../Source/JavaScriptCore/assembler/ARMv7Assembler.h:2198:85:   required from here
WTF/Headers/wtf/Vector.h:1328:5: warning: implicitly-declared 'constexpr JSC::ARMv7Assembler::LinkRecord::LinkRecord(const JSC::ARMv7Assembler::LinkRecord&)' is deprecated [-Wdeprecated-copy]
 1328 |     new (NotNull, end()) T(std::forward<U>(*ptr));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h:31,
                 from ../../Source/JavaScriptCore/assembler/MacroAssembler.h:35,
                 from ../../Source/JavaScriptCore/jit/GPRInfo.h:28,
                 from ../../Source/JavaScriptCore/jit/RegisterSet.h:30,
                 from ../../Source/JavaScriptCore/jit/JITCode.h:33,
                 from ../../Source/JavaScriptCore/runtime/ExecutableBase.h:32,
                 from ../../Source/JavaScriptCore/runtime/ExecutableBaseInlines.h:28,
                 from ../../Source/JavaScriptCore/bytecode/CallVariant.h:28,
                 from ../../Source/JavaScriptCore/bytecode/CallEdge.h:28,
                 from ../../Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.h:30,
                 from ../../Source/JavaScriptCore/bytecode/CallLinkInfo.h:31,
                 from ../../Source/JavaScriptCore/bytecode/CodeBlock.h:34,
                 from ../../Source/JavaScriptCore/interpreter/RegisterInlines.h:28,
                 from ../../Source/JavaScriptCore/interpreter/CallFrameInlines.h:31,
                 from ../../Source/JavaScriptCore/runtime/JSCellInlines.h:32,
                 from ../../Source/JavaScriptCore/runtime/JSCJSValueInlines.h:35,
                 from ../../Source/JavaScriptCore/API/APICast.h:31,
                 from ../../Source/JavaScriptCore/API/tests/testapi.cpp:28:
../../Source/JavaScriptCore/assembler/ARMv7Assembler.h:449:14: note: because 'JSC::ARMv7Assembler::LinkRecord' has user-provided 'void JSC::ARMv7Assembler::LinkRecord::operator=(const JSC::ARMv7Assembler::LinkRecord&)'
  449 |         void operator=(const LinkRecord& other)
      |              ^~~~~~~~


The implicit copy constructor will just copy the memory representation for union types (like LinkRecord), which seems adequate in this case. So just remove the user provided copy constructor.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210330/b4b85b77/attachment-0001.htm>


More information about the webkit-unassigned mailing list