| 258 | } |
| 259 | |
| 260 | void fxMapCode(txLinker* linker, txLinkerScript* script, txID* theIDs) |
| 261 | { |
| 262 | register const txS1* sizes = gxCodeSizes; |
| 263 | register txByte* p = script->codeBuffer; |
| 264 | register txByte* q = p + script->codeSize; |
| 265 | register txS1 offset; |
| 266 | txU1 code; |
| 267 | txID id; |
| 268 | while (p < q) { |
| 269 | code = *((txU1*)p); |
| 270 | if (script->preload == C_NULL) { |
| 271 | if (XS_CODE_CODE_1 == code) |
| 272 | *((txU1*)p) = code = XS_CODE_CODE_ARCHIVE_1; |
| 273 | else if (XS_CODE_CODE_2 == code) |
| 274 | *((txU1*)p) = code = XS_CODE_CODE_ARCHIVE_2; |
| 275 | else if (XS_CODE_CODE_4 == code) |
| 276 | *((txU1*)p) = code = XS_CODE_CODE_ARCHIVE_4; |
| 277 | else if (XS_CODE_STRING_1 == code) |
| 278 | *((txU1*)p) = code = XS_CODE_STRING_ARCHIVE_1; |
| 279 | else if (XS_CODE_STRING_2 == code) |
| 280 | *((txU1*)p) = code = XS_CODE_STRING_ARCHIVE_2; |
| 281 | else if (XS_CODE_STRING_4 == code) |
| 282 | *((txU1*)p) = code = XS_CODE_STRING_ARCHIVE_4; |
| 283 | } |
| 284 | gxCodeUsages[code]++; |
| 285 | offset = (txS1)sizes[code]; |
| 286 | if (0 < offset) { |
| 287 | if (linker->profileID && (XS_CODE_PROFILE == code)) { |
| 288 | p++; |
| 289 | id = linker->profileID; |
| 290 | linker->profileID++; |
| 291 | mxEncodeID(p, id); |
| 292 | } |
| 293 | else |
| 294 | p += offset; |
| 295 | } |
| 296 | else if (0 == offset) { |
| 297 | p++; |
| 298 | mxDecodeID(p, id); |
| 299 | id = theIDs[id]; |
| 300 | p -= sizeof(txID); |
| 301 | mxEncodeID(p, id); |
| 302 | linker->mapIndex++; |
| 303 | if ((XS_CODE_GET_PROPERTY == code) || (XS_CODE_GET_SUPER == code) || (XS_CODE_GET_THIS_VARIABLE == code) || (XS_CODE_GET_VARIABLE == code) || (XS_CODE_PROGRAM_REFERENCE == code)) |
| 304 | fxReferenceLinkerSymbol(linker, id); |
| 305 | } |
| 306 | else if (-1 == offset) { |
| 307 | txU1 index; |
| 308 | p++; |
| 309 | index = *((txU1*)p); |
| 310 | p += 1 + index; |
| 311 | } |
| 312 | else if (-2 == offset) { |
| 313 | txU2 index; |
| 314 | p++; |
| 315 | mxDecode2(p, index); |
| 316 | p += index; |
| 317 | } |
no test coverage detected