Skip to content

Commit

Permalink
[JIT] Add devirtualization method for REPRs
Browse files Browse the repository at this point in the history
  • Loading branch information
bdw committed Sep 22, 2019
1 parent fb29309 commit 4324dcc
Show file tree
Hide file tree
Showing 46 changed files with 49 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/6model/6model.h
Expand Up @@ -667,6 +667,10 @@ struct MVMREPROps {
void (*spesh) (MVMThreadContext *tc, MVMSTable *st, MVMSpeshGraph *g,
MVMSpeshBB *bb, MVMSpeshIns *ins);

/* Allows the REPR to produce specialized expr IR of various instructions,
* when we know the type involved. */
MVMint32 (*jit) (MVMThreadContext *tc, MVMSTable *st, MVMSpeshGraph *g, MVMSpeshIns *ins, MVMJitExprTree *tree, MVMint32 args[]);

/* The representation's name. */
const char *name;

Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/CArray.c
Expand Up @@ -517,6 +517,7 @@ static const MVMREPROps CArray_this_repr = {
gc_free_repr_data,
compose,
NULL, /* spesh */
NULL, /* jit */
"CArray", /* name */
MVM_REPR_ID_MVMCArray,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/CPPStruct.c
Expand Up @@ -878,6 +878,7 @@ static const MVMREPROps CPPStruct_this_repr = {
gc_free_repr_data,
compose,
NULL, /* spesh */
NULL, /* jit */
"CPPStruct", /* name */
MVM_REPR_ID_MVMCPPStruct,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/CPointer.c
Expand Up @@ -151,6 +151,7 @@ static const MVMREPROps CPointer_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"CPointer", /* name */
MVM_REPR_ID_MVMCPointer,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/CStr.c
Expand Up @@ -110,6 +110,7 @@ static const MVMREPROps CStr_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"CStr", /* name */
MVM_REPR_ID_MVMCStr,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/CStruct.c
Expand Up @@ -1061,6 +1061,7 @@ static const MVMREPROps CStruct_this_repr = {
gc_free_repr_data,
compose,
spesh, /* spesh */
NULL, /* jit */
"CStruct", /* name */
MVM_REPR_ID_MVMCStruct,
unmanaged_size,
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/CUnion.c
Expand Up @@ -816,6 +816,7 @@ static const MVMREPROps CUnion_this_repr = {
gc_free_repr_data,
compose,
NULL, /* spesh */
NULL, /* jit */
"CUnion", /* name */
MVM_REPR_ID_MVMCUnion,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/ConcBlockingQueue.c
Expand Up @@ -316,6 +316,7 @@ static const MVMREPROps ConcBlockingQueue_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"ConcBlockingQueue", /* name */
MVM_REPR_ID_ConcBlockingQueue,
unmanaged_size,
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/ConditionVariable.c
Expand Up @@ -93,6 +93,7 @@ static const MVMREPROps ConditionVariable_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"ConditionVariable", /* name */
MVM_REPR_ID_ConditionVariable,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/Decoder.c
Expand Up @@ -94,6 +94,7 @@ static const MVMREPROps Decoder_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"Decoder", /* name */
MVM_REPR_ID_Decoder,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/HashAttrStore.c
Expand Up @@ -158,6 +158,7 @@ static const MVMREPROps HashAttrStore_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"HashAttrStore", /* name */
MVM_REPR_ID_HashAttrStore,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/KnowHOWAttributeREPR.c
Expand Up @@ -99,6 +99,7 @@ static const MVMREPROps KnowHOWAttributeREPR_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"KnowHOWAttributeREPR", /* name */
MVM_REPR_ID_KnowHOWAttributeREPR,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/KnowHOWREPR.c
Expand Up @@ -121,6 +121,7 @@ static const MVMREPROps KnowHOWREPR_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"KnowHOWREPR", /* name */
MVM_REPR_ID_KnowHOWREPR,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMAsyncTask.c
Expand Up @@ -93,6 +93,7 @@ static const MVMREPROps MVMAsyncTask_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"AsyncTask", /* name */
MVM_REPR_ID_MVMAsyncTask,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMCFunction.c
Expand Up @@ -83,6 +83,7 @@ static const MVMREPROps MVMCFunction_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMCFunction", /* name */
MVM_REPR_ID_MVMCFunction,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMCallCapture.c
Expand Up @@ -117,6 +117,7 @@ static const MVMREPROps MVMCallCapture_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMCallCapture", /* name */
MVM_REPR_ID_MVMCallCapture,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMCode.c
Expand Up @@ -120,6 +120,7 @@ static const MVMREPROps MVMCode_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMCode", /* name */
MVM_REPR_ID_MVMCode,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMCompUnit.c
Expand Up @@ -241,6 +241,7 @@ static const MVMREPROps MVMCompUnit_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMCompUnit", /* name */
MVM_REPR_ID_MVMCompUnit,
unmanaged_size,
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMContext.c
Expand Up @@ -259,6 +259,7 @@ static const MVMREPROps MVMContext_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMContext", /* name */
MVM_REPR_ID_MVMContext,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMContinuation.c
Expand Up @@ -106,6 +106,7 @@ static const MVMREPROps MVMContinuation_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMContinuation", /* name */
MVM_REPR_ID_MVMContinuation,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMDLLSym.c
Expand Up @@ -83,6 +83,7 @@ static const MVMREPROps MVMDLLSym_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMDLLSym",
MVM_REPR_ID_MVMDLLSym,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMException.c
Expand Up @@ -79,6 +79,7 @@ static const MVMREPROps MVMException_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"VMException", /* name */
MVM_REPR_ID_MVMException,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMHash.c
Expand Up @@ -278,6 +278,7 @@ static const MVMREPROps MVMHash_this_repr = {
NULL, /* gc_free_repr_data */
compose,
spesh,
NULL, /* jit */
"VMHash", /* name */
MVM_REPR_ID_MVMHash,
unmanaged_size, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMIter.c
Expand Up @@ -192,6 +192,7 @@ static const MVMREPROps MVMIter_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"VMIter", /* name */
MVM_REPR_ID_MVMIter,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMMultiCache.c
Expand Up @@ -96,6 +96,7 @@ static const MVMREPROps MVMMultiCache_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMMultiCache", /* name */
MVM_REPR_ID_MVMMultiCache,
unmanaged_size, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMNull.c
Expand Up @@ -80,6 +80,7 @@ static const MVMREPROps MVMNull_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"Null", /* name */
MVM_REPR_ID_MVMNull,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMOSHandle.c
Expand Up @@ -104,6 +104,7 @@ static const MVMREPROps MVMOSHandle_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMOSHandle", /* name */
MVM_REPR_ID_MVMOSHandle,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMSpeshLog.c
Expand Up @@ -180,6 +180,7 @@ static const MVMREPROps SpeshLog_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMSpeshLog", /* name */
MVM_REPR_ID_MVMSpeshLog,
unmanaged_size,
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMStaticFrame.c
Expand Up @@ -316,6 +316,7 @@ static const MVMREPROps MVMStaticFrame_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMStaticFrame", /* name */
MVM_REPR_ID_MVMStaticFrame,
unmanaged_size, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMStaticFrameSpesh.c
Expand Up @@ -172,6 +172,7 @@ static const MVMREPROps StaticFrameSpesh_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMStaticFrameSpesh", /* name */
MVM_REPR_ID_MVMStaticFrameSpesh,
unmanaged_size,
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMString.c
Expand Up @@ -130,6 +130,7 @@ static const MVMREPROps MVMString_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"MVMString", /* name */
MVM_REPR_ID_MVMString,
unmanaged_size,
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MVMThread.c
Expand Up @@ -91,6 +91,7 @@ static const MVMREPROps MVMThread_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"VMThread", /* name */
MVM_REPR_ID_MVMThread,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/MultiDimArray.c
Expand Up @@ -832,6 +832,7 @@ static const MVMREPROps MultiDimArray_this_repr = {
gc_free_repr_data,
compose,
NULL, /* spesh */
NULL, /* jit */
"MultiDimArray", /* name */
MVM_REPR_ID_MultiDimArray,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/NFA.c
Expand Up @@ -345,6 +345,7 @@ static const MVMREPROps NFA_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"NFA", /* name */
MVM_REPR_ID_NFA,
unmanaged_size,
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/NativeCall.c
Expand Up @@ -135,6 +135,7 @@ static const MVMREPROps NativeCall_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"NativeCall", /* name */
MVM_REPR_ID_MVMNativeCall,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/NativeRef.c
Expand Up @@ -174,6 +174,7 @@ static const MVMREPROps NativeRef_this_repr = {
gc_free_repr_data,
compose,
spesh, /* spesh */
NULL, /* jit */
"NativeRef", /* name */
MVM_REPR_ID_NativeRef,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/P6bigint.c
Expand Up @@ -288,6 +288,7 @@ static const MVMREPROps P6bigint_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"P6bigint", /* name */
MVM_REPR_ID_P6bigint,
unmanaged_size, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/P6int.c
Expand Up @@ -292,6 +292,7 @@ static const MVMREPROps P6int_this_repr = {
gc_free_repr_data,
compose,
spesh,
NULL, /* jit */
"P6int", /* name */
MVM_REPR_ID_P6int,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/P6num.c
Expand Up @@ -237,6 +237,7 @@ static const MVMREPROps P6num_this_repr = {
gc_free_repr_data,
compose,
spesh,
NULL, /* jit */
"P6num", /* name */
MVM_REPR_ID_P6num,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/P6opaque.c
Expand Up @@ -1903,6 +1903,7 @@ static const MVMREPROps P6opaque_this_repr = {
gc_free_repr_data,
compose,
spesh,
NULL, /* jit */
"P6opaque", /* name */
MVM_REPR_ID_P6opaque,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/P6str.c
Expand Up @@ -157,6 +157,7 @@ static const MVMREPROps P6str_this_repr = {
NULL, /* gc_free_repr_data */
compose,
spesh,
NULL, /* jit */
"P6str", /* name */
MVM_REPR_ID_P6str,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/ReentrantMutex.c
Expand Up @@ -109,6 +109,7 @@ static const MVMREPROps ReentrantMutex_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"ReentrantMutex", /* name */
MVM_REPR_ID_ReentrantMutex,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/SCRef.c
Expand Up @@ -251,6 +251,7 @@ static const MVMREPROps SCRef_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"SCRef", /* name */
MVM_REPR_ID_SCRef,
unmanaged_size,
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/Semaphore.c
Expand Up @@ -108,6 +108,7 @@ static const MVMREPROps Semaphore_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"Semaphore", /* name */
MVM_REPR_ID_Semaphore,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/Uninstantiable.c
Expand Up @@ -82,6 +82,7 @@ static const MVMREPROps Uninstantiable_this_repr = {
NULL, /* gc_free_repr_data */
compose,
NULL, /* spesh */
NULL, /* jit */
"Uninstantiable", /* name */
MVM_REPR_ID_Uninstantiable,
NULL, /* unmanaged_size */
Expand Down
1 change: 1 addition & 0 deletions src/6model/reprs/VMArray.c
Expand Up @@ -1464,6 +1464,7 @@ static const MVMREPROps VMArray_this_repr = {
gc_free_repr_data,
compose,
spesh,
NULL, /* jit */
"VMArray", /* name */
MVM_REPR_ID_VMArray,
unmanaged_size,
Expand Down

0 comments on commit 4324dcc

Please sign in to comment.