Source/JavaScriptCore/ChangeLog

 12016-07-29 Csaba Osztrogonác <ossy@webkit.org>
 2
 3 Lacking support on a arm-traditional disassembler.
 4 https://bugs.webkit.org/show_bug.cgi?id=123717
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * CMakeLists.txt:
 9 * disassembler/ARMLLVMDisassembler.cpp: Added, based on pre r196729 LLVMDisassembler, but it is ARM traditional only now.
 10 (JSC::tryToDisassemble):
 11
1122016-07-29 Yusuke Suzuki <utatane.tea@gmail.com>
213
314 Unreviewed, ByValInfo is only used in JIT enabled environments

Source/WTF/ChangeLog

 12016-07-29 Csaba Osztrogonác <ossy@webkit.org>
 2
 3 Lacking support on a arm-traditional disassembler.
 4 https://bugs.webkit.org/show_bug.cgi?id=123717
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * wtf/Platform.h:
 9
1102016-07-28 Mark Lam <mark.lam@apple.com>
211
312 StringView should have an explicit m_is8Bit field.

Source/JavaScriptCore/CMakeLists.txt

@@set(JavaScriptCore_SOURCES
383383 dfg/DFGWorklist.cpp
384384
385385 disassembler/ARM64Disassembler.cpp
 386 disassembler/ARMLLVMDisassembler.cpp
386387 disassembler/ARMv7Disassembler.cpp
387388 disassembler/Disassembler.cpp
388389 disassembler/UDis86Disassembler.cpp

@@set(JavaScriptCore_OBJECT_LUT_SOURCES
893894set(JavaScriptCore_LIBRARIES
894895 WTF${DEBUG_SUFFIX}
895896 ${ICU_I18N_LIBRARIES}
 897 ${LLVM_LIBRARIES}
896898)
897899
898900set(JavaScriptCore_SCRIPTS_SOURCES_DIR "${JAVASCRIPTCORE_DIR}/Scripts")

Source/JavaScriptCore/disassembler/ARMLLVMDisassembler.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "Disassembler.h"
 28
 29#if USE(ARM_LLVM_DISASSEMBLER)
 30
 31#include "MacroAssemblerCodeRef.h"
 32#include <llvm-c/Disassembler.h>
 33#include <llvm-c/Target.h>
 34
 35namespace JSC {
 36
 37bool tryToDisassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out)
 38{
 39 LLVMInitializeAllTargetInfos();
 40 LLVMInitializeAllTargetMCs();
 41 LLVMInitializeAllDisassemblers();
 42
 43 const char* triple = "armv7-unknown-linux-gnueabihf";
 44 LLVMDisasmContextRef disassemblyContext = LLVMCreateDisasm(triple, 0, 0, 0, 0);
 45
 46 RELEASE_ASSERT(disassemblyContext);
 47
 48 char pcString[20];
 49 char instructionString[100];
 50
 51 uint8_t* pc = static_cast<uint8_t*>(codePtr.executableAddress());
 52 uint8_t* end = pc + size;
 53
 54 while (pc < end) {
 55 snprintf(
 56 pcString, sizeof(pcString), "0x%lx",
 57 static_cast<unsigned long>(bitwise_cast<uintptr_t>(pc)));
 58
 59 size_t instructionSize = LLVMDisasmInstruction(
 60 disassemblyContext, pc, end - pc, bitwise_cast<uintptr_t>(pc),
 61 instructionString, sizeof(instructionString));
 62
 63 if (!instructionSize)
 64 snprintf(instructionString, sizeof(instructionString), "unknown instruction");
 65
 66 out.printf("%s%16s: [0x%08lx] %s\n", prefix, pcString, *(static_cast<unsigned long*>(pc)), instructionString);
 67 pc += 4;
 68 }
 69
 70 LLVMDisasmDispose(disassemblyContext);
 71 return true;
 72}
 73
 74} // namespace JSC
 75
 76#endif // USE(ARM_LLVM_DISASSEMBLER)

Source/WTF/wtf/Platform.h

743743#define USE_ARMV7_DISASSEMBLER 1
744744#endif
745745
746 #if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARMV7_DISASSEMBLER) || USE(ARM64_DISASSEMBLER))
 746#if !defined(USE_ARM_LLVM_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM_TRADITIONAL) && HAVE(LLVM)
 747#define USE_ARM_LLVM_DISASSEMBLER 1
 748#endif
 749
 750#if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARMV7_DISASSEMBLER) || USE(ARM64_DISASSEMBLER) || USE(ARM_LLVM_DISASSEMBLER))
747751#define ENABLE_DISASSEMBLER 1
748752#endif
749753

Source/cmake/FindLLVM.cmake

 1#
 2# Check if the llvm-config gives us the path for the llvm libs.
 3#
 4# The following variables are set:
 5# LLVM_CONFIG_EXE
 6# LLVM_VERSION
 7# LLVM_INCLUDE_DIRS - include directories for the llvm headers.
 8# LLVM_STATIC_LIBRARIES - list of paths for the static llvm libraries.
 9
 10
 11foreach (_program_name llvm-config llvm-config-3.7 llvm-config-3.6 llvm-config-3.5)
 12 find_program(LLVM_CONFIG_EXE NAMES ${_program_name})
 13 if (LLVM_CONFIG_EXE)
 14 execute_process(COMMAND ${LLVM_CONFIG_EXE} --version OUTPUT_VARIABLE LLVM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
 15 if ("${LLVM_VERSION}" VERSION_LESS "${LLVM_FIND_VERSION}")
 16 unset(LLVM_CONFIG_EXE CACHE)
 17 else ()
 18 break ()
 19 endif ()
 20 endif ()
 21endforeach ()
 22
 23execute_process(COMMAND ${LLVM_CONFIG_EXE} --includedir OUTPUT_VARIABLE LLVM_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE)
 24execute_process(COMMAND ${LLVM_CONFIG_EXE} --libfiles OUTPUT_VARIABLE LLVM_STATIC_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
 25execute_process(COMMAND ${LLVM_CONFIG_EXE} --system-libs OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
 26execute_process(COMMAND ${LLVM_CONFIG_EXE} --libdir OUTPUT_VARIABLE LLVM_LIBS_DIRECTORY OUTPUT_STRIP_TRAILING_WHITESPACE)
 27execute_process(COMMAND ${LLVM_CONFIG_EXE} --libs OUTPUT_VARIABLE LLVM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
 28execute_process(COMMAND ${LLVM_CONFIG_EXE} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
 29
 30# Depending on how llvm was built, we could have either a global .so file when built using autotools,
 31# or multiple .so files for each static library when built using CMake. So, we set the LLVM_LIBS_DIRECTORY
 32# variable here accordingly for each case.
 33# We need to build the soname manually in any case, since there's currently no way to get it from llvm-config.
 34set(LLVM_SONAME "LLVM-${LLVM_VERSION}")
 35if (EXISTS "${LLVM_LIBS_DIRECTORY}/lib${LLVM_SONAME}.so")
 36 set(LLVM_LIBRARIES "${LLVM_LDFLAGS} -l${LLVM_SONAME}")
 37else ()
 38 set(LLVM_LIBRARIES "${LLVM_LDFLAGS} ${LLVM_LIBS}")
 39endif ()
 40
 41# convert the list of paths into a cmake list
 42separate_arguments(LLVM_STATIC_LIBRARIES)
 43
 44include(FindPackageHandleStandardArgs)
 45find_package_handle_standard_args(LLVM
 46 REQUIRED_VARS LLVM_VERSION LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_STATIC_LIBRARIES
 47 VERSION_VAR LLVM_VERSION)
 48
 49mark_as_advanced(LLVM_VERSION LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_STATIC_LIBRARIES)

Source/cmake/OptionsCommon.cmake

@@if (UNIX AND NOT APPLE AND NOT ENABLED_COMPILER_SANITIZERS)
144144 set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
145145endif ()
146146
 147if (USE_ARM_LLVM_DISASSEMBLER)
 148 find_package(LLVM REQUIRED)
 149 SET_AND_EXPOSE_TO_BUILD(HAVE_LLVM TRUE)
 150endif ()
 151
147152# Enable the usage of OpenMP.
148153# - At this moment, OpenMP is only used as an alternative implementation
149154# to native threads for the parallelization of the SVG filters.

ChangeLog

 12016-07-29 Csaba Osztrogonác <ossy@webkit.org>
 2
 3 Lacking support on a arm-traditional disassembler.
 4 https://bugs.webkit.org/show_bug.cgi?id=123717
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * Source/cmake/FindLLVM.cmake: Added back the r196749 state.
 9 * Source/cmake/OptionsCommon.cmake: Added back the r196749 state.
 10
1112016-07-27 Carlos Garcia Campos <cgarcia@igalia.com>
212
313 Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.4 release.