[EFL][JSC] Enable udis86 disassembler on efl.

https://bugs.webkit.org/show_bug.cgi?id=125502

Patch by Tamas Gergely <tgergely.u-szeged@partner.samsung.com> on 2014-01-10
Reviewed by Michael Saboff.

Enable udis86 disassembler on efl and fix build warnings.

.:

* Source/cmake/OptionsEfl.cmake:
  Enable udis86 disassembler.

Source/JavaScriptCore:

* CMakeLists.txt:
  Add udis86 disassembler source files.
* disassembler/udis86/udis86_decode.c:
(decode_modrm_rm):
  Build warning fixes.
* disassembler/udis86/udis86_syn-att.c:
(gen_operand):
  Build warning fixes.
* disassembler/udis86/udis86_syn-intel.c:
(gen_operand):
  Build warning fixes.
* disassembler/udis86/udis86_types.h:
  Correct FMT64 for uint64_t.

Source/WTF:

* wtf/Platform.h:
  Enable udis86 disassembler on EFL.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2a63fbe2
2014-01-10 Tamas Gergely <tgergely.u-szeged@partner.samsung.com>
[EFL][JSC] Enable udis86 disassembler on efl.
https://bugs.webkit.org/show_bug.cgi?id=125502
Reviewed by Michael Saboff.
Enable udis86 disassembler on efl and fix build warnings.
* Source/cmake/OptionsEfl.cmake:
Enable udis86 disassembler.
2014-01-10 Benjamin Poulain <bpoulain@apple.com>
Remove the BlackBerry port from trunk
......
......@@ -498,6 +498,36 @@ if (WTF_USE_ICU_UNICODE)
)
endif ()
if (WTF_USE_UDIS86)
set(UDIS_GEN_DEP
disassembler/udis86/ud_opcode.py
disassembler/udis86/ud_optable.py
)
add_custom_command(
OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.c ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
DEPENDS ${UDIS_GEN_DEP}
WORKING_DIRECTORY ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
COMMAND ${PYTHON_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/disassembler/udis86/itab.py ${JAVASCRIPTCORE_DIR}/disassembler/udis86/optable.xml
VERBATIM)
list(APPEND JavaScriptCore_INCLUDE_DIRECTORIES
${JAVASCRIPTCORE_DIR}/disassembler/udis86
)
list(APPEND JavaScriptCore_HEADERS
${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/udis86_itab.h
)
list(APPEND JavaScriptCore_SOURCES
disassembler/udis86/udis86.c
disassembler/udis86/udis86_decode.c
disassembler/udis86/udis86_input.c
disassembler/udis86/udis86_itab_holder.c
disassembler/udis86/udis86_syn-att.c
disassembler/udis86/udis86_syn-intel.c
disassembler/udis86/udis86_syn.c
)
endif ()
if (ENABLE_LLINT)
# We cannot check for RUBY_FOUND because it is set only when the full package is installed and
# the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro
......
2014-01-10 Tamas Gergely <tgergely.u-szeged@partner.samsung.com>
[EFL][JSC] Enable udis86 disassembler on efl.
https://bugs.webkit.org/show_bug.cgi?id=125502
Reviewed by Michael Saboff.
Enable udis86 disassembler on efl and fix build warnings.
* CMakeLists.txt:
Add udis86 disassembler source files.
* disassembler/udis86/udis86_decode.c:
(decode_modrm_rm):
Build warning fixes.
* disassembler/udis86/udis86_syn-att.c:
(gen_operand):
Build warning fixes.
* disassembler/udis86/udis86_syn-intel.c:
(gen_operand):
Build warning fixes.
* disassembler/udis86/udis86_types.h:
Correct FMT64 for uint64_t.
2014-01-09 Benjamin Poulain <bpoulain@apple.com>
Remove the BlackBerry files outside WebCore
......
......@@ -459,6 +459,8 @@ decode_modrm_rm(struct ud *u,
rm = (REX_B(u->pfx_rex) << 3) | MODRM_RM(modrm(u));
reg = (REX_R(u->pfx_rex) << 3) | MODRM_REG(modrm(u));
UNUSED_PARAM(reg);
op->size = resolve_operand_size(u, size);
/*
......
......@@ -81,9 +81,9 @@ gen_operand(struct ud* u, struct ud_operand* op)
mkasm(u, "0x%x", op->lval.sdword);
} else if (op->offset == 64) {
if (op->lval.sdword < 0)
mkasm(u, "-0x" FMT64 "x", -op->lval.sqword);
mkasm(u, "-0x" FMT64 "x", (uint64_t)-op->lval.sqword);
else
mkasm(u, "0x" FMT64 "x", op->lval.sqword);
mkasm(u, "0x" FMT64 "x", (uint64_t)op->lval.sqword);
}
if (op->base)
......@@ -119,7 +119,7 @@ gen_operand(struct ud* u, struct ud_operand* op)
}
if ( sext_size < 64 )
sext_mask = ( 1ull << sext_size ) - 1;
mkasm( u, "$0x" FMT64 "x", imm & sext_mask );
mkasm( u, "$0x" FMT64 "x", (uint64_t)(imm & sext_mask) );
break;
}
......@@ -127,16 +127,16 @@ gen_operand(struct ud* u, struct ud_operand* op)
case UD_OP_JIMM:
switch (op->size) {
case 8:
mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sbyte);
mkasm(u, "0x" FMT64 "x", (uint64_t)(u->pc + op->lval.sbyte));
break;
case 16:
mkasm(u, "0x" FMT64 "x", (u->pc + op->lval.sword) & 0xffff );
mkasm(u, "0x" FMT64 "x", (uint64_t)((u->pc + op->lval.sword) & 0xffff) );
break;
case 32:
if (u->dis_mode == 32)
mkasm(u, "0x" FMT64 "x", (u->pc + op->lval.sdword) & 0xffffffff);
mkasm(u, "0x" FMT64 "x", (uint64_t)((u->pc + op->lval.sdword) & 0xffffffff));
else
mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sdword);
mkasm(u, "0x" FMT64 "x", (uint64_t)(u->pc + op->lval.sdword));
break;
default:break;
}
......
......@@ -106,7 +106,7 @@ static void gen_operand(struct ud* u, struct ud_operand* op, int syn_cast)
else mkasm(u, "%s0x%lx", (op_f) ? "+" : "", (unsigned long)op->lval.udword);
}
else if (op->offset == 64)
mkasm(u, "%s0x" FMT64 "x", (op_f) ? "+" : "", op->lval.uqword);
mkasm(u, "%s0x" FMT64 "x", (op_f) ? "+" : "", (uint64_t)op->lval.uqword);
mkasm(u, "]");
break;
......@@ -133,7 +133,7 @@ static void gen_operand(struct ud* u, struct ud_operand* op, int syn_cast)
}
if ( sext_size < 64 )
sext_mask = ( 1ull << sext_size ) - 1;
mkasm( u, "0x" FMT64 "x", imm & sext_mask );
mkasm( u, "0x" FMT64 "x", (uint64_t)(imm & sext_mask) );
break;
}
......@@ -143,13 +143,13 @@ static void gen_operand(struct ud* u, struct ud_operand* op, int syn_cast)
if (syn_cast) opr_cast(u, op);
switch (op->size) {
case 8:
mkasm(u, "0x" FMT64 "x", u->pc + op->lval.sbyte);
mkasm(u, "0x" FMT64 "x", (uint64_t)(u->pc + op->lval.sbyte));
break;
case 16:
mkasm(u, "0x" FMT64 "x", ( u->pc + op->lval.sword ) & 0xffff );
mkasm(u, "0x" FMT64 "x", (uint64_t)(( u->pc + op->lval.sword ) & 0xffff) );
break;
case 32:
mkasm(u, "0x" FMT64 "x", ( u->pc + op->lval.sdword ) & 0xfffffffful );
mkasm(u, "0x" FMT64 "x", (uint64_t)(( u->pc + op->lval.sdword ) & 0xfffffffful) );
break;
default:break;
}
......
......@@ -48,7 +48,11 @@
typedef __int32 int32_t;
typedef __int64 int64_t;
#else
# define FMT64 "%ll"
# if defined(__GNU_LIBRARY__) && defined(__WORDSIZE) && (__WORDSIZE == 64)
# define FMT64 "%l"
# else
# define FMT64 "%ll"
# endif
# ifndef __UD_STANDALONE__
# include <inttypes.h>
# endif /* __UD_STANDALONE__ */
......
2014-01-10 Tamas Gergely <tgergely.u-szeged@partner.samsung.com>
[EFL][JSC] Enable udis86 disassembler on efl.
https://bugs.webkit.org/show_bug.cgi?id=125502
Reviewed by Michael Saboff.
Enable udis86 disassembler on efl and fix build warnings.
* wtf/Platform.h:
Enable udis86 disassembler on EFL.
2014-01-10 Hunseop Jeong <hs85.jeong@samsung.com>
[EFL] Enable the DFG_JIT on ARMv7
......
......@@ -685,7 +685,7 @@
/* If possible, try to enable a disassembler. This is optional. We proceed in two
steps: first we try to find some disassembler that we can use, and then we
decide if the high-level disassembler API can be enabled. */
#if !defined(WTF_USE_UDIS86) && ENABLE(JIT) && PLATFORM(MAC) \
#if !defined(WTF_USE_UDIS86) && ENABLE(JIT) && (PLATFORM(MAC) || (PLATFORM(EFL) && OS(LINUX))) \
&& (CPU(X86) || CPU(X86_64))
#define WTF_USE_UDIS86 1
#endif
......
......@@ -30,6 +30,7 @@ find_package(LibSoup 2.42.0 REQUIRED)
set(WTF_USE_ICU_UNICODE 1)
set(WTF_USE_SOUP 1)
set(WTF_USE_UDIS86 1)
add_definitions(-DWTF_USE_GLIB=1)
add_definitions(-DWTF_USE_SOUP=1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment