Module: Moxml::Adapter::Leptris::Identity

Defined in:
lib/moxml/adapter/leptris.rb

Overview

Extend-in-place mint (#230 stage 2): a TypedData native carries the contract modules on itself — the wrapper layer's 3-4 Ruby frames collapse to the module call over the C method. @native is self; every adapter method that accepts a native already handles NativeNode receivers. Identity mode v2 (#230): wrapper classes SUBCLASS the TypedData native and include the contract modules, and NativeNode.from honors its receiver (klass-injection, 1.9.174.4+): the C wrap mints our class directly — no Ruby-level extend (the v1 extend mint regressed the pipeline 4x; this is the same TypedData wrap the base mint pays). @native is self; the adapter's C-surface bind_calls accept these receivers (they are NativeNode instances). The hot bare reads super into the C methods (exact-name = the bare-name contract).

Defined Under Namespace

Modules: Reads

Constant Summary collapse

ELEMENT =
Class.new(::Leptris::XML::NativeNode) do
  include ::Moxml::Node
  include ::Moxml::Element
end
TEXT =
Class.new(::Leptris::XML::NativeNode) do
  include ::Moxml::Node
  include ::Moxml::Text
end
CDATA =
Class.new(::Leptris::XML::NativeNode) do
  include ::Moxml::Node
  include ::Moxml::Cdata
end
COMMENT =
Class.new(::Leptris::XML::NativeNode) do
  include ::Moxml::Node
  include ::Moxml::Comment
end
PROCESSING_INSTRUCTION =
Class.new(::Leptris::XML::NativeNode) do
  include ::Moxml::Node
  include ::Moxml::ProcessingInstruction
end
TYPES =
{
  element: ELEMENT,
  text: TEXT,
  cdata: CDATA,
  comment: COMMENT,
  processing_instruction: PROCESSING_INSTRUCTION,
}.freeze
ELEMENT_CONTRACT_READ =

Hot-read face selection: bindings >= 1.9.194.1 carry unshadowed aliases (attr_read/text_read) that plain dispatch reaches at method-cache cost — beats UnboundMethod#bind_call (~86ns) on every bare read.

::Moxml::ElementBehavior.instance_method(:[])
NATIVE_HOT_ALIASES =
Gem::Version.new(::Leptris::VERSION) >= Gem::Version.new("1.9.194.1")
ENTITY_DOC_MEMO =

Doc-level entity-marker memo shared by both hot-read faces (one WeakMap, generation-stamped Integer values).

::ObjectSpace::WeakMap.new