MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / LoadByteCode

Method LoadByteCode

src/server/angelscript/angelscript/source/as_module.cpp:1660–1701  ·  view source on GitHub ↗

interface

Source from the content-addressed store, hash-verified

1658
1659// interface
1660int asCModule::LoadByteCode(asIBinaryStream *in, bool *wasDebugInfoStripped)
1661{
1662 if( in == 0 ) return asINVALID_ARG;
1663
1664 // Don't allow the module to be rebuilt if there are still
1665 // external references that will need the previous code
1666 if( HasExternalReferences(false) )
1667 {
1668 m_engine->WriteMessage("", 0, 0, asMSGTYPE_ERROR, TXT_MODULE_IS_IN_USE);
1669 return asMODULE_IS_IN_USE;
1670 }
1671
1672 // Only permit loading bytecode if no other thread is currently compiling
1673 // TODO: It should be possible to have multiple threads perform compilations
1674 int r = m_engine->RequestBuild();
1675 if( r < 0 )
1676 return r;
1677
1678 asCReader read(this, in, m_engine);
1679 r = read.Read(wasDebugInfoStripped);
1680 if (r < 0)
1681 {
1682 m_engine->BuildCompleted();
1683 return r;
1684 }
1685
1686 JITCompile();
1687
1688#ifdef AS_DEBUG
1689 // Verify that there are no unwanted gaps in the scriptFunctions array.
1690 for( asUINT n = 1; n < m_engine->scriptFunctions.GetLength(); n++ )
1691 {
1692 int id = n;
1693 if( m_engine->scriptFunctions[n] == 0 && !m_engine->freeScriptFunctionIds.Exists(id) )
1694 asASSERT( false );
1695 }
1696#endif
1697
1698 m_engine->BuildCompleted();
1699
1700 return r;
1701}
1702
1703// interface
1704int asCModule::CompileGlobalVar(const char *sectionName, const char *code, int lineOffset)

Callers

nothing calls this directly

Calls 6

WriteMessageMethod · 0.80
RequestBuildMethod · 0.80
BuildCompletedMethod · 0.80
ReadMethod · 0.45
GetLengthMethod · 0.45
ExistsMethod · 0.45

Tested by

no test coverage detected