cStubs.scala 108 KB
Newer Older
Kunshan Wang's avatar
Kunshan Wang committed
1 2
package uvm.refimpl.nat

3
import com.kenai.jffi.{ Type => JType }
4

5
import NativeSupport._
6
import uvm.refimpl._
7
import uvm.ssavariables.{BinOptr, CmpOptr, ConvOptr, MemoryOrder, AtomicRMWOptr}
8 9

object CDefs {
Kunshan Wang's avatar
Kunshan Wang committed
10
  import NativeMemoryAccessHelper._
11
  import CDefsHelperFunctions._
12
  import NativeClientSupport._
13

14
  // generated from migrate_scripts/muapitocstubs.py
15
  /// GEN:BEGIN:STUBS
Kunshan Wang's avatar
Kunshan Wang committed
16
val MUVM__NEW_CONTEXT = exposedMethod("MuVM.new_context", JType.POINTER, Array(JType.POINTER)) { _jffiBuffer =>
17
val _raw_mvm = _jffiBuffer.getAddress(0)
18 19
val mvm = getMicroVM(_raw_mvm)
val _RV = mvm.newContext()
Kunshan Wang's avatar
Kunshan Wang committed
20 21
val _RV_FAK = exposeMuCtx(_RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
22
}
Kunshan Wang's avatar
Kunshan Wang committed
23
val MUVM__ID_OF = exposedMethod("MuVM.id_of", JType.UINT32, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
24 25
val _raw_mvm = _jffiBuffer.getAddress(0)
val _raw_name = _jffiBuffer.getAddress(1)
26 27 28
val mvm = getMicroVM(_raw_mvm)
val name = readCString(_raw_name)
val _RV = mvm.idOf(name)
Kunshan Wang's avatar
Kunshan Wang committed
29
_jffiBuffer.setIntReturn(_RV)
30
}
Kunshan Wang's avatar
Kunshan Wang committed
31
val MUVM__NAME_OF = exposedMethod("MuVM.name_of", JType.POINTER, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
32 33
val _raw_mvm = _jffiBuffer.getAddress(0)
val _raw_id = _jffiBuffer.getInt(1)
34
val mvm = getMicroVM(_raw_mvm)
35
val id = _raw_id
36
val _RV = mvm.nameOf(id)
Kunshan Wang's avatar
Kunshan Wang committed
37 38
val _RV_FAK = exposeString(_RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
39
}
Kunshan Wang's avatar
Kunshan Wang committed
40
val MUVM__SET_TRAP_HANDLER = exposedMethod("MuVM.set_trap_handler", JType.VOID, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
41 42 43
val _raw_mvm = _jffiBuffer.getAddress(0)
val _raw_trap_handler = _jffiBuffer.getAddress(1)
val _raw_userdata = _jffiBuffer.getAddress(2)
44
val mvm = getMicroVM(_raw_mvm)
45 46
val trap_handler = _raw_trap_handler
val userdata = _raw_userdata
47
val _RV = mvm.setTrapHandler(trap_handler, userdata)
48
}
49 50 51 52 53
val MUVM__EXECUTE = exposedMethod("MuVM.execute", JType.VOID, Array(JType.POINTER)) { _jffiBuffer =>
val _raw_mvm = _jffiBuffer.getAddress(0)
val mvm = getMicroVM(_raw_mvm)
val _RV = mvm.execute()
}
Kunshan Wang's avatar
Kunshan Wang committed
54
val MUVM__GET_MU_ERROR_PTR = exposedMethod("MuVM.get_mu_error_ptr", JType.POINTER, Array(JType.POINTER)) { _jffiBuffer =>
55
val _raw_mvm = _jffiBuffer.getAddress(0)
56 57
val mvm = getMicroVM(_raw_mvm)
val _RV = mvm.getMuErrorPtr()
Kunshan Wang's avatar
Kunshan Wang committed
58
_jffiBuffer.setAddressReturn(_RV)
59
}
60
val stubsOfMuVM = new Array[Word](6)
61 62 63 64
stubsOfMuVM(0) = MUVM__NEW_CONTEXT.address
stubsOfMuVM(1) = MUVM__ID_OF.address
stubsOfMuVM(2) = MUVM__NAME_OF.address
stubsOfMuVM(3) = MUVM__SET_TRAP_HANDLER.address
65 66
stubsOfMuVM(4) = MUVM__EXECUTE.address
stubsOfMuVM(5) = MUVM__GET_MU_ERROR_PTR.address
Kunshan Wang's avatar
Kunshan Wang committed
67
val MUCTX__ID_OF = exposedMethod("MuCtx.id_of", JType.UINT32, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
68 69 70
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_name = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
71 72
val name = readCString(_raw_name)
val _RV = ctx.idOf(name)
Kunshan Wang's avatar
Kunshan Wang committed
73
_jffiBuffer.setIntReturn(_RV)
74
}
Kunshan Wang's avatar
Kunshan Wang committed
75
val MUCTX__NAME_OF = exposedMethod("MuCtx.name_of", JType.POINTER, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
76 77 78 79
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_id = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val id = _raw_id
80
val _RV = ctx.nameOf(id)
Kunshan Wang's avatar
Kunshan Wang committed
81 82
val _RV_FAK = exposeString(_RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
83
}
Kunshan Wang's avatar
Kunshan Wang committed
84
val MUCTX__CLOSE_CONTEXT = exposedMethod("MuCtx.close_context", JType.VOID, Array(JType.POINTER)) { _jffiBuffer =>
85 86
val _raw_ctx = _jffiBuffer.getAddress(0)
val ctx = getMuCtx(_raw_ctx)
87
val _RV = ctx.closeContext()
88
}
89
val MUCTX__LOAD_BUNDLE = exposedMethod("MuCtx.load_bundle", JType.VOID, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
90 91
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_buf = _jffiBuffer.getAddress(1)
92
val _raw_sz = _jffiBuffer.getAddress(2)
93
val ctx = getMuCtx(_raw_ctx)
94 95
val buf = readCharArray(_raw_buf, _raw_sz)
val _RV = ctx.loadBundle(buf)
96
}
97
val MUCTX__LOAD_HAIL = exposedMethod("MuCtx.load_hail", JType.VOID, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
98 99
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_buf = _jffiBuffer.getAddress(1)
100
val _raw_sz = _jffiBuffer.getAddress(2)
101
val ctx = getMuCtx(_raw_ctx)
102 103
val buf = readCharArray(_raw_buf, _raw_sz)
val _RV = ctx.loadHail(buf)
104
}
Kunshan Wang's avatar
Kunshan Wang committed
105
val MUCTX__HANDLE_FROM_SINT8 = exposedMethod("MuCtx.handle_from_sint8", JType.POINTER, Array(JType.POINTER, JType.SINT8, JType.SINT)) { _jffiBuffer =>
106 107 108 109 110 111
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getByte(1)
val _raw_len = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
val len = _raw_len
112
val _RV = ctx.handleFromSInt8(num, len)
Kunshan Wang's avatar
Kunshan Wang committed
113 114
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
115
}
Kunshan Wang's avatar
Kunshan Wang committed
116
val MUCTX__HANDLE_FROM_UINT8 = exposedMethod("MuCtx.handle_from_uint8", JType.POINTER, Array(JType.POINTER, JType.UINT8, JType.SINT)) { _jffiBuffer =>
117 118 119 120 121 122
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getByte(1)
val _raw_len = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
val len = _raw_len
123
val _RV = ctx.handleFromUInt8(num, len)
Kunshan Wang's avatar
Kunshan Wang committed
124 125
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
126
}
Kunshan Wang's avatar
Kunshan Wang committed
127
val MUCTX__HANDLE_FROM_SINT16 = exposedMethod("MuCtx.handle_from_sint16", JType.POINTER, Array(JType.POINTER, JType.SINT16, JType.SINT)) { _jffiBuffer =>
128 129 130 131 132 133
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getShort(1)
val _raw_len = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
val len = _raw_len
134
val _RV = ctx.handleFromSInt16(num, len)
Kunshan Wang's avatar
Kunshan Wang committed
135 136
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
137
}
Kunshan Wang's avatar
Kunshan Wang committed
138
val MUCTX__HANDLE_FROM_UINT16 = exposedMethod("MuCtx.handle_from_uint16", JType.POINTER, Array(JType.POINTER, JType.UINT16, JType.SINT)) { _jffiBuffer =>
139 140 141 142 143 144
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getShort(1)
val _raw_len = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
val len = _raw_len
145
val _RV = ctx.handleFromUInt16(num, len)
Kunshan Wang's avatar
Kunshan Wang committed
146 147
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
148
}
Kunshan Wang's avatar
Kunshan Wang committed
149
val MUCTX__HANDLE_FROM_SINT32 = exposedMethod("MuCtx.handle_from_sint32", JType.POINTER, Array(JType.POINTER, JType.SINT32, JType.SINT)) { _jffiBuffer =>
150 151 152 153 154 155
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getInt(1)
val _raw_len = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
val len = _raw_len
156
val _RV = ctx.handleFromSInt32(num, len)
Kunshan Wang's avatar
Kunshan Wang committed
157 158
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
159
}
Kunshan Wang's avatar
Kunshan Wang committed
160
val MUCTX__HANDLE_FROM_UINT32 = exposedMethod("MuCtx.handle_from_uint32", JType.POINTER, Array(JType.POINTER, JType.UINT32, JType.SINT)) { _jffiBuffer =>
161 162 163 164 165 166
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getInt(1)
val _raw_len = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
val len = _raw_len
167
val _RV = ctx.handleFromUInt32(num, len)
Kunshan Wang's avatar
Kunshan Wang committed
168 169
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
170
}
Kunshan Wang's avatar
Kunshan Wang committed
171
val MUCTX__HANDLE_FROM_SINT64 = exposedMethod("MuCtx.handle_from_sint64", JType.POINTER, Array(JType.POINTER, JType.SINT64, JType.SINT)) { _jffiBuffer =>
172 173 174 175 176 177
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getLong(1)
val _raw_len = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
val len = _raw_len
178
val _RV = ctx.handleFromSInt64(num, len)
Kunshan Wang's avatar
Kunshan Wang committed
179 180
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
181
}
Kunshan Wang's avatar
Kunshan Wang committed
182
val MUCTX__HANDLE_FROM_UINT64 = exposedMethod("MuCtx.handle_from_uint64", JType.POINTER, Array(JType.POINTER, JType.UINT64, JType.SINT)) { _jffiBuffer =>
183 184 185 186 187 188
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getLong(1)
val _raw_len = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
val len = _raw_len
189
val _RV = ctx.handleFromUInt64(num, len)
Kunshan Wang's avatar
Kunshan Wang committed
190 191
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
192
}
193
val MUCTX__HANDLE_FROM_UINT64S = exposedMethod("MuCtx.handle_from_uint64s", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.POINTER, JType.SINT)) { _jffiBuffer =>
194 195
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_nums = _jffiBuffer.getAddress(1)
196
val _raw_nnums = _jffiBuffer.getAddress(2)
197 198 199 200
val _raw_len = _jffiBuffer.getInt(3)
val ctx = getMuCtx(_raw_ctx)
val nums = readLongArray(_raw_nums, _raw_nnums)
val len = _raw_len
201
val _RV = ctx.handleFromUInt64s(nums, len)
Kunshan Wang's avatar
Kunshan Wang committed
202 203
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
204
}
Kunshan Wang's avatar
Kunshan Wang committed
205
val MUCTX__HANDLE_FROM_FLOAT = exposedMethod("MuCtx.handle_from_float", JType.POINTER, Array(JType.POINTER, JType.FLOAT)) { _jffiBuffer =>
206 207 208 209
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getFloat(1)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
210
val _RV = ctx.handleFromFloat(num)
Kunshan Wang's avatar
Kunshan Wang committed
211 212
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
213
}
Kunshan Wang's avatar
Kunshan Wang committed
214
val MUCTX__HANDLE_FROM_DOUBLE = exposedMethod("MuCtx.handle_from_double", JType.POINTER, Array(JType.POINTER, JType.DOUBLE)) { _jffiBuffer =>
215 216 217 218
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_num = _jffiBuffer.getDouble(1)
val ctx = getMuCtx(_raw_ctx)
val num = _raw_num
219
val _RV = ctx.handleFromDouble(num)
Kunshan Wang's avatar
Kunshan Wang committed
220 221
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
222
}
Kunshan Wang's avatar
Kunshan Wang committed
223
val MUCTX__HANDLE_FROM_PTR = exposedMethod("MuCtx.handle_from_ptr", JType.POINTER, Array(JType.POINTER, JType.UINT32, JType.POINTER)) { _jffiBuffer =>
224 225 226 227 228 229
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_mu_type = _jffiBuffer.getInt(1)
val _raw_ptr = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
val mu_type = _raw_mu_type
val ptr = _raw_ptr
230
val _RV = ctx.handleFromPtr(mu_type, ptr)
Kunshan Wang's avatar
Kunshan Wang committed
231 232
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
233
}
Kunshan Wang's avatar
Kunshan Wang committed
234
val MUCTX__HANDLE_FROM_FP = exposedMethod("MuCtx.handle_from_fp", JType.POINTER, Array(JType.POINTER, JType.UINT32, JType.POINTER)) { _jffiBuffer =>
235 236 237 238 239 240
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_mu_type = _jffiBuffer.getInt(1)
val _raw_fp = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
val mu_type = _raw_mu_type
val fp = _raw_fp
241
val _RV = ctx.handleFromFP(mu_type, fp)
Kunshan Wang's avatar
Kunshan Wang committed
242 243
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
244
}
Kunshan Wang's avatar
Kunshan Wang committed
245
val MUCTX__HANDLE_TO_SINT8 = exposedMethod("MuCtx.handle_to_sint8", JType.SINT8, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
246 247 248
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
249
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIntValue]
250
val _RV = ctx.handleToSInt8(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
251
_jffiBuffer.setByteReturn(_RV)
252
}
Kunshan Wang's avatar
Kunshan Wang committed
253
val MUCTX__HANDLE_TO_UINT8 = exposedMethod("MuCtx.handle_to_uint8", JType.UINT8, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
254 255 256
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
257
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIntValue]
258
val _RV = ctx.handleToUInt8(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
259
_jffiBuffer.setByteReturn(_RV)
260
}
Kunshan Wang's avatar
Kunshan Wang committed
261
val MUCTX__HANDLE_TO_SINT16 = exposedMethod("MuCtx.handle_to_sint16", JType.SINT16, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
262 263 264
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
265
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIntValue]
266
val _RV = ctx.handleToSInt16(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
267
_jffiBuffer.setShortReturn(_RV)
268
}
Kunshan Wang's avatar
Kunshan Wang committed
269
val MUCTX__HANDLE_TO_UINT16 = exposedMethod("MuCtx.handle_to_uint16", JType.UINT16, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
270 271 272
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
273
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIntValue]
274
val _RV = ctx.handleToUInt16(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
275
_jffiBuffer.setShortReturn(_RV)
276
}
Kunshan Wang's avatar
Kunshan Wang committed
277
val MUCTX__HANDLE_TO_SINT32 = exposedMethod("MuCtx.handle_to_sint32", JType.SINT32, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
278 279 280
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
281
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIntValue]
282
val _RV = ctx.handleToSInt32(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
283
_jffiBuffer.setIntReturn(_RV)
284
}
Kunshan Wang's avatar
Kunshan Wang committed
285
val MUCTX__HANDLE_TO_UINT32 = exposedMethod("MuCtx.handle_to_uint32", JType.UINT32, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
286 287 288
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
289
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIntValue]
290
val _RV = ctx.handleToUInt32(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
291
_jffiBuffer.setIntReturn(_RV)
292
}
Kunshan Wang's avatar
Kunshan Wang committed
293
val MUCTX__HANDLE_TO_SINT64 = exposedMethod("MuCtx.handle_to_sint64", JType.SINT64, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
294 295 296
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
297
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIntValue]
298
val _RV = ctx.handleToSInt64(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
299
_jffiBuffer.setLongReturn(_RV)
300
}
Kunshan Wang's avatar
Kunshan Wang committed
301
val MUCTX__HANDLE_TO_UINT64 = exposedMethod("MuCtx.handle_to_uint64", JType.UINT64, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
302 303 304
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
305
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIntValue]
306
val _RV = ctx.handleToUInt64(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
307
_jffiBuffer.setLongReturn(_RV)
308
}
Kunshan Wang's avatar
Kunshan Wang committed
309
val MUCTX__HANDLE_TO_FLOAT = exposedMethod("MuCtx.handle_to_float", JType.FLOAT, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
310 311 312
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
313
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuFloatValue]
314
val _RV = ctx.handleToFloat(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
315
_jffiBuffer.setFloatReturn(_RV)
316
}
Kunshan Wang's avatar
Kunshan Wang committed
317
val MUCTX__HANDLE_TO_DOUBLE = exposedMethod("MuCtx.handle_to_double", JType.DOUBLE, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
318 319 320
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
321
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuDoubleValue]
322
val _RV = ctx.handleToDouble(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
323
_jffiBuffer.setDoubleReturn(_RV)
324
}
Kunshan Wang's avatar
Kunshan Wang committed
325
val MUCTX__HANDLE_TO_PTR = exposedMethod("MuCtx.handle_to_ptr", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
326 327 328
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
329
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuUPtrValue]
330
val _RV = ctx.handleToPtr(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
331
_jffiBuffer.setAddressReturn(_RV)
332
}
Kunshan Wang's avatar
Kunshan Wang committed
333
val MUCTX__HANDLE_TO_FP = exposedMethod("MuCtx.handle_to_fp", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
334 335 336
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
337
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuUFPValue]
338
val _RV = ctx.handleToFP(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
339
_jffiBuffer.setAddressReturn(_RV)
340
}
Kunshan Wang's avatar
Kunshan Wang committed
341
val MUCTX__HANDLE_FROM_CONST = exposedMethod("MuCtx.handle_from_const", JType.POINTER, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
342 343 344 345
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_id = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val id = _raw_id
346
val _RV = ctx.handleFromConst(id)
Kunshan Wang's avatar
Kunshan Wang committed
347 348
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
349
}
Kunshan Wang's avatar
Kunshan Wang committed
350
val MUCTX__HANDLE_FROM_GLOBAL = exposedMethod("MuCtx.handle_from_global", JType.POINTER, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
351 352 353 354
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_id = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val id = _raw_id
355
val _RV = ctx.handleFromGlobal(id)
Kunshan Wang's avatar
Kunshan Wang committed
356 357
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
358
}
Kunshan Wang's avatar
Kunshan Wang committed
359
val MUCTX__HANDLE_FROM_FUNC = exposedMethod("MuCtx.handle_from_func", JType.POINTER, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
360 361 362 363
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_id = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val id = _raw_id
364
val _RV = ctx.handleFromFunc(id)
Kunshan Wang's avatar
Kunshan Wang committed
365 366
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
367
}
Kunshan Wang's avatar
Kunshan Wang committed
368
val MUCTX__HANDLE_FROM_EXPOSE = exposedMethod("MuCtx.handle_from_expose", JType.POINTER, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
369 370 371 372
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_id = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val id = _raw_id
373
val _RV = ctx.handleFromExpose(id)
Kunshan Wang's avatar
Kunshan Wang committed
374 375
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
376
}
Kunshan Wang's avatar
Kunshan Wang committed
377
val MUCTX__DELETE_VALUE = exposedMethod("MuCtx.delete_value", JType.VOID, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
378 379 380
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
381
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuValue]
382
val _RV = ctx.deleteValue(opnd)
383
}
Kunshan Wang's avatar
Kunshan Wang committed
384
val MUCTX__REF_EQ = exposedMethod("MuCtx.ref_eq", JType.SINT, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
385 386 387 388
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_lhs = _jffiBuffer.getAddress(1)
val _raw_rhs = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
389 390
val lhs = getMuValueNotNull(_raw_lhs).asInstanceOf[MuGenRefValue]
val rhs = getMuValueNotNull(_raw_rhs).asInstanceOf[MuGenRefValue]
391
val _RV = ctx.refEq(lhs, rhs)
392 393
val _RV_FAK = booleanToInt(_RV)
_jffiBuffer.setIntReturn(_RV_FAK)
394
}
Kunshan Wang's avatar
Kunshan Wang committed
395
val MUCTX__REF_ULT = exposedMethod("MuCtx.ref_ult", JType.SINT, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
396 397 398 399
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_lhs = _jffiBuffer.getAddress(1)
val _raw_rhs = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
400 401
val lhs = getMuValueNotNull(_raw_lhs).asInstanceOf[MuIRefValue]
val rhs = getMuValueNotNull(_raw_rhs).asInstanceOf[MuIRefValue]
402
val _RV = ctx.refUlt(lhs, rhs)
403 404
val _RV_FAK = booleanToInt(_RV)
_jffiBuffer.setIntReturn(_RV_FAK)
405
}
Kunshan Wang's avatar
Kunshan Wang committed
406
val MUCTX__EXTRACT_VALUE = exposedMethod("MuCtx.extract_value", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.SINT)) { _jffiBuffer =>
407 408 409 410
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_str = _jffiBuffer.getAddress(1)
val _raw_index = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
411
val str = getMuValueNotNull(_raw_str).asInstanceOf[MuStructValue]
412
val index = _raw_index
413
val _RV = ctx.extractValue(str, index)
Kunshan Wang's avatar
Kunshan Wang committed
414 415
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
416
}
Kunshan Wang's avatar
Kunshan Wang committed
417
val MUCTX__INSERT_VALUE = exposedMethod("MuCtx.insert_value", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.SINT, JType.POINTER)) { _jffiBuffer =>
418 419 420 421 422
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_str = _jffiBuffer.getAddress(1)
val _raw_index = _jffiBuffer.getInt(2)
val _raw_newval = _jffiBuffer.getAddress(3)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
423
val str = getMuValueNotNull(_raw_str).asInstanceOf[MuStructValue]
424
val index = _raw_index
Kunshan Wang's avatar
Kunshan Wang committed
425
val newval = getMuValueNotNull(_raw_newval).asInstanceOf[MuValue]
426
val _RV = ctx.insertValue(str, index, newval)
Kunshan Wang's avatar
Kunshan Wang committed
427 428
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
429
}
Kunshan Wang's avatar
Kunshan Wang committed
430
val MUCTX__EXTRACT_ELEMENT = exposedMethod("MuCtx.extract_element", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
431 432 433 434
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_str = _jffiBuffer.getAddress(1)
val _raw_index = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
435 436
val str = getMuValueNotNull(_raw_str).asInstanceOf[MuSeqValue]
val index = getMuValueNotNull(_raw_index).asInstanceOf[MuIntValue]
437
val _RV = ctx.extractElement(str, index)
Kunshan Wang's avatar
Kunshan Wang committed
438 439
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
440
}
Kunshan Wang's avatar
Kunshan Wang committed
441
val MUCTX__INSERT_ELEMENT = exposedMethod("MuCtx.insert_element", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
442 443 444 445 446
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_str = _jffiBuffer.getAddress(1)
val _raw_index = _jffiBuffer.getAddress(2)
val _raw_newval = _jffiBuffer.getAddress(3)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
447 448 449
val str = getMuValueNotNull(_raw_str).asInstanceOf[MuSeqValue]
val index = getMuValueNotNull(_raw_index).asInstanceOf[MuIntValue]
val newval = getMuValueNotNull(_raw_newval).asInstanceOf[MuValue]
450
val _RV = ctx.insertElement(str, index, newval)
Kunshan Wang's avatar
Kunshan Wang committed
451 452
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
453
}
Kunshan Wang's avatar
Kunshan Wang committed
454
val MUCTX__NEW_FIXED = exposedMethod("MuCtx.new_fixed", JType.POINTER, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
455 456 457 458
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_mu_type = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val mu_type = _raw_mu_type
459
val _RV = ctx.newFixed(mu_type)
Kunshan Wang's avatar
Kunshan Wang committed
460 461
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
462
}
Kunshan Wang's avatar
Kunshan Wang committed
463
val MUCTX__NEW_HYBRID = exposedMethod("MuCtx.new_hybrid", JType.POINTER, Array(JType.POINTER, JType.UINT32, JType.POINTER)) { _jffiBuffer =>
464 465 466 467 468
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_mu_type = _jffiBuffer.getInt(1)
val _raw_length = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
val mu_type = _raw_mu_type
Kunshan Wang's avatar
Kunshan Wang committed
469
val length = getMuValueNotNull(_raw_length).asInstanceOf[MuIntValue]
470
val _RV = ctx.newHybrid(mu_type, length)
Kunshan Wang's avatar
Kunshan Wang committed
471 472
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
473
}
Kunshan Wang's avatar
Kunshan Wang committed
474
val MUCTX__REFCAST = exposedMethod("MuCtx.refcast", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.UINT32)) { _jffiBuffer =>
475 476 477 478
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val _raw_new_type = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
479
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuGenRefValue]
480
val new_type = _raw_new_type
481
val _RV = ctx.refcast(opnd, new_type)
Kunshan Wang's avatar
Kunshan Wang committed
482 483
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
484
}
Kunshan Wang's avatar
Kunshan Wang committed
485
val MUCTX__GET_IREF = exposedMethod("MuCtx.get_iref", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
486 487 488
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
489
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuRefValue]
490
val _RV = ctx.getIRef(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
491 492
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
493
}
Kunshan Wang's avatar
Kunshan Wang committed
494
val MUCTX__GET_FIELD_IREF = exposedMethod("MuCtx.get_field_iref", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.SINT)) { _jffiBuffer =>
495 496 497 498
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val _raw_field = _jffiBuffer.getInt(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
499
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIRefValue]
500
val field = _raw_field
501
val _RV = ctx.getFieldIRef(opnd, field)
Kunshan Wang's avatar
Kunshan Wang committed
502 503
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
504
}
Kunshan Wang's avatar
Kunshan Wang committed
505
val MUCTX__GET_ELEM_IREF = exposedMethod("MuCtx.get_elem_iref", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
506 507 508 509
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val _raw_index = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
510 511
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIRefValue]
val index = getMuValueNotNull(_raw_index).asInstanceOf[MuIntValue]
512
val _RV = ctx.getElemIRef(opnd, index)
Kunshan Wang's avatar
Kunshan Wang committed
513 514
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
515
}
Kunshan Wang's avatar
Kunshan Wang committed
516
val MUCTX__SHIFT_IREF = exposedMethod("MuCtx.shift_iref", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
517 518 519 520
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val _raw_offset = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
521 522
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIRefValue]
val offset = getMuValueNotNull(_raw_offset).asInstanceOf[MuIntValue]
523
val _RV = ctx.shiftIRef(opnd, offset)
Kunshan Wang's avatar
Kunshan Wang committed
524 525
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
526
}
Kunshan Wang's avatar
Kunshan Wang committed
527
val MUCTX__GET_VAR_PART_IREF = exposedMethod("MuCtx.get_var_part_iref", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
528 529 530
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_opnd = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
531
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuIRefValue]
532
val _RV = ctx.getVarPartIRef(opnd)
Kunshan Wang's avatar
Kunshan Wang committed
533 534
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
535
}
Kunshan Wang's avatar
Kunshan Wang committed
536
val MUCTX__LOAD = exposedMethod("MuCtx.load", JType.POINTER, Array(JType.POINTER, JType.UINT32, JType.POINTER)) { _jffiBuffer =>
537 538 539 540 541
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_ord = _jffiBuffer.getInt(1)
val _raw_loc = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
val ord = toMemoryOrder(_raw_ord)
Kunshan Wang's avatar
Kunshan Wang committed
542
val loc = getMuValueNotNull(_raw_loc).asInstanceOf[MuIRefValue]
543
val _RV = ctx.load(ord, loc)
Kunshan Wang's avatar
Kunshan Wang committed
544 545
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
546
}
Kunshan Wang's avatar
Kunshan Wang committed
547
val MUCTX__STORE = exposedMethod("MuCtx.store", JType.VOID, Array(JType.POINTER, JType.UINT32, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
548 549 550 551 552 553
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_ord = _jffiBuffer.getInt(1)
val _raw_loc = _jffiBuffer.getAddress(2)
val _raw_newval = _jffiBuffer.getAddress(3)
val ctx = getMuCtx(_raw_ctx)
val ord = toMemoryOrder(_raw_ord)
Kunshan Wang's avatar
Kunshan Wang committed
554 555
val loc = getMuValueNotNull(_raw_loc).asInstanceOf[MuIRefValue]
val newval = getMuValueNotNull(_raw_newval).asInstanceOf[MuValue]
556
val _RV = ctx.store(ord, loc, newval)
557
}
Kunshan Wang's avatar
Kunshan Wang committed
558
val MUCTX__CMPXCHG = exposedMethod("MuCtx.cmpxchg", JType.POINTER, Array(JType.POINTER, JType.UINT32, JType.UINT32, JType.SINT, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
559 560 561 562 563 564 565 566 567 568 569
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_ord_succ = _jffiBuffer.getInt(1)
val _raw_ord_fail = _jffiBuffer.getInt(2)
val _raw_weak = _jffiBuffer.getInt(3)
val _raw_loc = _jffiBuffer.getAddress(4)
val _raw_expected = _jffiBuffer.getAddress(5)
val _raw_desired = _jffiBuffer.getAddress(6)
val _raw_is_succ = _jffiBuffer.getAddress(7)
val ctx = getMuCtx(_raw_ctx)
val ord_succ = toMemoryOrder(_raw_ord_succ)
val ord_fail = toMemoryOrder(_raw_ord_fail)
570
val weak = intToBoolean(_raw_weak)
Kunshan Wang's avatar
Kunshan Wang committed
571 572 573
val loc = getMuValueNotNull(_raw_loc).asInstanceOf[MuIRefValue]
val expected = getMuValueNotNull(_raw_expected).asInstanceOf[MuValue]
val desired = getMuValueNotNull(_raw_desired).asInstanceOf[MuValue]
574
val is_succ = _raw_is_succ
575
val _RV = ctx.cmpxchg(ord_succ, ord_fail, weak, loc, expected, desired, is_succ)
Kunshan Wang's avatar
Kunshan Wang committed
576 577
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
578
}
Kunshan Wang's avatar
Kunshan Wang committed
579
val MUCTX__ATOMICRMW = exposedMethod("MuCtx.atomicrmw", JType.POINTER, Array(JType.POINTER, JType.UINT32, JType.UINT32, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
580 581 582 583 584 585 586 587
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_ord = _jffiBuffer.getInt(1)
val _raw_op = _jffiBuffer.getInt(2)
val _raw_loc = _jffiBuffer.getAddress(3)
val _raw_opnd = _jffiBuffer.getAddress(4)
val ctx = getMuCtx(_raw_ctx)
val ord = toMemoryOrder(_raw_ord)
val op = toAtomicRMWOptr(_raw_op)
Kunshan Wang's avatar
Kunshan Wang committed
588 589
val loc = getMuValueNotNull(_raw_loc).asInstanceOf[MuIRefValue]
val opnd = getMuValueNotNull(_raw_opnd).asInstanceOf[MuValue]
590
val _RV = ctx.atomicrmw(ord, op, loc, opnd)
Kunshan Wang's avatar
Kunshan Wang committed
591 592
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
593
}
Kunshan Wang's avatar
Kunshan Wang committed
594
val MUCTX__FENCE = exposedMethod("MuCtx.fence", JType.VOID, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
595 596 597 598
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_ord = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val ord = toMemoryOrder(_raw_ord)
599
val _RV = ctx.fence(ord)
600
}
Kunshan Wang's avatar
Kunshan Wang committed
601
val MUCTX__NEW_STACK = exposedMethod("MuCtx.new_stack", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
602 603 604
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_func = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
605
val func = getMuValueNotNull(_raw_func).asInstanceOf[MuFuncRefValue]
606
val _RV = ctx.newStack(func)
Kunshan Wang's avatar
Kunshan Wang committed
607 608
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
609
}
610
val MUCTX__NEW_THREAD_NOR = exposedMethod("MuCtx.new_thread_nor", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
611 612 613 614
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_stack = _jffiBuffer.getAddress(1)
val _raw_threadlocal = _jffiBuffer.getAddress(2)
val _raw_vals = _jffiBuffer.getAddress(3)
615
val _raw_nvals = _jffiBuffer.getAddress(4)
616
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
617 618
val stack = getMuValueNotNull(_raw_stack).asInstanceOf[MuStackRefValue]
val threadlocal = getMuValueNullable(_raw_threadlocal).asInstanceOf[Option[MuRefValue]]
619
val vals = readMuValueArray(_raw_vals, _raw_nvals)
620
val _RV = ctx.newThreadNor(stack, threadlocal, vals)
Kunshan Wang's avatar
Kunshan Wang committed
621 622
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
623
}
Kunshan Wang's avatar
Kunshan Wang committed
624
val MUCTX__NEW_THREAD_EXC = exposedMethod("MuCtx.new_thread_exc", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
625 626 627 628 629
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_stack = _jffiBuffer.getAddress(1)
val _raw_threadlocal = _jffiBuffer.getAddress(2)
val _raw_exc = _jffiBuffer.getAddress(3)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
630 631 632
val stack = getMuValueNotNull(_raw_stack).asInstanceOf[MuStackRefValue]
val threadlocal = getMuValueNullable(_raw_threadlocal).asInstanceOf[Option[MuRefValue]]
val exc = getMuValueNotNull(_raw_exc).asInstanceOf[MuRefValue]
633
val _RV = ctx.newThreadExc(stack, threadlocal, exc)
Kunshan Wang's avatar
Kunshan Wang committed
634 635
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
636
}
Kunshan Wang's avatar
Kunshan Wang committed
637
val MUCTX__KILL_STACK = exposedMethod("MuCtx.kill_stack", JType.VOID, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
638 639 640
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_stack = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
641
val stack = getMuValueNotNull(_raw_stack).asInstanceOf[MuStackRefValue]
642
val _RV = ctx.killStack(stack)
643
}
Kunshan Wang's avatar
Kunshan Wang committed
644
val MUCTX__SET_THREADLOCAL = exposedMethod("MuCtx.set_threadlocal", JType.VOID, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
645 646 647 648
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_thread = _jffiBuffer.getAddress(1)
val _raw_threadlocal = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
649 650
val thread = getMuValueNotNull(_raw_thread).asInstanceOf[MuThreadRefValue]
val threadlocal = getMuValueNotNull(_raw_threadlocal).asInstanceOf[MuRefValue]
651
val _RV = ctx.setThreadlocal(thread, threadlocal)
652
}
Kunshan Wang's avatar
Kunshan Wang committed
653
val MUCTX__GET_THREADLOCAL = exposedMethod("MuCtx.get_threadlocal", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
654 655 656
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_thread = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
657
val thread = getMuValueNotNull(_raw_thread).asInstanceOf[MuThreadRefValue]
658
val _RV = ctx.getThreadlocal(thread)
Kunshan Wang's avatar
Kunshan Wang committed
659 660
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
661
}
Kunshan Wang's avatar
Kunshan Wang committed
662
val MUCTX__NEW_CURSOR = exposedMethod("MuCtx.new_cursor", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
663 664 665
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_stack = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
666
val stack = getMuValueNotNull(_raw_stack).asInstanceOf[MuStackRefValue]
667
val _RV = ctx.newCursor(stack)
Kunshan Wang's avatar
Kunshan Wang committed
668 669
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
670
}
Kunshan Wang's avatar
Kunshan Wang committed
671
val MUCTX__NEXT_FRAME = exposedMethod("MuCtx.next_frame", JType.VOID, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
672 673 674
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_cursor = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
675
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
676
val _RV = ctx.nextFrame(cursor)
677
}
Kunshan Wang's avatar
Kunshan Wang committed
678
val MUCTX__COPY_CURSOR = exposedMethod("MuCtx.copy_cursor", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
679 680 681
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_cursor = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
682
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
683
val _RV = ctx.copyCursor(cursor)
Kunshan Wang's avatar
Kunshan Wang committed
684 685
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
686
}
Kunshan Wang's avatar
Kunshan Wang committed
687
val MUCTX__CLOSE_CURSOR = exposedMethod("MuCtx.close_cursor", JType.VOID, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
688 689 690
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_cursor = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
691
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
692
val _RV = ctx.closeCursor(cursor)
693
}
Kunshan Wang's avatar
Kunshan Wang committed
694
val MUCTX__CUR_FUNC = exposedMethod("MuCtx.cur_func", JType.UINT32, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
695 696 697
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_cursor = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
698
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
699
val _RV = ctx.curFunc(cursor)
Kunshan Wang's avatar
Kunshan Wang committed
700
_jffiBuffer.setIntReturn(_RV)
701
}
Kunshan Wang's avatar
Kunshan Wang committed
702
val MUCTX__CUR_FUNC_VER = exposedMethod("MuCtx.cur_func_ver", JType.UINT32, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
703 704 705
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_cursor = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
706
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
707
val _RV = ctx.curFuncVer(cursor)
Kunshan Wang's avatar
Kunshan Wang committed
708
_jffiBuffer.setIntReturn(_RV)
709
}
Kunshan Wang's avatar
Kunshan Wang committed
710
val MUCTX__CUR_INST = exposedMethod("MuCtx.cur_inst", JType.UINT32, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
711 712 713
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_cursor = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
714
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
715
val _RV = ctx.curInst(cursor)
Kunshan Wang's avatar
Kunshan Wang committed
716
_jffiBuffer.setIntReturn(_RV)
717
}
Kunshan Wang's avatar
Kunshan Wang committed
718
val MUCTX__DUMP_KEEPALIVES = exposedMethod("MuCtx.dump_keepalives", JType.VOID, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
719 720 721 722
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_cursor = _jffiBuffer.getAddress(1)
val _raw_results = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
723 724
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
val results = _raw_results
725
val _RV = ctx.dumpKeepalives(cursor, results)
726
}
Kunshan Wang's avatar
Kunshan Wang committed
727
val MUCTX__POP_FRAMES_TO = exposedMethod("MuCtx.pop_frames_to", JType.VOID, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
728 729 730
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_cursor = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
731
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
732
val _RV = ctx.popFramesTo(cursor)
733
}
Kunshan Wang's avatar
Kunshan Wang committed
734
val MUCTX__PUSH_FRAME = exposedMethod("MuCtx.push_frame", JType.VOID, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
735
val _raw_ctx = _jffiBuffer.getAddress(0)
736
val _raw_cursor = _jffiBuffer.getAddress(1)
737 738
val _raw_func = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
739
val cursor = getMuValueNotNull(_raw_cursor).asInstanceOf[MuFCRefValue]
Kunshan Wang's avatar
Kunshan Wang committed
740
val func = getMuValueNotNull(_raw_func).asInstanceOf[MuFuncRefValue]
741
val _RV = ctx.pushFrame(cursor, func)
742
}
Kunshan Wang's avatar
Kunshan Wang committed
743
val MUCTX__TR64_IS_FP = exposedMethod("MuCtx.tr64_is_fp", JType.SINT, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
744 745 746
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
747
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuTagRef64Value]
748
val _RV = ctx.tr64IsFP(value)
749 750
val _RV_FAK = booleanToInt(_RV)
_jffiBuffer.setIntReturn(_RV_FAK)
751
}
Kunshan Wang's avatar
Kunshan Wang committed
752
val MUCTX__TR64_IS_INT = exposedMethod("MuCtx.tr64_is_int", JType.SINT, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
753 754 755
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
756
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuTagRef64Value]
757
val _RV = ctx.tr64IsInt(value)
758 759
val _RV_FAK = booleanToInt(_RV)
_jffiBuffer.setIntReturn(_RV_FAK)
760
}
Kunshan Wang's avatar
Kunshan Wang committed
761
val MUCTX__TR64_IS_REF = exposedMethod("MuCtx.tr64_is_ref", JType.SINT, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
762 763 764
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
765
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuTagRef64Value]
766
val _RV = ctx.tr64IsRef(value)
767 768
val _RV_FAK = booleanToInt(_RV)
_jffiBuffer.setIntReturn(_RV_FAK)
769
}
Kunshan Wang's avatar
Kunshan Wang committed
770
val MUCTX__TR64_TO_FP = exposedMethod("MuCtx.tr64_to_fp", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
771 772 773
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
774
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuTagRef64Value]
775
val _RV = ctx.tr64ToFP(value)
Kunshan Wang's avatar
Kunshan Wang committed
776 777
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
778
}
Kunshan Wang's avatar
Kunshan Wang committed
779
val MUCTX__TR64_TO_INT = exposedMethod("MuCtx.tr64_to_int", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
780 781 782
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
783
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuTagRef64Value]
784
val _RV = ctx.tr64ToInt(value)
Kunshan Wang's avatar
Kunshan Wang committed
785 786
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
787
}
Kunshan Wang's avatar
Kunshan Wang committed
788
val MUCTX__TR64_TO_REF = exposedMethod("MuCtx.tr64_to_ref", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
789 790 791
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
792
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuTagRef64Value]
793
val _RV = ctx.tr64ToRef(value)
Kunshan Wang's avatar
Kunshan Wang committed
794 795
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
796
}
Kunshan Wang's avatar
Kunshan Wang committed
797
val MUCTX__TR64_TO_TAG = exposedMethod("MuCtx.tr64_to_tag", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
798 799 800
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
801
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuTagRef64Value]
802
val _RV = ctx.tr64ToTag(value)
Kunshan Wang's avatar
Kunshan Wang committed
803 804
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
805
}
Kunshan Wang's avatar
Kunshan Wang committed
806
val MUCTX__TR64_FROM_FP = exposedMethod("MuCtx.tr64_from_fp", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
807 808 809
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
810
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuDoubleValue]
811
val _RV = ctx.tr64FromFP(value)
Kunshan Wang's avatar
Kunshan Wang committed
812 813
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
814
}
Kunshan Wang's avatar
Kunshan Wang committed
815
val MUCTX__TR64_FROM_INT = exposedMethod("MuCtx.tr64_from_int", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
816 817 818
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_value = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
819
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuIntValue]
820
val _RV = ctx.tr64FromInt(value)
Kunshan Wang's avatar
Kunshan Wang committed
821 822
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
823
}
Kunshan Wang's avatar
Kunshan Wang committed
824
val MUCTX__TR64_FROM_REF = exposedMethod("MuCtx.tr64_from_ref", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
825 826 827 828
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_ref = _jffiBuffer.getAddress(1)
val _raw_tag = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
829 830
val ref = getMuValueNotNull(_raw_ref).asInstanceOf[MuRefValue]
val tag = getMuValueNotNull(_raw_tag).asInstanceOf[MuIntValue]
831
val _RV = ctx.tr64FromRef(ref, tag)
Kunshan Wang's avatar
Kunshan Wang committed
832 833
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
834
}
Kunshan Wang's avatar
Kunshan Wang committed
835
val MUCTX__ENABLE_WATCHPOINT = exposedMethod("MuCtx.enable_watchpoint", JType.VOID, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
836 837 838 839
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_wpid = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val wpid = _raw_wpid
840
val _RV = ctx.enableWatchPoint(wpid)
841
}
Kunshan Wang's avatar
Kunshan Wang committed
842
val MUCTX__DISABLE_WATCHPOINT = exposedMethod("MuCtx.disable_watchpoint", JType.VOID, Array(JType.POINTER, JType.UINT32)) { _jffiBuffer =>
843 844 845 846
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_wpid = _jffiBuffer.getInt(1)
val ctx = getMuCtx(_raw_ctx)
val wpid = _raw_wpid
847
val _RV = ctx.disableWatchPoint(wpid)
848
}
Kunshan Wang's avatar
Kunshan Wang committed
849
val MUCTX__PIN = exposedMethod("MuCtx.pin", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
850 851 852
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_loc = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
853
val loc = getMuValueNotNull(_raw_loc).asInstanceOf[MuValue]
854
val _RV = ctx.pin(loc)
Kunshan Wang's avatar
Kunshan Wang committed
855 856
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
857
}
Kunshan Wang's avatar
Kunshan Wang committed
858
val MUCTX__UNPIN = exposedMethod("MuCtx.unpin", JType.VOID, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
859 860 861
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_loc = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
862
val loc = getMuValueNotNull(_raw_loc).asInstanceOf[MuValue]
863
val _RV = ctx.unpin(loc)
864
}
865 866 867 868 869 870 871 872 873
val MUCTX__GET_ADDR = exposedMethod("MuCtx.get_addr", JType.POINTER, Array(JType.POINTER, JType.POINTER)) { _jffiBuffer =>
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_loc = _jffiBuffer.getAddress(1)
val ctx = getMuCtx(_raw_ctx)
val loc = getMuValueNotNull(_raw_loc).asInstanceOf[MuValue]
val _RV = ctx.getAddr(loc)
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
}
Kunshan Wang's avatar
Kunshan Wang committed
874
val MUCTX__EXPOSE = exposedMethod("MuCtx.expose", JType.POINTER, Array(JType.POINTER, JType.POINTER, JType.UINT32, JType.POINTER)) { _jffiBuffer =>
875 876 877 878 879
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_func = _jffiBuffer.getAddress(1)
val _raw_call_conv = _jffiBuffer.getInt(2)
val _raw_cookie = _jffiBuffer.getAddress(3)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
880
val func = getMuValueNotNull(_raw_func).asInstanceOf[MuFuncRefValue]
Kunshan Wang's avatar
Kunshan Wang committed
881
val call_conv = toCallConv(_raw_call_conv)
Kunshan Wang's avatar
Kunshan Wang committed
882
val cookie = getMuValueNotNull(_raw_cookie).asInstanceOf[MuIntValue]
883
val _RV = ctx.expose(func, call_conv, cookie)
Kunshan Wang's avatar
Kunshan Wang committed
884 885
val _RV_FAK = exposeMuValue(ctx, _RV)
_jffiBuffer.setAddressReturn(_RV_FAK)
886
}
Kunshan Wang's avatar
Kunshan Wang committed
887
val MUCTX__UNEXPOSE = exposedMethod("MuCtx.unexpose", JType.VOID, Array(JType.POINTER, JType.UINT32, JType.POINTER)) { _jffiBuffer =>
888 889 890 891
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_call_conv = _jffiBuffer.getInt(1)
val _raw_value = _jffiBuffer.getAddress(2)
val ctx = getMuCtx(_raw_ctx)
Kunshan Wang's avatar
Kunshan Wang committed
892
val call_conv = toCallConv(_raw_call_conv)
Kunshan Wang's avatar
Kunshan Wang committed
893
val value = getMuValueNotNull(_raw_value).asInstanceOf[MuValue]
894
val _RV = ctx.unexpose(call_conv, value)
895
}
896
val MUCTX__NEW_IR_BUILDER = exposedMethod("MuCtx.new_ir_builder", JType.POINTER, Array(JType.POINTER)) { _jffiBuffer =>
897 898
val _raw_ctx = _jffiBuffer.getAddress(0)
val ctx = getMuCtx(_raw_ctx)
899
val _RV = ctx.newIRBuilder()
900
val _RV_FAK = exposeMuIRBuilder(_RV)
Kunshan Wang's avatar
Kunshan Wang committed
901
_jffiBuffer.setAddressReturn(_RV_FAK)
902
}
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929
val MUCTX__MAKE_BOOT_IMAGE = exposedMethod("MuCtx.make_boot_image", JType.VOID, Array(JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER, JType.POINTER)) { _jffiBuffer =>
val _raw_ctx = _jffiBuffer.getAddress(0)
val _raw_whitelist = _jffiBuffer.getAddress(1)
val _raw_whitelist_sz = _jffiBuffer.getAddress(2)
val _raw_primordial_func = _jffiBuffer.getAddress(3)
val _raw_primordial_stack = _jffiBuffer.getAddress(4)
val _raw_primordial_threadlocal = _jffiBuffer.getAddress(5)
val _raw_sym_fields = _jffiBuffer.getAddress(6)
val _raw_sym_strings = _jffiBuffer.getAddress(7)
val _raw_nsyms = _jffiBuffer.getAddress(8)
val _raw_reloc_fields = _jffiBuffer.getAddress(9)
val _raw_reloc_strings = _jffiBuffer.getAddress(10)
val _raw_nrelocs = _jffiBuffer.getAddress(11)
val _raw_output_file = _jffiBuffer.getAddress(12)
val ctx = getMuCtx(_raw_ctx)
val whitelist = readIntArray(_raw_whitelist, _raw_whitelist_sz)
val primordial_func = getMuValueNullable(_raw_primordial_func).asInstanceOf[Option[MuFuncRefValue]]
val primordial_stack = getMuValueNullable(_raw_primordial_stack).asInstanceOf[Option[MuStackRefValue]]
val primordial_threadlocal = getMuValueNullable(_raw_primordial_threadlocal).asInstanceOf[Option[MuRefValue]]
val sym_fields = readMuValueArray(_raw_sym_fields, _raw_nsyms)
val sym_strings = readCStringArray(_raw_sym_strings, _raw_nsyms)
val reloc_fields = readMuValueArray(_raw_reloc_fields, _raw_nrelocs)
val reloc_strings = readCStringArray(_raw_reloc_strings, _raw_nrelocs)
val output_file = readCString(_raw_output_file)
val _RV = ctx.makeBootImage(whitelist, primordial_func, primordial_stack, primordial_threadlocal, sym_fields, sym_strings, reloc_fields, reloc_strings, output_file)
}
val stubsOfMuCtx = new Array[Word](89)
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
stubsOfMuCtx(0) = MUCTX__ID_OF.address
stubsOfMuCtx(1) = MUCTX__NAME_OF.address
stubsOfMuCtx(2) = MUCTX__CLOSE_CONTEXT.address
stubsOfMuCtx(3) = MUCTX__LOAD_BUNDLE.address
stubsOfMuCtx(4) = MUCTX__LOAD_HAIL.address
stubsOfMuCtx(5) = MUCTX__HANDLE_FROM_SINT8.address
stubsOfMuCtx(6) = MUCTX__HANDLE_FROM_UINT8.address
stubsOfMuCtx(7) = MUCTX__HANDLE_FROM_SINT16.address
stubsOfMuCtx(8) = MUCTX__HANDLE_FROM_UINT16.address
stubsOfMuCtx(9) = MUCTX__HANDLE_FROM_SINT32.address
stubsOfMuCtx(10) = MUCTX__HANDLE_FROM_UINT32.address
stubsOfMuCtx(11) = MUCTX__HANDLE_FROM_SINT64.address
stubsOfMuCtx(12) = MUCTX__HANDLE_FROM_UINT64.address
stubsOfMuCtx(13) = MUCTX__HANDLE_FROM_UINT64S.address
stubsOfMuCtx(14) = MUCTX__HANDLE_FROM_FLOAT.address
stubsOfMuCtx(15) = MUCTX__HANDLE_FROM_DOUBLE.address
stubsOfMuCtx(16) = MUCTX__HANDLE_FROM_PTR.address
stubsOfMuCtx(17) = MUCTX__HANDLE_FROM_FP.address</