Changeset 86 in dev


Ignore:
Timestamp:
Mar 30, 2007, 5:12:12 AM (17 years ago)
Author:
dai_9181
Message:

pSubStaticMethod_System_TypeBase_InitializeUserTypesを追加

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/Compile_ProcOp.cpp

    r85 r86  
    33
    44
    5 void SystemProc( const char *name ){
    6     if(lstrcmp(name,"_System_GetEip")==0){
     5void SystemProc( const UserProc &userProc ){
     6    if( userProc.GetName() == "_System_GetEip" ){
    77        //mov eax,dword ptr[esp]
    88        OpBuffer[obp++]=(char)0x8B;
     
    1313        OpBuffer[obp++]=(char)0xC3;
    1414    }
    15     else if(lstrcmp(name,"_System_InitDllGlobalVariables")==0){
     15    else if( userProc.GetName() == "_System_InitDllGlobalVariables" ){
    1616        ////////////////////////////////////////
    1717        // DLLのグローバル領域をコンパイル
     
    5454        OpBuffer[obp++]=(char)0xC3;
    5555    }
    56     else if(lstrcmp(name,"_System_InitStaticLocalVariables")==0){
     56    else if( userProc.GetName() == "_System_InitStaticLocalVariables" ){
    5757        //静的ローカルオブジェクトのコンストラクタ呼び出し
    5858
     
    7777        OpBuffer[obp++]=(char)0xC3;
    7878    }
    79     else if(lstrcmp(name,"_System_Call_Destructor_of_GlobalObject")==0){
     79    else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ){
    8080
    8181        UserProc *pBackUserProc;
     
    9191        OpBuffer[obp++]=(char)0xC3;
    9292    }
    93     else if(lstrcmp(name,"_System_GetSp")==0){
     93    else if( userProc.GetName() == "_System_GetSp" ){
    9494        //mov eax,esp
    9595        op_mov_RR(REG_EAX,REG_ESP);
     
    101101        OpBuffer[obp++]=(char)0xC3;
    102102    }
    103     else if(lstrcmp(name,"_allrem")==0){
     103    else if( userProc.GetName() == "_allrem" ){
    104104        //乗除演算用の特殊関数(64ビット整数対応)
    105105        BYTE Buffer_allrem[]={
     
    110110        obp+=178;
    111111    }
    112     else if(lstrcmp(name,"_aullrem")==0){
     112    else if( userProc.GetName() == "_aullrem" ){
    113113        //乗除演算用の特殊関数(64ビット整数対応)
    114114        BYTE Buffer_aullrem[]={
     
    127127        obp+=117;
    128128    }
    129     else if(lstrcmp(name,"_allmul")==0){
     129    else if( userProc.GetName() == "_allmul" ){
    130130        //乗算用の特殊関数(64ビット整数対応)
    131131        BYTE Buffer_allmul[]={
     
    136136        obp+=52;
    137137    }
    138     else if(lstrcmp(name,"_alldiv")==0){
     138    else if( userProc.GetName() == "_alldiv" ){
    139139        //除算用の特殊関数(64ビット整数対応)
    140140        BYTE Buffer_alldiv[]={
     
    145145        obp+=170;
    146146    }
    147     else if(lstrcmp(name,"_aulldiv")==0){
     147    else if( userProc.GetName() == "_aulldiv" ){
    148148        //整数除算用の特殊関数(64ビット整数対応)
    149149        BYTE Buffer_aulldiv[]={
     
    161161        obp+=104;
    162162    }
    163     else if(lstrcmp(name,"_allshl")==0){
     163    else if( userProc.GetName() == "_allshl" ){
    164164        //符号あり左ビットシフト用の特殊関数(64ビット整数対応)
    165165        BYTE Buffer_allshl[]={
     
    170170        obp+=31;
    171171    }
    172     else if(lstrcmp(name,"_allshr")==0){
     172    else if( userProc.GetName() == "_allshr" ){
    173173        //符号あり右ビットシフト用の特殊関数(64ビット整数対応)
    174174        BYTE Buffer_allshr[]={
     
    179179        obp+=33;
    180180    }
    181     else if(lstrcmp(name,"_aullshr")==0){
     181    else if( userProc.GetName() == "_aullshr" ){
    182182        //符号なし右ビットシフト用の特殊関数(64ビット整数対応)
    183183        BYTE Buffer_aullshr[]={
     
    204204        obp+=31;
    205205    }
     206    else if( userProc.GetName() == "InitializeUserTypes" ){
     207    }
    206208    else{
    207209        SetError();
     
    245247        AllLocalVarSize=0;
    246248
    247         SystemProc(pUserProc->GetName().c_str());
     249        SystemProc(*pUserProc);
    248250
    249251        pUserProc->endOpAddress=obp;
  • BasicCompiler32/MakePeHdr.cpp

    r78 r86  
    2626    *pSub_System_GC_malloc_ForObjectPtr,
    2727    *pSub_System_GC_free_for_SweepingDelete,
     28    *pSubStaticMethod_System_TypeBase_InitializeUserTypes,
    2829
    2930    *pSub_allrem,
     
    245246    if( pSub_System_GC_free_for_SweepingDelete = GetSubHash( "_System_GC_free_for_SweepingDelete",1 ) )
    246247        pSub_System_GC_free_for_SweepingDelete->Using();
     248
     249    if( pSubStaticMethod_System_TypeBase_InitializeUserTypes = GetSubHash( "_System_TypeBase.InitializeUserTypes",1 ) ){
     250        pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using();
     251        pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsSystemProc();
     252    }
    247253
    248254    pSub_allrem=GetSubHash("_allrem");
  • BasicCompiler64/Compile_ProcOp.cpp

    r85 r86  
    22#include "Opcode.h"
    33
    4 void SystemProc( const char *name ){
    5     if(lstrcmp(name,"_System_GetEip")==0){
     4void SystemProc( const UserProc &userProc ){
     5    if( userProc.GetName() == "_System_GetEip" ){
    66        //mov rax,qword ptr[rsp]
    77        op_mov_RM(sizeof(_int64),REG_RAX,REG_RSP,0,MOD_BASE);
     
    1010        OpBuffer[obp++]=(char)0xC3;
    1111    }
    12     else if(lstrcmp(name,"_System_InitDllGlobalVariables")==0){
     12    else if( userProc.GetName() == "_System_InitDllGlobalVariables" ){
    1313        ////////////////////////////////////////
    1414        // DLLのグローバル領域をコンパイル
     
    6161        OpBuffer[obp++]=(char)0xC3;
    6262    }
    63     else if(lstrcmp(name,"_System_InitStaticLocalVariables")==0){
     63    else if( userProc.GetName() == "_System_InitStaticLocalVariables" ){
    6464        //静的ローカルオブジェクトのコンストラクタ呼び出し
    6565
     
    9595        OpBuffer[obp++]=(char)0xC3;
    9696    }
    97     else if(lstrcmp(name,"_System_Call_Destructor_of_GlobalObject")==0){
     97    else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ){
    9898        //sub rsp,8(※RSPを16バイト境界にあわせるため)
    9999        op_sub_rsp(0x8);
     
    115115        OpBuffer[obp++]=(char)0xC3;
    116116    }
    117     else if(lstrcmp(name,"_System_GetSp")==0){
     117    else if( userProc.GetName() == "_System_GetSp" ){
    118118        //mov rax,rsp
    119119        op_mov_RR(REG_RAX,REG_RSP);
     
    125125        OpBuffer[obp++]=(char)0xC3;
    126126    }
    127     else if(lstrcmp(name,"_allrem")==0){
     127    else if( userProc.GetName() == "_allrem" ){
    128128        //乗除演算用の特殊関数(64ビット整数対応)
    129129        BYTE Buffer_allrem[]={
     
    134134        obp+=178;
    135135    }
    136     else if(lstrcmp(name,"_allmul")==0){
     136    else if( userProc.GetName() == "_allmul" ){
    137137        //乗算用の特殊関数(64ビット整数対応)
    138138        BYTE Buffer_allmul[]={
     
    143143        obp+=52;
    144144    }
    145     else if(lstrcmp(name,"_alldiv")==0){
     145    else if( userProc.GetName() == "_alldiv" ){
    146146        //除算用の特殊関数(64ビット整数対応)
    147147        BYTE Buffer_alldiv[]={
     
    152152        obp+=170;
    153153    }
    154     else if(lstrcmp(name,"_allshl")==0){
     154    else if( userProc.GetName() == "_allshl" ){
    155155        //符号あり左ビットシフト用の特殊関数(64ビット整数対応)
    156156        BYTE Buffer_allshl[]={
     
    161161        obp+=31;
    162162    }
    163     else if(lstrcmp(name,"_allshr")==0){
     163    else if( userProc.GetName() == "_allshr" ){
    164164        //符号あり右ビットシフト用の特殊関数(64ビット整数対応)
    165165        BYTE Buffer_allshr[]={
     
    170170        obp+=33;
    171171    }
    172     else if(lstrcmp(name,"_aullshr")==0){
     172    else if( userProc.GetName() == "_aullshr" ){
    173173        //符号なし右ビットシフト用の特殊関数(64ビット整数対応)
    174174        BYTE Buffer_aullshr[]={
     
    195195        obp+=31;
    196196    }
     197    else if( userProc.GetName() == "InitializeUserTypes" ){
     198    }
     199    else{
     200        SetError();
     201    }
    197202}
    198203void CompileBufferInProcedure(UserProc *pUserProc){
     
    240245        pobj_sf=new CStackFrame();
    241246
    242         SystemProc(pUserProc->GetName().c_str());
     247        SystemProc(*pUserProc);
    243248
    244249        //スタックフレーム管理用オブジェクトを破棄
  • BasicCompiler64/MakePeHdr.cpp

    r78 r86  
    2222    *pSub_System_GC_malloc_ForObject,
    2323    *pSub_System_GC_malloc_ForObjectPtr,
    24     *pSub_System_GC_free_for_SweepingDelete;
     24    *pSub_System_GC_free_for_SweepingDelete,
     25    *pSubStaticMethod_System_TypeBase_InitializeUserTypes;
    2526
    2627
     
    226227    if( pSub_System_GC_free_for_SweepingDelete = GetSubHash( "_System_GC_free_for_SweepingDelete",1 ) )
    227228        pSub_System_GC_free_for_SweepingDelete->Using();
     229
     230    if( pSubStaticMethod_System_TypeBase_InitializeUserTypes = GetSubHash( "_System_TypeBase.InitializeUserTypes",1 ) ){
     231        pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using();
     232        pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsSystemProc();
     233    }
    228234
    229235
Note: See TracChangeset for help on using the changeset viewer.