Skip to content

Commit

Permalink
Further work on the deemon-to-x86 compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
GrieferAtWork committed Dec 19, 2023
1 parent 39fb273 commit 15ca3c6
Show file tree
Hide file tree
Showing 16 changed files with 3,796 additions and 3,310 deletions.
2 changes: 2 additions & 0 deletions .vs/dex/_hostasm.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
<ClCompile Include="..\..\src\dex\_hostasm\common.c" />
<ClCompile Include="..\..\src\dex\_hostasm\generator-arch.c" />
<ClCompile Include="..\..\src\dex\_hostasm\generator-common.c" />
<ClCompile Include="..\..\src\dex\_hostasm\generator-deemon.c" />
<ClCompile Include="..\..\src\dex\_hostasm\generator-vstack.c" />
<ClCompile Include="..\..\src\dex\_hostasm\libhostasm.c" />
<ClCompile Include="..\..\src\dex\_hostasm\loader.c" />
<ClCompile Include="..\..\src\dex\_hostasm\memstate.c" />
Expand Down
2 changes: 2 additions & 0 deletions .vs/dex/_hostasm.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<ClCompile Include="..\..\src\dex\_hostasm\common.c" />
<ClCompile Include="..\..\src\dex\_hostasm\generator-arch.c" />
<ClCompile Include="..\..\src\dex\_hostasm\generator-common.c" />
<ClCompile Include="..\..\src\dex\_hostasm\generator-deemon.c" />
<ClCompile Include="..\..\src\dex\_hostasm\generator-vstack.c" />
<ClCompile Include="..\..\src\dex\_hostasm\libhostasm.c" />
<ClCompile Include="..\..\src\dex\_hostasm\loader.c" />
<ClCompile Include="..\..\src\dex\_hostasm\memstate.c" />
Expand Down
4 changes: 2 additions & 2 deletions include/deemon/asm.h
Original file line number Diff line number Diff line change
Expand Up @@ -912,11 +912,11 @@
#define ASM_CONTAINS 0xb0 /* [1][-2,+1] `contains top, pop' - Pop an Object and invoke the __contains__ operator on stack-top. */
#define ASM_CONTAINS_C 0xb1 /* [2][-1,+1] `push contains const <imm8>, pop' - Pop an Object and check if it is contained within a sequence found int the given constant (which is usually a read-only HashSet). */
#define ASM_GETITEM 0xb2 /* [1][-2,+1] `getitem top, pop' - Pop a key/index and invoke the __getitem__ operator on stack-top. */
#define ASM_GETITEM_I 0xb3 /* [3][-1,+1] `getitem top, $<Simm16>' - Invoke the __getitem__ operator on stack-top, using an int <Simm16> (little-endian) as index. */
#define ASM_GETITEM_I 0xb3 /* [3][-1,+1] `getitem top, $<imm16>' - Invoke the __getitem__ operator on stack-top, using an int <imm16> (little-endian) as index. */
#define ASM_GETITEM_C 0xb4 /* [2][-1,+1] `getitem top, const <imm8>' - Invoke the __getitem__ operator on stack-top, using constant slot `<imm8>' as key. */
#define ASM_GETSIZE 0xb5 /* [1][-1,+1] `getsize top' - Invoke the __size__ operator on stack-top. */
#define ASM_SETITEM 0xb6 /* [1][-3,+0] `setitem pop, pop, pop' - Pop a value, a key/index and invoke the __setitem__ operator on stack-top. */
#define ASM_SETITEM_I 0xb7 /* [3][-2,+0] `setitem pop, $<Simm16>, pop' - Pop a value and invoke the __setitem__ operator on stack-top, using an int <Simm16> (little-endian) as index. */
#define ASM_SETITEM_I 0xb7 /* [3][-2,+0] `setitem pop, $<imm16>, pop' - Pop a value and invoke the __setitem__ operator on stack-top, using an int <imm16> (little-endian) as index. */
#define ASM_SETITEM_C 0xb8 /* [2][-2,+0] `setitem pop, const <imm8>, pop' - Pop a value and invoke the __setitem__ operator on stack-top, using constant slot `<imm8>' as key. */
#define ASM_ITERSELF 0xb9 /* [1][-1,+1] `iterself top' - Replace stack-top with an iterator of itself. */
#define ASM_DELITEM 0xba /* [1][-2,+0] `delitem pop, pop' - Pop a key/index and invoke the __delitem__ operator on stack-top. */
Expand Down
4 changes: 2 additions & 2 deletions src/deemon/execute/code-exec.c.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2987,7 +2987,7 @@ do_contains_c:

TARGET(ASM_GETITEM_I, -1, +1) {
DREF DeeObject *value;
value = DeeObject_GetItemIndex(TOP, READ_Simm16());
value = DeeObject_GetItemIndex(TOP, READ_imm16());
if unlikely(!value)
HANDLE_EXCEPT();
Dee_Decref(TOP);
Expand Down Expand Up @@ -3031,7 +3031,7 @@ do_getitem_c:
}

TARGET(ASM_SETITEM_I, -2, +0) {
if (DeeObject_SetItemIndex(SECOND, READ_Simm16(), FIRST))
if (DeeObject_SetItemIndex(SECOND, READ_imm16(), FIRST))
HANDLE_EXCEPT();
POPREF();
POPREF();
Expand Down
Loading

0 comments on commit 15ca3c6

Please sign in to comment.