[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 174/437: Correct off by one label/note name and add alig
From: |
Andy Wingo |
Subject: |
[Guile-commits] 174/437: Correct off by one label/note name and add align argument to jit_data |
Date: |
Mon, 2 Jul 2018 05:14:12 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 39afbe1c40209dc65290c136e62bdbdaef7aea9b
Author: pcpa <address@hidden>
Date: Mon Jan 14 14:43:54 2013 -0200
Correct off by one label/note name and add align argument to jit_data
2013-01-14 Paulo Andrade <address@hidden>
* include/lightning.h, lib/lightning.c: Add an extra align
argument to the jit_data call (that should be made private),
so that it should not align strings at 8 bytes.
Correct the jit_note call to include the null ending byte
when adding label/note names to the "jit data section".
---
ChangeLog | 8 ++++++++
include/lightning.h | 5 +++--
lib/lightning.c | 17 ++++++++++-------
3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e738193..942b325 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-01-14 Paulo Andrade <address@hidden>
+
+ * include/lightning.h, lib/lightning.c: Add an extra align
+ argument to the jit_data call (that should be made private),
+ so that it should not align strings at 8 bytes.
+ Correct the jit_note call to include the null ending byte
+ when adding label/note names to the "jit data section".
+
2013-01-11 Paulo Andrade <address@hidden>
* lib/jit_note.c: New file implementing a simple string+integer
diff --git a/include/lightning.h b/include/lightning.h
index 41c83fa..442a8a8 100644
--- a/include/lightning.h
+++ b/include/lightning.h
@@ -99,7 +99,7 @@ typedef struct jit_node jit_node_t;
typedef struct jit_state jit_state_t;
typedef enum {
-#define jit_data(u,v) _jit_data(_jit,u,v)
+#define jit_data(u,v,w) _jit_data(_jit,u,v,w)
jit_code_data,
jit_code_save, jit_code_load,
#define jit_note(u, v) _jit_note(_jit, u, v)
@@ -739,7 +739,8 @@ extern jit_state_t *jit_new_state(void);
#define jit_address(node) _jit_address(_jit, node)
extern jit_pointer_t _jit_address(jit_state_t*, jit_node_t*);
-extern jit_node_t *_jit_data(jit_state_t*, jit_pointer_t, jit_word_t);
+extern jit_node_t *_jit_data(jit_state_t*, jit_pointer_t,
+ jit_word_t, jit_int32_t);
extern jit_node_t *_jit_note(jit_state_t*, char*, int);
extern jit_node_t *_jit_label(jit_state_t*);
extern jit_node_t *_jit_forward(jit_state_t*);
diff --git a/lib/lightning.c b/lib/lightning.c
index 62cfea4..baad608 100644
--- a/lib/lightning.c
+++ b/lib/lightning.c
@@ -326,7 +326,8 @@ _jit_address(jit_state_t *_jit, jit_node_t *node)
}
jit_node_t *
-_jit_data(jit_state_t *_jit, jit_pointer_t data, jit_word_t length)
+_jit_data(jit_state_t *_jit, jit_pointer_t data,
+ jit_word_t length, jit_int32_t align)
{
jit_word_t key;
jit_node_t *node;
@@ -361,7 +362,9 @@ _jit_data(jit_state_t *_jit, jit_pointer_t data, jit_word_t
length)
if (!node) {
node = jit_new_node_no_link(jit_code_data);
- switch (length) {
+ if (!align)
+ align = length;
+ switch (align) {
case 0: case 1:
break;
case 2:
@@ -419,7 +422,7 @@ _jit_note(jit_state_t *_jit, char *name, int line)
node = new_node(jit_code_note);
if (name)
- node->v.n = jit_data(name, strlen(name));
+ node->v.n = jit_data(name, strlen(name) + 1, 1);
else
node->v.p = NULL;
node->w.w = line;
@@ -1112,19 +1115,19 @@ _jit_optimize(jit_state_t *_jit)
mask = jit_classify(node->code);
#if JIT_HASH_CONSTS
if (mask & jit_cc_a1_flt) {
- node->v.p = jit_data(&node->v.f, sizeof(jit_float32_t));
+ node->v.p = jit_data(&node->v.f, sizeof(jit_float32_t), 4);
node->flag |= jit_flag_node | jit_flag_data;
}
else if (mask & jit_cc_a1_dbl) {
- node->v.p = jit_data(&node->v.d, sizeof(jit_float64_t));
+ node->v.p = jit_data(&node->v.d, sizeof(jit_float64_t), 8);
node->flag |= jit_flag_node | jit_flag_data;
}
else if (mask & jit_cc_a2_flt) {
- node->w.p = jit_data(&node->w.f, sizeof(jit_float32_t));
+ node->w.p = jit_data(&node->w.f, sizeof(jit_float32_t), 4);
node->flag |= jit_flag_node | jit_flag_data;
}
else if (mask & jit_cc_a2_dbl) {
- node->w.p = jit_data(&node->w.d, sizeof(jit_float64_t));
+ node->w.p = jit_data(&node->w.d, sizeof(jit_float64_t), 8);
node->flag |= jit_flag_node | jit_flag_data;
}
#endif
- [Guile-commits] 339/437: ARM: Correct constants offset check, (continued)
- [Guile-commits] 339/437: ARM: Correct constants offset check, Andy Wingo, 2018/07/02
- [Guile-commits] 309/437: Do not fail if NULL is passed to init_jit., Andy Wingo, 2018/07/02
- [Guile-commits] 225/437: Second alpha release 1.99a, Andy Wingo, 2018/07/02
- [Guile-commits] 243/437: IA64: Correct code to save/restore r2 used as lightning JIT_FP., Andy Wingo, 2018/07/02
- [Guile-commits] 348/437: S390: Replace s390x filenames with s390, Andy Wingo, 2018/07/02
- [Guile-commits] 376/437: Correct update of on stack vararg double argument pointer, Andy Wingo, 2018/07/02
- [Guile-commits] 378/437: arm: Add initial jit_va_ calls to arm, Andy Wingo, 2018/07/02
- [Guile-commits] 387/437: alpha: Add initial jit_va_ calls to alpha, Andy Wingo, 2018/07/02
- [Guile-commits] 263/437: ARM: Correct wrong offset for load/store of floats., Andy Wingo, 2018/07/02
- [Guile-commits] 317/437: Add the new "range" test., Andy Wingo, 2018/07/02
- [Guile-commits] 174/437: Correct off by one label/note name and add align argument to jit_data,
Andy Wingo <=
- [Guile-commits] 279/437: Implement and document the new jit_indirect call., Andy Wingo, 2018/07/02
- [Guile-commits] 143/437: Correct testcases in the mips backend., Andy Wingo, 2018/07/02
- [Guile-commits] 322/437: Add assertion to check for register allocation leaks, Andy Wingo, 2018/07/02
- [Guile-commits] 257/437: Correct misplaced check for already visited blocks, Andy Wingo, 2018/07/02
- [Guile-commits] 301/437: GNU lightning 2.0.5 release, Andy Wingo, 2018/07/02
- [Guile-commits] 206/437: Correct jit implementation to pass several test cases., Andy Wingo, 2018/07/02
- [Guile-commits] 297/437: Do not filter -sz.c files in gitignore, Andy Wingo, 2018/07/02
- [Guile-commits] 255/437: IA64: Force sync of instructions in get-jit-size build mode., Andy Wingo, 2018/07/02
- [Guile-commits] 306/437: x86: Build and pass all tests under cygwin64 (Windows x64), Andy Wingo, 2018/07/02
- [Guile-commits] 352/437: Update documentation, Andy Wingo, 2018/07/02