| 1044 | } |
| 1045 | |
| 1046 | void fxMarkReference(txMachine* the, txSlot* theSlot) |
| 1047 | { |
| 1048 | txSlot* aSlot; |
| 1049 | switch (theSlot->kind) { |
| 1050 | case XS_REFERENCE_KIND: |
| 1051 | aSlot = theSlot->value.reference; |
| 1052 | if (!(aSlot->flag & XS_MARK_FLAG)) |
| 1053 | fxMarkInstance(the, aSlot, fxMarkReference); |
| 1054 | break; |
| 1055 | case XS_CLOSURE_KIND: |
| 1056 | aSlot = theSlot->value.closure; |
| 1057 | if (aSlot && (!(aSlot->flag & XS_MARK_FLAG))) { |
| 1058 | aSlot->flag |= XS_MARK_FLAG; |
| 1059 | fxMarkReference(the, aSlot); |
| 1060 | } |
| 1061 | break; |
| 1062 | case XS_INSTANCE_KIND: |
| 1063 | if (!(theSlot->flag & XS_MARK_FLAG)) |
| 1064 | fxMarkInstance(the, theSlot, fxMarkReference); |
| 1065 | break; |
| 1066 | case XS_ACCESSOR_KIND: |
| 1067 | aSlot = theSlot->value.accessor.getter; |
| 1068 | if (aSlot && !(aSlot->flag & XS_MARK_FLAG)) { |
| 1069 | fxCheckCStack(the); |
| 1070 | fxMarkInstance(the, aSlot, fxMarkReference); |
| 1071 | } |
| 1072 | aSlot = theSlot->value.accessor.setter; |
| 1073 | if (aSlot && !(aSlot->flag & XS_MARK_FLAG)) { |
| 1074 | fxCheckCStack(the); |
| 1075 | fxMarkInstance(the, aSlot, fxMarkReference); |
| 1076 | } |
| 1077 | break; |
| 1078 | case XS_ARGUMENTS_SLOPPY_KIND: |
| 1079 | case XS_ARGUMENTS_STRICT_KIND: |
| 1080 | case XS_ARRAY_KIND: |
| 1081 | case XS_STACK_KIND: |
| 1082 | fxCheckCStack(the); |
| 1083 | if ((aSlot = theSlot->value.array.address)) { |
| 1084 | txIndex aLength = (((txChunk*)(((txByte*)aSlot) - sizeof(txChunk)))->size) / sizeof(txSlot); |
| 1085 | if (aLength > theSlot->value.array.length) |
| 1086 | aLength = theSlot->value.array.length; |
| 1087 | while (aLength) { |
| 1088 | fxMarkReference(the, aSlot); |
| 1089 | aSlot++; |
| 1090 | aLength--; |
| 1091 | } |
| 1092 | } |
| 1093 | break; |
| 1094 | case XS_CALLBACK_KIND: |
| 1095 | aSlot = theSlot->value.callback.closures; |
| 1096 | if (aSlot && !(aSlot->flag & XS_MARK_FLAG)) { |
| 1097 | fxCheckCStack(the); |
| 1098 | fxMarkInstance(the, aSlot, fxMarkReference); |
| 1099 | } |
| 1100 | break; |
| 1101 | case XS_CODE_KIND: |
| 1102 | // continue |
| 1103 | case XS_CODE_X_KIND: |
nothing calls this directly
no test coverage detected