mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
LuaJIT on Android fixes (#7094)
* Don't flag Android as should_restrict_JIT And allow disabling the C blitter, to put the workaround to the test... * Add a -d, --debug flag to the log function Catches KOReader's debug, as well as (our) dlopen & luajit logging * Bump android-luajit-launcher https://github.com/koreader/android-luajit-launcher/pull/283 https://github.com/koreader/android-luajit-launcher/pull/282 * Bump base (https://github.com/koreader/koreader-base/pull/1279)
This commit is contained in:
2
base
2
base
Submodule base updated: 7c1057f8e9...395936d256
@@ -355,7 +355,7 @@ function FileManagerMenu:setUpdateItemTable()
|
||||
end,
|
||||
})
|
||||
end
|
||||
if not (Device.should_restrict_JIT or Device:isAndroid()) then
|
||||
if not Device.should_restrict_JIT then
|
||||
local Blitbuffer = require("ffi/blitbuffer")
|
||||
table.insert(self.menu_items.developer_options.sub_item_table, {
|
||||
text = _("Disable C blitter"),
|
||||
|
||||
@@ -119,7 +119,9 @@ local Device = Generic:new{
|
||||
-- required for those modules where it *really* matters (e.g., ffi/blitbuffer.lua).
|
||||
-- This is also why we try to actually avoid entering actual loops in the Lua blitter on Android,
|
||||
-- and instead attempt to do most of everything via the C implementation.
|
||||
should_restrict_JIT = true,
|
||||
-- NOTE: Since https://github.com/koreader/android-luajit-launcher/pull/283, we've patched LuaJIT
|
||||
-- to ensure that the initial mcode alloc works, and sticks around, which is why this is no longer enabled.
|
||||
should_restrict_JIT = false,
|
||||
}
|
||||
|
||||
function Device:init()
|
||||
@@ -387,9 +389,9 @@ local function processEvents()
|
||||
if poll_state >= 0 then
|
||||
if source[0] ~= nil then
|
||||
if source[0].id == C.LOOPER_ID_MAIN then
|
||||
local cmd = C.android_app_read_cmd(android.app)
|
||||
C.android_app_pre_exec_cmd(android.app, cmd)
|
||||
C.android_app_post_exec_cmd(android.app, cmd)
|
||||
local cmd = android.glue.android_app_read_cmd(android.app)
|
||||
android.glue.android_app_pre_exec_cmd(android.app, cmd)
|
||||
android.glue.android_app_post_exec_cmd(android.app, cmd)
|
||||
elseif source[0].id == C.LOOPER_ID_INPUT then
|
||||
local event = ffi.new("AInputEvent*[1]")
|
||||
while android.lib.AInputQueue_getEvent(android.app.inputQueue, event) >= 0 do
|
||||
|
||||
56
kodev
56
kodev
@@ -1073,7 +1073,11 @@ OPTIONS:
|
||||
|
||||
function kodev-log() {
|
||||
LOG_HELP_MSG="
|
||||
usage: log <TARGET>
|
||||
usage: log <OPTIONS> <TARGET>
|
||||
|
||||
OPTIONS:
|
||||
|
||||
-d, --debug more verbose logs (e.g., debug builds)
|
||||
|
||||
TARGET:
|
||||
|
||||
@@ -1084,13 +1088,53 @@ TARGET:
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Defaults
|
||||
ignore_translation=0
|
||||
|
||||
declare opt
|
||||
declare -r E_OPTERR=85
|
||||
declare -r short_opts="dh"
|
||||
declare -r long_opts="debug, help"
|
||||
|
||||
if ! opt=$(getopt -o "${short_opts}" --long "${long_opts}" --name "kodev" -- "${@}"); then
|
||||
echo "${LOG_HELP_MSG}"
|
||||
exit ${E_OPTERR}
|
||||
fi
|
||||
|
||||
eval set -- "${opt}"
|
||||
|
||||
while true; do
|
||||
PARAM="${1}"
|
||||
# Support using an = assignment with short options (e.g., -f=blah instead of -f blah).
|
||||
VALUE="${2/#=/}"
|
||||
case "${PARAM}" in
|
||||
-d | --debug)
|
||||
export KODEBUG=1
|
||||
;;
|
||||
-h | --help)
|
||||
echo "${LOG_HELP_MSG}"
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: unknown option \"${PARAM}\""
|
||||
echo "${RELEASE_HELP_MSG}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
shift
|
||||
|
||||
case "${1}" in
|
||||
-h | --help)
|
||||
echo "${LOG_HELP_MSG}"
|
||||
exit 0
|
||||
;;
|
||||
android)
|
||||
adb logcat 'KOReader:I ActivityManager:* AndroidRuntime:* DEBUG:* *:F'
|
||||
if [ -n "${KODEBUG}" ]; then
|
||||
adb logcat 'KOReader:* ActivityManager:* AndroidRuntime:* DEBUG:* *:F dlopen:* LuaJIT:*'
|
||||
else
|
||||
adb logcat 'KOReader:I ActivityManager:* AndroidRuntime:* DEBUG:* *:F'
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported target: $1."
|
||||
|
||||
Submodule platform/android/luajit-launcher updated: 9099a388a0...af9b9d30c1
Reference in New Issue
Block a user