Skip to content

Commit e08ae5a

Browse files
authored
Merge pull request #462 from PatriceJiang/v4-use-latest-luajit
[v4] cocos2d-console update to Luajit 2.1 latest (#461)
2 parents bb2c1df + a062173 commit e08ae5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3460
-824
lines changed

plugins/plugin_luacompile/bin/32bit/jit/bc.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
----------------------------------------------------------------------------
22
-- LuaJIT bytecode listing module.
33
--
4-
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
4+
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
55
-- Released under the MIT license. See Copyright Notice in luajit.h
66
----------------------------------------------------------------------------
77
--

plugins/plugin_luacompile/bin/32bit/jit/bcsave.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
----------------------------------------------------------------------------
22
-- LuaJIT module to save/list bytecode.
33
--
4-
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
4+
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
55
-- Released under the MIT license. See Copyright Notice in luajit.h
66
----------------------------------------------------------------------------
77
--
@@ -63,8 +63,8 @@ local map_type = {
6363
}
6464

6565
local map_arch = {
66-
x86 = true, x64 = true, arm = true, arm64 = true, ppc = true,
67-
mips = true, mipsel = true,
66+
x86 = true, x64 = true, arm = true, arm64 = true, arm64be = true,
67+
ppc = true, mips = true, mipsel = true,
6868
}
6969

7070
local map_os = {
@@ -125,12 +125,12 @@ extern "C"
125125
#ifdef _WIN32
126126
__declspec(dllexport)
127127
#endif
128-
const char %s%s[] = {
128+
const unsigned char %s%s[] = {
129129
]], LJBC_PREFIX, ctx.modname))
130130
else
131131
fp:write(string.format([[
132132
#define %s%s_SIZE %d
133-
static const char %s%s[] = {
133+
static const unsigned char %s%s[] = {
134134
]], LJBC_PREFIX, ctx.modname, #s, LJBC_PREFIX, ctx.modname))
135135
end
136136
local t, n, m = {}, 0, 0
@@ -200,7 +200,7 @@ typedef struct {
200200
]]
201201
local symname = LJBC_PREFIX..ctx.modname
202202
local is64, isbe = false, false
203-
if ctx.arch == "x64" or ctx.arch == "arm64" then
203+
if ctx.arch == "x64" or ctx.arch == "arm64" or ctx.arch == "arm64be" then
204204
is64 = true
205205
elseif ctx.arch == "ppc" or ctx.arch == "mips" then
206206
isbe = true
@@ -237,9 +237,9 @@ typedef struct {
237237
hdr.eendian = isbe and 2 or 1
238238
hdr.eversion = 1
239239
hdr.type = f16(1)
240-
hdr.machine = f16(({ x86=3, x64=62, arm=40, arm64=183, ppc=20, mips=8, mipsel=8 })[ctx.arch])
240+
hdr.machine = f16(({ x86=3, x64=62, arm=40, arm64=183, arm64be=183, ppc=20, mips=8, mipsel=8 })[ctx.arch])
241241
if ctx.arch == "mips" or ctx.arch == "mipsel" then
242-
hdr.flags = 0x50001006
242+
hdr.flags = f32(0x50001006)
243243
end
244244
hdr.version = f32(1)
245245
hdr.shofs = fofs(ffi.offsetof(o, "sect"))
@@ -275,7 +275,7 @@ typedef struct {
275275
o.sect[2].size = fofs(ofs)
276276
o.sect[3].type = f32(3) -- .strtab
277277
o.sect[3].ofs = fofs(sofs + ofs)
278-
o.sect[3].size = fofs(#symname+1)
278+
o.sect[3].size = fofs(#symname+2)
279279
ffi.copy(o.space+ofs+1, symname)
280280
ofs = ofs + #symname + 2
281281
o.sect[4].type = f32(1) -- .rodata

plugins/plugin_luacompile/bin/32bit/jit/dis_arm.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
----------------------------------------------------------------------------
22
-- LuaJIT ARM disassembler module.
33
--
4-
-- Copyright (C) 2005-2016 Mike Pall. All rights reserved.
4+
-- Copyright (C) 2005-2017 Mike Pall. All rights reserved.
55
-- Released under the MIT license. See Copyright Notice in luajit.h
66
----------------------------------------------------------------------------
77
-- This is a helper module used by the LuaJIT machine code dumper module.
@@ -12,7 +12,7 @@
1212

1313
local type = type
1414
local sub, byte, format = string.sub, string.byte, string.format
15-
local match, gmatch, gsub = string.match, string.gmatch, string.gsub
15+
local match, gmatch = string.match, string.gmatch
1616
local concat = table.concat
1717
local bit = require("bit")
1818
local band, bor, ror, tohex = bit.band, bit.bor, bit.ror, bit.tohex

0 commit comments

Comments
 (0)