1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//! Raw `MethodPtr` table structure with unresolved indexes and indirection mappings.
//!
//! This module provides the [`MethodPtrRaw`] struct, which represents method pointer entries
//! as stored in the metadata stream. The structure contains method indexes that provide
//! an additional level of indirection for accessing `MethodDef` table entries in specialized
//! scenarios requiring method table reorganization or runtime modification.
//!
//! # Purpose
//! [`MethodPtrRaw`] serves as the direct representation of `MethodPtr` table entries from the
//! binary metadata stream, providing stable logical-to-physical method mappings. This raw
//! format is processed during metadata loading to create [`MethodPtr`] instances with
//! complete indirection mapping information.
//!
//! [`MethodPtr`]: crate::metadata::tables::MethodPtr
use Arc;
use crate::;
/// Raw `MethodPtr` table entry with unresolved indexes and indirection mapping.
///
/// This structure represents a method pointer entry as stored directly in the metadata stream.
/// It provides an additional level of indirection for accessing `MethodDef` table entries,
/// enabling stable method references during scenarios requiring method table reorganization
/// or runtime method modification.
///
/// # Table Structure (ECMA-335 ยง22.28)
/// | Column | Size | Description |
/// |--------|------|-------------|
/// | Method | `MethodDef` index | Physical method definition reference |
///
/// # Indirection Mechanism
/// The `MethodPtr` table establishes logical-to-physical method mappings:
/// - **Logical reference**: This entry's RID serves as the stable logical method identifier
/// - **Physical reference**: The `method` field points to the actual `MethodDef` table entry
/// - **Stable mapping**: Logical identifiers remain constant during method table changes
/// - **Transparent resolution**: Higher-level systems use logical tokens without awareness
///
/// # Usage Context
/// `MethodPtr` tables appear in specialized development and runtime scenarios:
/// - **Edit-and-continue**: Development environments supporting runtime method modification
/// - **Hot-reload systems**: Runtime environments enabling dynamic method updates
/// - **Debugging support**: Debuggers requiring method interception capabilities
/// - **Incremental compilation**: Build systems performing partial assembly updates
/// - **Method versioning**: Systems supporting method replacement without reference updates
///
/// # Stream Format Relationship
/// The `MethodPtr` table is associated with uncompressed metadata streams:
/// - **#~ streams**: Compressed metadata typically uses direct `MethodDef` references
/// - **#- streams**: Uncompressed metadata may include `MethodPtr` for indirection
/// - **Optimization**: Direct references when indirection is unnecessary
/// - **Flexibility**: Indirection enables complex method organization patterns