Đoàn Trần Công Danh 635e9da391 srcpkgs/q*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

33 lines
1.3 KiB
Diff

This fixes JavaScriptCore on big endian systems (mainly ppc).
Without the patch, attempting to run any JS results in
a crash as the generated code was endian specific.
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -1500,13 +1500,13 @@ _llint_op_put_by_id:
loadp StructureChain::m_vector[t3], t3
assert(macro (ok) btpnz t3, ok end)
- loadp Structure::m_prototype[t2], t2
+ loadp Structure::m_prototype + PayloadOffset[t2], t2
btpz t2, .opPutByIdTransitionChainDone
.opPutByIdTransitionChainLoop:
loadp [t3], t1
bpneq t1, JSCell::m_structureID[t2], .opPutByIdSlow
addp 4, t3
- loadp Structure::m_prototype[t1], t2
+ loadp Structure::m_prototype + PayloadOffset[t1], t2
btpnz t2, .opPutByIdTransitionChainLoop
.opPutByIdTransitionChainDone:
@@ -1984,7 +1984,7 @@ _llint_throw_from_slow_path_trampoline:
# When throwing from the interpreter (i.e. throwing from LLIntSlowPaths), so
# the throw target is not necessarily interpreted code, we come to here.
# This essentially emulates the JIT's throwing protocol.
- loadp Callee[cfr], t1
+ loadp Callee + PayloadOffset[cfr], t1
andp MarkedBlockMask, t1
loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t1], t1
copyCalleeSavesToVMCalleeSavesBuffer(t1, t2)