MCPcopy Create free account
hub / github.com/anjo76/angelscript / Output

Method Output

sdk/angelscript/source/as_bytecode.cpp:1937–2011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1935}
1936
1937void asCByteCode::Output(asDWORD *array)
1938{
1939 TimeIt("asCByteCode::Output");
1940
1941 // TODO: Receive a script function pointer instead of the bytecode array
1942
1943 asDWORD *ap = array;
1944
1945 asCByteInstruction *instr = first;
1946 while( instr )
1947 {
1948 if( instr->GetSize() > 0 )
1949 {
1950 *(asBYTE*)ap = asBYTE(instr->op);
1951 *(((asBYTE*)ap)+1) = 0; // Second byte is always zero
1952 switch( asBCInfo[instr->op].type )
1953 {
1954 case asBCTYPE_NO_ARG:
1955 *(((asWORD*)ap)+1) = 0; // Clear upper bytes
1956 break;
1957 case asBCTYPE_wW_rW_rW_ARG:
1958 *(((asWORD*)ap)+1) = instr->wArg[0];
1959 *(((asWORD*)ap)+2) = instr->wArg[1];
1960 *(((asWORD*)ap)+3) = instr->wArg[2];
1961 break;
1962 case asBCTYPE_wW_DW_ARG:
1963 case asBCTYPE_rW_DW_ARG:
1964 case asBCTYPE_W_DW_ARG:
1965 *(((asWORD*)ap)+1) = instr->wArg[0];
1966 *(ap+1) = *(asDWORD*)&instr->arg;
1967 break;
1968 case asBCTYPE_wW_rW_DW_ARG:
1969 case asBCTYPE_rW_W_DW_ARG:
1970 *(((asWORD*)ap)+1) = instr->wArg[0];
1971 *(((asWORD*)ap)+2) = instr->wArg[1];
1972 *(ap+2) = *(asDWORD*)&instr->arg;
1973 break;
1974 case asBCTYPE_wW_QW_ARG:
1975 case asBCTYPE_rW_QW_ARG:
1976 *(((asWORD*)ap)+1) = instr->wArg[0];
1977 *(asQWORD*)(ap+1) = asQWORD(instr->arg);
1978 break;
1979 case asBCTYPE_W_ARG:
1980 case asBCTYPE_rW_ARG:
1981 case asBCTYPE_wW_ARG:
1982 *(((asWORD*)ap)+1) = instr->wArg[0];
1983 break;
1984 case asBCTYPE_wW_rW_ARG:
1985 case asBCTYPE_rW_rW_ARG:
1986 case asBCTYPE_wW_W_ARG:
1987 *(((asWORD *)ap)+1) = instr->wArg[0];
1988 *(((asWORD *)ap)+2) = instr->wArg[1];
1989 break;
1990 case asBCTYPE_QW_DW_ARG:
1991 case asBCTYPE_DW_DW_ARG:
1992 case asBCTYPE_QW_ARG:
1993 case asBCTYPE_DW_ARG:
1994 *(((asWORD*)ap)+1) = 0; // Clear upper bytes

Callers 1

FinalizeFunctionMethod · 0.45

Calls 1

GetSizeMethod · 0.45

Tested by

no test coverage detected