MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxTypedArrayGetter

Function fxTypedArrayGetter

xs/sources/xsDataView.c:1193–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1191 txInteger resultLength = fxCheckDataViewSize(the, resultView, resultBuffer, XS_MUTABLE) >> resultDispatch->value.typedArray.dispatch->shift
1192
1193void fxTypedArrayGetter(txMachine* the)
1194{
1195 txSlot* instance = fxToInstance(the, mxThis);
1196 txSlot* dispatch;
1197 while (instance) {
1198 if (instance->flag & XS_EXOTIC_FLAG) {
1199 dispatch = instance->next;
1200 if (dispatch->ID == XS_TYPED_ARRAY_BEHAVIOR)
1201 break;
1202 }
1203 instance = fxGetPrototype(the, instance);
1204 }
1205 if (instance) {
1206 txID id = the->scratch.value.at.id;
1207 txIndex index = the->scratch.value.at.index;
1208 txSlot* view = dispatch->next;
1209 txSlot* buffer = view->next;
1210 txU2 shift = dispatch->value.typedArray.dispatch->shift;
1211 txIndex length = fxGetDataViewSize(the, view, buffer) >> shift;
1212 if ((!id) && (index < length)) {
1213 (*dispatch->value.typedArray.dispatch->getter)(the, buffer->value.reference->next, view->value.dataView.offset + (index << shift), mxResult, EndianNative);
1214 }
1215 }
1216}
1217
1218void fxTypedArraySetter(txMachine* the)
1219{

Callers

nothing calls this directly

Calls 3

fxToInstanceFunction · 0.85
fxGetPrototypeFunction · 0.85
fxGetDataViewSizeFunction · 0.85

Tested by

no test coverage detected