
With this change, we now have ~1200 CellAllocators across both LibJS and LibWeb in a normal WebContent instance. This gives us a minimum heap size of 4.7 MiB in the scenario where we only have one cell allocated per type. Of course, in practice there will be many more of each type, so the effective overhead is quite a bit smaller than that in practice. I left a few types unconverted to this mechanism because I got tired of doing this. :^)
35 lines
933 B
C++
35 lines
933 B
C++
/*
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/DOM/CharacterData.h>
|
|
|
|
namespace Web::DOM {
|
|
|
|
class ProcessingInstruction final : public CharacterData {
|
|
WEB_PLATFORM_OBJECT(ProcessingInstruction, CharacterData);
|
|
JS_DECLARE_ALLOCATOR(ProcessingInstruction);
|
|
|
|
public:
|
|
virtual ~ProcessingInstruction() override = default;
|
|
|
|
virtual FlyString node_name() const override { return MUST(FlyString::from_deprecated_fly_string(m_target)); }
|
|
|
|
DeprecatedString const& target() const { return m_target; }
|
|
|
|
private:
|
|
ProcessingInstruction(Document&, DeprecatedString const& data, DeprecatedString const& target);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
DeprecatedString m_target;
|
|
};
|
|
|
|
template<>
|
|
inline bool Node::fast_is<ProcessingInstruction>() const { return node_type() == (u16)NodeType::PROCESSING_INSTRUCTION_NODE; }
|
|
|
|
}
|