虚幻4 蓝图被编译成的蓝图汇编代码

来源:互联网 发布:围巾品牌 知乎 编辑:程序博客网 时间:2024/06/10 04:03

\Engine\Source\Editor\KismetCompiler\Public\BlueprintCompiledStatement.h

//////////////////////////////////////////////////////////////////////////// FBlueprintCompiledStatementenum EKismetCompiledStatementType{KCST_Nop = 0,KCST_CallFunction = 1,// [wiring =] TargetObject->FunctionToCall(wiring)KCST_Assignment = 2,// TargetObject->TargetProperty = [wiring]KCST_CompileError = 3,// One of the other types with a compilation error during statement generationKCST_UnconditionalGoto = 4,// goto TargetLabelKCST_PushState = 5,         // FlowStack.Push(TargetLabel)KCST_GotoIfNot = 6,// [if (!TargetObject->TargetProperty)] goto TargetLabelKCST_Return = 7,// return TargetObject->TargetPropertyKCST_EndOfThread = 8,// if (FlowStack.Num()) { NextState = FlowStack.Pop; } else { return; }KCST_Comment = 9,// /* Comment */KCST_ComputedGoto = 10,// NextState = LHS;KCST_EndOfThreadIfNot = 11, // [if (!TargetObject->TargetProperty)] { same as KCST_EndOfThread; }KCST_DebugSite = 12,// NOP with recorded addressKCST_CastObjToInterface = 13,// TargetInterface(TargetObject)KCST_DynamicCast = 14,    // Cast<TargetClass>(TargetObject)KCST_ObjectToBool = 15,// (TargetObject != None)KCST_AddMulticastDelegate = 16,// TargetDelegate->Add(EventDelegate)KCST_ClearMulticastDelegate = 17,// TargetDelegate->Clear()KCST_WireTraceSite = 18,    // NOP with recorded address (never a step target)KCST_BindDelegate = 19,// Creates simple delegateKCST_RemoveMulticastDelegate = 20,//  TargetDelegate->Remove(EventDelegate)KCST_CallDelegate = 21,// TargetDelegate->Broadcast(...)KCST_CreateArray = 22,// Creates and sets an array literal termKCST_CrossInterfaceCast = 23,// TargetInterface(Interface)KCST_MetaCast = 24,    // Cast<TargetClass>(TargetObject)KCST_AssignmentOnPersistentFrame = 25, //KCST_CastInterfaceToObj = 26, // Cast<TargetClass>(TargetInterface)KCST_GotoReturn = 27,// goto ReturnLabelKCST_GotoReturnIfNot = 28, // [if (!TargetObject->TargetProperty)] goto TargetLabelKCST_SwitchValue = 29,// Kismet instrumentation extensionsKCST_InstrumentedPureNodeEntry,// Instrumented pure node entryKCST_InstrumentedWireEntry,// Instrumented wiretrace entryKCST_InstrumentedWireExit,// Instrumented wiretrace exitKCST_InstrumentedStatePush,// Instrumented state pushKCST_InstrumentedStateRestore,// Instrumented state restoreKCST_InstrumentedStateReset,// Instrumented state resetKCST_InstrumentedStateSuspend,// Instrumented state suspendKCST_InstrumentedStatePop,// Instrumented state pop//KCST_ArrayGetByRef,};


C++最后编译为汇编,蓝图最后编译的字节码  可以叫 蓝图汇编,所有的功能编译为下面的这个枚举所列举的功能。

\Engine\Source\Runtime\CoreUObject\Public\UObject\Script.h


使用

IMPLEMENT_VM_FUNCTION

宏在解释函数数组中填充函数,然后编译完成的字节码直接作为下标,在函数数组中取出函数执行。


//// Evaluatable expression item types.//enum EExprToken{// Variable references.EX_LocalVariable= 0x00,// A local variable.EX_InstanceVariable= 0x01,// An object variable.EX_DefaultVariable= 0x02, // Default variable for a class context.//= 0x03,EX_Return= 0x04,// Return from function.//= 0x05,EX_Jump= 0x06,// Goto a local address in code.EX_JumpIfNot= 0x07,// Goto if not expression.//= 0x08,EX_Assert= 0x09,// Assertion.//= 0x0A,EX_Nothing= 0x0B,// No operation.//= 0x0C,//= 0x0D,//= 0x0E,EX_Let= 0x0F,// Assign an arbitrary size value to a variable.//= 0x10,//= 0x11,EX_ClassContext= 0x12,// Class default object context.EX_MetaCast             = 0x13, // Metaclass cast.EX_LetBool= 0x14, // Let boolean variable.EX_EndParmValue= 0x15,// end of default value for optional function parameterEX_EndFunctionParms= 0x16,// End of function call parameters.EX_Self= 0x17,// Self object.EX_Skip= 0x18,// Skippable expression.EX_Context= 0x19,// Call a function through an object context.EX_Context_FailSilent= 0x1A, // Call a function through an object context (can fail silently if the context is NULL; only generated for functions that don't have output or return values).EX_VirtualFunction= 0x1B,// A function call with parameters.EX_FinalFunction= 0x1C,// A prebound function call with parameters.EX_IntConst= 0x1D,// Int constant.EX_FloatConst= 0x1E,// Floating point constant.EX_StringConst= 0x1F,// String constant.EX_ObjectConst    = 0x20,// An object constant.EX_NameConst= 0x21,// A name constant.EX_RotationConst= 0x22,// A rotation constant.EX_VectorConst= 0x23,// A vector constant.EX_ByteConst= 0x24,// A byte constant.EX_IntZero= 0x25,// Zero.EX_IntOne= 0x26,// One.EX_True= 0x27,// Bool True.EX_False= 0x28,// Bool False.EX_TextConst= 0x29, // FText constantEX_NoObject= 0x2A,// NoObject.EX_TransformConst= 0x2B, // A transform constantEX_IntConstByte= 0x2C,// Int constant that requires 1 byte.EX_NoInterface= 0x2D, // A null interface (similar to EX_NoObject, but for interfaces)EX_DynamicCast= 0x2E,// Safe dynamic class casting.EX_StructConst= 0x2F, // An arbitrary UStruct constantEX_EndStructConst= 0x30, // End of UStruct constantEX_SetArray= 0x31, // Set the value of arbitrary arrayEX_EndArray= 0x32,//= 0x33,EX_UnicodeStringConst   = 0x34, // Unicode string constant.EX_Int64Const= 0x35,// 64-bit integer constant.EX_UInt64Const= 0x36,// 64-bit unsigned integer constant.//= 0x37,EX_PrimitiveCast= 0x38,// A casting operator for primitives which reads the type as the subsequent byte//= 0x39,//= 0x3A,//= 0x3B,//= 0x3C,//= 0x3D,//= 0x3E,//= 0x3F,//= 0x40,//= 0x41,EX_StructMemberContext= 0x42, // Context expression to address a property within a structEX_LetMulticastDelegate= 0x43, // Assignment to a multi-cast delegateEX_LetDelegate= 0x44, // Assignment to a delegate//= 0x45, //= 0x46, // CST_ObjectToInterface//= 0x47, // CST_ObjectToBoolEX_LocalOutVariable= 0x48, // local out (pass by reference) function parameter//= 0x49, // CST_InterfaceToBoolEX_DeprecatedOp4A= 0x4A,EX_InstanceDelegate= 0x4B,// const reference to a delegate or normal function objectEX_PushExecutionFlow= 0x4C, // push an address on to the execution flow stack for future execution when a EX_PopExecutionFlow is executed.   Execution continues on normally and doesn't change to the pushed address.EX_PopExecutionFlow= 0x4D, // continue execution at the last address previously pushed onto the execution flow stack.EX_ComputedJump= 0x4E,// Goto a local address in code, specified by an integer value.EX_PopExecutionFlowIfNot = 0x4F, // continue execution at the last address previously pushed onto the execution flow stack, if the condition is not true.EX_Breakpoint= 0x50, // Breakpoint.  Only observed in the editor, otherwise it behaves like EX_Nothing.EX_InterfaceContext= 0x51,// Call a function through a native interface variableEX_ObjToInterfaceCast   = 0x52,// Converting an object reference to native interface variableEX_EndOfScript= 0x53, // Last byte in script codeEX_CrossInterfaceCast= 0x54, // Converting an interface variable reference to native interface variableEX_InterfaceToObjCast   = 0x55, // Converting an interface variable reference to an object//= 0x56,//= 0x57,//= 0x58,//= 0x59,EX_WireTracepoint= 0x5A, // Trace point.  Only observed in the editor, otherwise it behaves like EX_Nothing.EX_SkipOffsetConst= 0x5B, // A CodeSizeSkipOffset constantEX_AddMulticastDelegate = 0x5C, // Adds a delegate to a multicast delegate's targetsEX_ClearMulticastDelegate = 0x5D, // Clears all delegates in a multicast targetEX_Tracepoint= 0x5E, // Trace point.  Only observed in the editor, otherwise it behaves like EX_Nothing.EX_LetObj= 0x5F,// assign to any object ref pointerEX_LetWeakObjPtr= 0x60, // assign to a weak object pointerEX_BindDelegate= 0x61, // bind object and name to delegateEX_RemoveMulticastDelegate = 0x62, // Remove a delegate from a multicast delegate's targetsEX_CallMulticastDelegate = 0x63, // Call multicast delegateEX_LetValueOnPersistentFrame = 0x64,EX_ArrayConst= 0x65,EX_EndArrayConst= 0x66,EX_AssetConst= 0x67,EX_CallMath= 0x68, // static pure function from on local call spaceEX_SwitchValue= 0x69,EX_InstrumentationEvent= 0x6A, // Instrumentation eventEX_ArrayGetByRef= 0x6B,EX_Max= 0x100,};




原创粉丝点击