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

Function fxBeginHost

xs/sources/xsAPI.c:1883–1925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1881/* Host */
1882
1883txMachine* fxBeginHost(txMachine* the)
1884{
1885#if defined(mxInstrument) || defined(mxProfile)
1886 if (the->frame == C_NULL)
1887 fxCheckProfiler(the, C_NULL);
1888#endif
1889 mxOverflow(-5);
1890 /* THIS */
1891 (--the->stack)->next = C_NULL;
1892 mxInitSlotKind(the->stack, XS_UNDEFINED_KIND);
1893 /* FUNCTION */
1894 (--the->stack)->next = C_NULL;
1895 mxInitSlotKind(the->stack, XS_UNDEFINED_KIND);
1896 /* RESULT */
1897 (--the->stack)->next = C_NULL;
1898 mxInitSlotKind(the->stack, XS_UNDEFINED_KIND);
1899 /* FRAME */
1900 (--the->stack)->next = the->frame;
1901 the->stack->ID = 0;
1902 the->stack->flag = XS_C_FLAG;
1903#ifdef mxDebug
1904 if (the->breakOnStartFlag) {
1905 the->breakOnStartFlag = 0;
1906 the->stack->flag |= XS_STEP_INTO_FLAG | XS_STEP_OVER_FLAG;
1907 }
1908 if (the->frame && (the->frame->flag & XS_STEP_INTO_FLAG))
1909 the->stack->flag |= XS_STEP_INTO_FLAG | XS_STEP_OVER_FLAG;
1910#endif
1911 the->stack->kind = XS_FRAME_KIND;
1912 the->stack->value.frame.code = the->code;
1913 the->stack->value.frame.scope = the->scope;
1914 the->frame = the->stack;
1915 /* VARC */
1916 (--the->stack)->next = C_NULL;
1917 the->stack->ID = XS_NO_ID;
1918 the->stack->flag = XS_NO_FLAG;
1919 the->stack->kind = XS_VAR_KIND;
1920 the->stack->value.environment.variable.count = 0;
1921 the->stack->value.environment.line = 0;
1922 the->scope = the->stack;
1923 the->code = C_NULL;
1924 return the;
1925}
1926
1927void fxEndHost(txMachine* the)
1928{

Callers 15

fx_callbackTimerFunction · 0.85
fxRunImportFunction · 0.85
fxRunImportMetaFunction · 0.85
fxRunConstructorFunction · 0.85
fxRunDefineFunction · 0.85
fxRunDeleteFunction · 0.85
fxRunExtendsFunction · 0.85
fxRunForAwaitOfFunction · 0.85
fxRunForOfFunction · 0.85
fxRunHasFunction · 0.85
fxRunInFunction · 0.85
fxRunInstanceOfFunction · 0.85

Calls 1

fxCheckProfilerFunction · 0.70

Tested by

no test coverage detected