[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/byte-switch 086c4ea: * src/bytecode.c: (exec_byte_
From: |
Vibhav Pant |
Subject: |
[Emacs-diffs] feature/byte-switch 086c4ea: * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch |
Date: |
Wed, 18 Jan 2017 17:13:11 +0000 (UTC) |
branch: feature/byte-switch
commit 086c4eaf9d4ecc5074088115fa01c0b2fb061246
Author: Vibhav Pant <address@hidden>
Commit: Vibhav Pant <address@hidden>
* src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch
Fgethash type checks the provided table object, which is unnecessary
for compiled bytecode.
---
src/bytecode.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/bytecode.c b/src/bytecode.c
index 1695af9..fc434a2 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1417,8 +1417,10 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector,
Lisp_Object maxdepth,
{
Lisp_Object jmp_table = POP;
Lisp_Object v1 = POP;
- Lisp_Object dest = Fgethash(v1, jmp_table, Qnil);
- if (!NILP(dest)) {
+ struct Lisp_Hash_Table *h = XHASH_TABLE(jmp_table);
+ ptrdiff_t i = hash_lookup(h, v1, NULL);
+ if (i >= 0) {
+ Lisp_Object dest = HASH_VALUE(h, i);
int car = XINT(XCAR(dest));
int cdr = XINT(XCDR(dest));
op = car + (cdr << 8); /* Simulate FETCH2 */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] feature/byte-switch 086c4ea: * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch,
Vibhav Pant <=