| 636 | } |
| 637 | |
| 638 | txSlot* fxNewHostInstance(txMachine* the) |
| 639 | { |
| 640 | txSlot* prototype = fxGetInstance(the, the->stack); |
| 641 | txSlot* instance = fxNewSlot(the); |
| 642 | instance->kind = XS_INSTANCE_KIND; |
| 643 | instance->value.instance.garbage = C_NULL; |
| 644 | instance->value.instance.prototype = prototype; |
| 645 | the->stack->value.reference = instance; |
| 646 | the->stack->kind = XS_REFERENCE_KIND; |
| 647 | if (prototype) { |
| 648 | txSlot* prototypeHost = prototype->next; |
| 649 | if (prototypeHost && (prototypeHost->kind == XS_HOST_KIND) && (prototypeHost->value.host.variant.destructor != fxReleaseSharedChunk)) { |
| 650 | txSlot* instanceHost = instance->next = fxNewSlot(the); |
| 651 | instanceHost->flag = XS_INTERNAL_FLAG; |
| 652 | instanceHost->kind = XS_HOST_KIND; |
| 653 | instanceHost->value.host.data = C_NULL; |
| 654 | if (prototypeHost->flag & XS_HOST_HOOKS_FLAG) { |
| 655 | instanceHost->flag |= XS_HOST_HOOKS_FLAG; |
| 656 | instanceHost->value.host.variant.hooks = prototypeHost->value.host.variant.hooks; |
| 657 | } |
| 658 | else { |
| 659 | instanceHost->value.host.variant.destructor = prototypeHost->value.host.variant.destructor; |
| 660 | } |
| 661 | } |
| 662 | } |
| 663 | return instance; |
| 664 | } |
| 665 | |
| 666 | |
| 667 | txSlot* fxCheckHostObject(txMachine* the, txSlot* it) |
no test coverage detected