removed the old heap setting code for arrays
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40136
This commit is contained in:
parent
5b9ba35f0f
commit
fca7456f4d
@ -993,23 +993,22 @@ inline void WriteOp_GenArray(JitWriter *jit, bool autozero)
|
|||||||
//mov edx, [esi+info.heap]
|
//mov edx, [esi+info.heap]
|
||||||
//mov ecx, [edi]
|
//mov ecx, [edi]
|
||||||
//mov [edi], edx ;store base of array into stack
|
//mov [edi], edx ;store base of array into stack
|
||||||
//lea edx, [edx+ecx*4+4] ;get the final new heap pointer
|
//lea edx, [edx+ecx*4] ;get the final new heap pointer
|
||||||
//mov [esi+info.heap], edx ;store heap pointer back
|
//mov [esi+info.heap], edx ;store heap pointer back
|
||||||
//add edx, ebp ;relocate
|
//add edx, ebp ;relocate
|
||||||
//cmp edx, edi ;compare against stack pointer
|
//cmp edx, edi ;compare against stack pointer
|
||||||
//jae :error ;error out if not enough space
|
//jae :error ;error out if not enough space
|
||||||
//shl ecx, 2
|
|
||||||
//mov [edx-4], ecx ;store # of cells allocated
|
|
||||||
IA32_Mov_Reg_Rm_Disp8(jit, AMX_REG_ALT, AMX_REG_INFO, AMX_INFO_HEAP);
|
IA32_Mov_Reg_Rm_Disp8(jit, AMX_REG_ALT, AMX_REG_INFO, AMX_INFO_HEAP);
|
||||||
IA32_Mov_Reg_Rm(jit, AMX_REG_TMP, AMX_REG_STK, MOD_MEM_REG);
|
IA32_Mov_Reg_Rm(jit, AMX_REG_TMP, AMX_REG_STK, MOD_MEM_REG);
|
||||||
IA32_Mov_Rm_Reg(jit, AMX_REG_STK, AMX_REG_ALT, MOD_MEM_REG);
|
IA32_Mov_Rm_Reg(jit, AMX_REG_STK, AMX_REG_ALT, MOD_MEM_REG);
|
||||||
IA32_Lea_Reg_DispRegMultImm8(jit, AMX_REG_ALT, AMX_REG_ALT, AMX_REG_TMP, SCALE4, 4);
|
IA32_Lea_Reg_DispRegMult(jit, AMX_REG_ALT, AMX_REG_ALT, AMX_REG_TMP, SCALE4);
|
||||||
IA32_Mov_Rm_Reg_Disp8(jit, AMX_REG_INFO, AMX_REG_ALT, AMX_INFO_HEAP);
|
IA32_Mov_Rm_Reg_Disp8(jit, AMX_REG_INFO, AMX_REG_ALT, AMX_INFO_HEAP);
|
||||||
IA32_Add_Rm_Reg(jit, AMX_REG_ALT, AMX_REG_DAT, MOD_REG);
|
IA32_Add_Rm_Reg(jit, AMX_REG_ALT, AMX_REG_DAT, MOD_REG);
|
||||||
IA32_Cmp_Rm_Reg(jit, AMX_REG_ALT, AMX_REG_STK, MOD_REG);
|
IA32_Cmp_Rm_Reg(jit, AMX_REG_ALT, AMX_REG_STK, MOD_REG);
|
||||||
IA32_Jump_Cond_Imm32_Abs(jit, CC_AE, ((CompData *)jit->data)->jit_error_heaplow);
|
IA32_Jump_Cond_Imm32_Abs(jit, CC_AE, ((CompData *)jit->data)->jit_error_heaplow);
|
||||||
IA32_Shl_Rm_Imm8(jit, AMX_REG_TMP, 4, MOD_REG);
|
|
||||||
IA32_Mov_Rm_Reg_Disp8(jit, AMX_REG_ALT, AMX_REG_TMP, -4);
|
/* :TODO: PUSH ECX ONTO TRACKER */
|
||||||
|
|
||||||
if (autozero)
|
if (autozero)
|
||||||
{
|
{
|
||||||
/* Zero out the array - inline a quick fill */
|
/* Zero out the array - inline a quick fill */
|
||||||
|
@ -538,14 +538,14 @@ void WriteIntrinsic_GenArray(JitWriter *jit)
|
|||||||
|
|
||||||
/* Test if we have heap space for this */
|
/* Test if we have heap space for this */
|
||||||
//mov eax, [esi+info.heap] ;get heap pointer
|
//mov eax, [esi+info.heap] ;get heap pointer
|
||||||
//lea eax, [eax+edx*4+4] ;new heap pointer
|
//lea eax, [eax+edx*4] ;new heap pointer
|
||||||
//cmp eax, <hlw> ;compare to heap low
|
//cmp eax, <hlw> ;compare to heap low
|
||||||
//jbe :error ;die if we hit this (it should always be >)
|
//jbe :error ;die if we hit this (it should always be >)
|
||||||
//add eax, ebp ;relocate to stack
|
//add eax, ebp ;relocate to stack
|
||||||
//cmp eax, edi ;die if above the stack pointer
|
//cmp eax, edi ;die if above the stack pointer
|
||||||
//jae :error
|
//jae :error
|
||||||
IA32_Mov_Reg_Rm_Disp8(jit, REG_EAX, AMX_REG_INFO, AMX_INFO_HEAP);
|
IA32_Mov_Reg_Rm_Disp8(jit, REG_EAX, AMX_REG_INFO, AMX_INFO_HEAP);
|
||||||
IA32_Lea_Reg_DispRegMultImm8(jit, REG_EAX, REG_EAX, REG_EDX, SCALE4, 4);
|
IA32_Lea_Reg_DispRegMult(jit, REG_EAX, REG_EAX, REG_EDX, SCALE4);
|
||||||
IA32_Cmp_Rm_Imm32(jit, MOD_REG, REG_EAX, ((CompData *)jit->data)->plugin->data_size);
|
IA32_Cmp_Rm_Imm32(jit, MOD_REG, REG_EAX, ((CompData *)jit->data)->plugin->data_size);
|
||||||
IA32_Jump_Cond_Imm32_Abs(jit, CC_BE, ((CompData *)jit->data)->jit_error_array_too_big);
|
IA32_Jump_Cond_Imm32_Abs(jit, CC_BE, ((CompData *)jit->data)->jit_error_array_too_big);
|
||||||
IA32_Add_Rm_Reg(jit, REG_EAX, AMX_REG_DAT, MOD_REG);
|
IA32_Add_Rm_Reg(jit, REG_EAX, AMX_REG_DAT, MOD_REG);
|
||||||
@ -554,17 +554,15 @@ void WriteIntrinsic_GenArray(JitWriter *jit)
|
|||||||
|
|
||||||
/* Prepare for indirection iteration */
|
/* Prepare for indirection iteration */
|
||||||
//mov eax, [esi+info.heap] ;get heap pointer
|
//mov eax, [esi+info.heap] ;get heap pointer
|
||||||
//lea ebx, [eax+edx*4+4] ;new heap pointer
|
//lea ebx, [eax+edx*4] ;new heap pointer
|
||||||
//mov [esi+info.heap], ebx ;store back
|
//mov [esi+info.heap], ebx ;store back
|
||||||
//lea ebx, [ebp+ebx-4] ;relocate
|
|
||||||
//mov [ebx], edx ;store back total size
|
|
||||||
//push eax ;save heap pointer - we need it
|
//push eax ;save heap pointer - we need it
|
||||||
IA32_Mov_Reg_Rm_Disp8(jit, REG_EAX, AMX_REG_INFO, AMX_INFO_HEAP);
|
IA32_Mov_Reg_Rm_Disp8(jit, REG_EAX, AMX_REG_INFO, AMX_INFO_HEAP);
|
||||||
IA32_Lea_Reg_DispRegMultImm8(jit, REG_EBX, REG_EAX, REG_EDX, SCALE4, 4);
|
IA32_Lea_Reg_DispRegMult(jit, REG_EBX, REG_EAX, REG_EDX, SCALE4);
|
||||||
IA32_Mov_Rm_Reg_Disp8(jit, AMX_REG_INFO, REG_EBX, AMX_INFO_HEAP);
|
IA32_Mov_Rm_Reg_Disp8(jit, AMX_REG_INFO, REG_EBX, AMX_INFO_HEAP);
|
||||||
IA32_Lea_Reg_DispRegMultImm8(jit, REG_EBX, AMX_REG_DAT, REG_EBX, NOSCALE, -4);
|
|
||||||
IA32_Mov_Rm_Reg(jit, REG_EBX, REG_EDX, MOD_MEM_REG);
|
|
||||||
IA32_Push_Reg(jit, REG_EAX);
|
IA32_Push_Reg(jit, REG_EAX);
|
||||||
|
|
||||||
|
/* :TODO: Push EDX into tracker */
|
||||||
|
|
||||||
/* This part is too messy to do in straight assembly.
|
/* This part is too messy to do in straight assembly.
|
||||||
* I'm letting the compiler handle it and thus it's in C.
|
* I'm letting the compiler handle it and thus it's in C.
|
||||||
|
Loading…
Reference in New Issue
Block a user