guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 02/14: Add flag bits to the jit_reloc_kind enum


From: Andy Wingo
Subject: [Guile-commits] 02/14: Add flag bits to the jit_reloc_kind enum
Date: Fri, 12 Jun 2020 10:18:41 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 297ae99c3f1959f387f59da535eb68f34ae523fe
Author: Icecream95 <ixn@keemail.me>
AuthorDate: Mon Apr 6 16:04:57 2020 +1200

    Add flag bits to the jit_reloc_kind enum
---
 lightening.h            | 2 ++
 lightening/lightening.c | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lightening.h b/lightening.h
index bcf2032..4749723 100644
--- a/lightening.h
+++ b/lightening.h
@@ -91,6 +91,8 @@ enum jit_reloc_kind
   JIT_RELOC_JCC_WITH_VENEER,
   JIT_RELOC_LOAD_FROM_POOL,
 #endif
+  JIT_RELOC_MASK = 15,
+  JIT_RELOC_FLAG_0 = 16,
 };
 
 typedef struct jit_reloc
diff --git a/lightening/lightening.c b/lightening/lightening.c
index ca5708f..8d4c3d7 100644
--- a/lightening/lightening.c
+++ b/lightening/lightening.c
@@ -379,7 +379,7 @@ jit_patch_there(jit_state_t* _jit, jit_reloc_t reloc, 
jit_pointer_t addr)
   ASSERT((diff & ((1 << reloc.rsh) - 1)) == 0);
   diff >>= reloc.rsh;
 
-  switch (reloc.kind)
+  switch (reloc.kind & JIT_RELOC_MASK)
     {
     case JIT_RELOC_ABSOLUTE:
       if (sizeof(diff) == 4)
@@ -1365,7 +1365,7 @@ emit_literal_pool(jit_state_t *_jit, enum guard_pool 
guard)
     if (_jit->overflow)
       return;
 
-    switch (entry->reloc.kind) {
+    switch (entry->reloc.kind & JIT_RELOC_MASK) {
     case JIT_RELOC_JMP_WITH_VENEER:
       patch_jmp_offset((uint32_t*) loc, diff);
       emit_veneer(_jit, (void*) (uintptr_t) entry->value);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]