svn commit: r469332 - in head/www/firefox: . files
Jan Beich
jbeich at FreeBSD.org
Mon May 7 20:31:06 UTC 2018
Author: jbeich
Date: Mon May 7 20:31:04 2018
New Revision: 469332
URL: https://svnweb.freebsd.org/changeset/ports/469332
Log:
www/firefox: apply some aarch64 fixes
Obtained from: upstream (Firefox 61)
Added:
head/www/firefox/files/patch-bug1375074 (contents, props changed)
head/www/firefox/files/patch-bug1442583 (contents, props changed)
head/www/firefox/files/patch-bug1445907 (contents, props changed)
head/www/firefox/files/patch-bug1447359 (contents, props changed)
head/www/firefox/files/patch-bug1451292 (contents, props changed)
head/www/firefox/files/patch-bug1456556 (contents, props changed)
Modified:
head/www/firefox/Makefile (contents, props changed)
Modified: head/www/firefox/Makefile
==============================================================================
--- head/www/firefox/Makefile Mon May 7 20:02:54 2018 (r469331)
+++ head/www/firefox/Makefile Mon May 7 20:31:04 2018 (r469332)
@@ -3,7 +3,7 @@
PORTNAME= firefox
DISTVERSION= 60.0
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= www ipv6
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
Added: head/www/firefox/files/patch-bug1375074
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1375074 Mon May 7 20:31:04 2018 (r469332)
@@ -0,0 +1,82 @@
+commit fc25eb4380d0
+Author: Lars T Hansen <lhansen at mozilla.com>
+Date: Wed Feb 28 13:57:52 2018 +0100
+
+ Bug 1375074 - Save and restore non-volatile x28 on ARM64 for generated unboxed object constructor. r=sstangl
+
+ --HG--
+ extra : rebase_source : 4a2824b23cf7453d07c962123f780c0ff2fd5292
+ extra : source : dec6ab6522a4eb4b3c2defc5078b38ed904f3383
+---
+ js/src/jit-test/tests/bug1375074.js | 18 ++++++++++++++++++
+ js/src/vm/UnboxedObject.cpp | 25 ++++++++++++++++++++++++-
+ 2 files changed, 42 insertions(+), 1 deletion(-)
+
+diff --git js/src/jit-test/tests/bug1375074.js js/src/jit-test/tests/bug1375074.js
+new file mode 100644
+index 0000000000000..8bf01d96903fc
+--- /dev/null
++++ js/src/jit-test/tests/bug1375074.js
+@@ -0,0 +1,18 @@
++// This forces the VM to start creating unboxed objects and thus stresses a
++// particular path into generated code for a specialized unboxed object
++// constructor.
++
++var K = 2000; // 2000 should be plenty
++var s = "[";
++var i;
++for ( i=0; i < K-1; i++ )
++ s = s + `{"i":${i}},`;
++s += `{"i":${i}}]`;
++var v = JSON.parse(s);
++
++assertEq(v.length == K, true);
++
++for ( i=0; i < K; i++) {
++ assertEq(v[i] instanceof Object, true);
++ assertEq(v[i].i, i);
++}
+diff --git js/src/vm/UnboxedObject.cpp js/src/vm/UnboxedObject.cpp
+index c8c178965c488..5badf328ede4f 100644
+--- js/src/vm/UnboxedObject.cpp
++++ js/src/vm/UnboxedObject.cpp
+@@ -95,7 +95,15 @@ UnboxedLayout::makeConstructorCode(JSContext* cx, HandleObjectGroup group)
+ #endif
+
+ #ifdef JS_CODEGEN_ARM64
+- // ARM64 communicates stack address via sp, but uses a pseudo-sp for addressing.
++ // ARM64 communicates stack address via sp, but uses a pseudo-sp (PSP) for
++ // addressing. The register we use for PSP may however also be used by
++ // calling code, and it is nonvolatile, so save it. Do this as a special
++ // case first because the generic save/restore code needs the PSP to be
++ // initialized already.
++ MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64()));
++ masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex));
++
++ // Initialize the PSP from the SP.
+ masm.initStackPtr();
+ #endif
+
+@@ -233,7 +241,22 @@ UnboxedLayout::makeConstructorCode(JSContext* cx, HandleObjectGroup group)
+ masm.pop(ScratchDoubleReg);
+ masm.PopRegsInMask(savedNonVolatileRegisters);
+
++#ifdef JS_CODEGEN_ARM64
++ // Now restore the value that was in the PSP register on entry, and return.
++
++ // Obtain the correct SP from the PSP.
++ masm.Mov(sp, PseudoStackPointer64);
++
++ // Restore the saved value of the PSP register, this value is whatever the
++ // caller had saved in it, not any actual SP value, and it must not be
++ // overwritten subsequently.
++ masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex));
++
++ // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong.
++ masm.Ret(vixl::lr);
++#else
+ masm.abiret();
++#endif
+
+ masm.bind(&failureStoreOther);
+
Added: head/www/firefox/files/patch-bug1442583
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1442583 Mon May 7 20:31:04 2018 (r469332)
@@ -0,0 +1,39 @@
+commit 7371a080accd
+Author: Lars T Hansen <lhansen at mozilla.com>
+Date: Mon Mar 5 09:55:28 2018 +0100
+
+ Bug 1442583 - Properly initialize ARM64 icache flushing machinery. r=sstangl
+
+ --HG--
+ extra : rebase_source : 73b5921da1fa0a19d6072e35d09bd7b528bb6bfc
+ extra : intermediate-source : 19516efbbf6750ba04e11c7099586d5be2fe818f
+ extra : source : 4316cc82d6302edf839a4af6fcb815f0ffa9f65c
+---
+ js/src/jit/ProcessExecutableMemory.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git js/src/jit/ProcessExecutableMemory.cpp js/src/jit/ProcessExecutableMemory.cpp
+index e763a9d68dc17..8a6d50b6a7845 100644
+--- js/src/jit/ProcessExecutableMemory.cpp
++++ js/src/jit/ProcessExecutableMemory.cpp
+@@ -20,6 +20,9 @@
+ #include "jsutil.h"
+
+ #include "gc/Memory.h"
++#ifdef JS_CODEGEN_ARM64
++# include "jit/arm64/vixl/Cpu-vixl.h"
++#endif
+ #include "threading/LockGuard.h"
+ #include "threading/Mutex.h"
+ #include "util/Windows.h"
+@@ -621,6 +624,10 @@ js::jit::DeallocateExecutableMemory(void* addr, size_t bytes)
+ bool
+ js::jit::InitProcessExecutableMemory()
+ {
++#ifdef JS_CODEGEN_ARM64
++ // Initialize instruction cache flushing.
++ vixl::CPU::SetUp();
++#endif
+ return execMemory.init();
+ }
+
Added: head/www/firefox/files/patch-bug1445907
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1445907 Mon May 7 20:31:04 2018 (r469332)
@@ -0,0 +1,75 @@
+commit 0c6dd4a750db
+Author: Lars T Hansen <lhansen at mozilla.com>
+Date: Mon Mar 19 09:58:06 2018 +0100
+
+ Bug 1445907 - Save x28 before clobbering it in the regex compiler. r=sstangl
+---
+ js/src/irregexp/NativeRegExpMacroAssembler.cpp | 25 ++++++++++++++++++++++++-
+ js/src/jit-test/tests/regexp/bug1445907.js | 15 +++++++++++++++
+ 2 files changed, 39 insertions(+), 1 deletion(-)
+
+diff --git js/src/irregexp/NativeRegExpMacroAssembler.cpp js/src/irregexp/NativeRegExpMacroAssembler.cpp
+index 28a4c35e75bfe..c08b005cf856b 100644
+--- js/src/irregexp/NativeRegExpMacroAssembler.cpp
++++ js/src/irregexp/NativeRegExpMacroAssembler.cpp
+@@ -123,7 +123,15 @@ NativeRegExpMacroAssembler::GenerateCode(JSContext* cx, bool match_only)
+ masm.bind(&entry_label_);
+
+ #ifdef JS_CODEGEN_ARM64
+- // ARM64 communicates stack address via sp, but uses a pseudo-sp for addressing.
++ // ARM64 communicates stack address via SP, but uses a pseudo-sp (PSP) for
++ // addressing. The register we use for PSP may however also be used by
++ // calling code, and it is nonvolatile, so save it. Do this as a special
++ // case first because the generic save/restore code needs the PSP to be
++ // initialized already.
++ MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64()));
++ masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex));
++
++ // Initialize the PSP from the SP.
+ masm.initStackPtr();
+ #endif
+
+@@ -421,7 +429,22 @@ NativeRegExpMacroAssembler::GenerateCode(JSContext* cx, bool match_only)
+ for (GeneralRegisterBackwardIterator iter(savedNonVolatileRegisters); iter.more(); ++iter)
+ masm.Pop(*iter);
+
++#ifdef JS_CODEGEN_ARM64
++ // Now restore the value that was in the PSP register on entry, and return.
++
++ // Obtain the correct SP from the PSP.
++ masm.Mov(sp, PseudoStackPointer64);
++
++ // Restore the saved value of the PSP register, this value is whatever the
++ // caller had saved in it, not any actual SP value, and it must not be
++ // overwritten subsequently.
++ masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex));
++
++ // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong.
++ masm.Ret(vixl::lr);
++#else
+ masm.abiret();
++#endif
+
+ // Backtrack code (branch target for conditional backtracks).
+ if (backtrack_label_.used()) {
+diff --git js/src/jit-test/tests/regexp/bug1445907.js js/src/jit-test/tests/regexp/bug1445907.js
+new file mode 100644
+index 0000000000000..75b23753eaf93
+--- /dev/null
++++ js/src/jit-test/tests/regexp/bug1445907.js
+@@ -0,0 +1,15 @@
++// On ARM64, we failed to save x28 properly when generating code for the regexp
++// matcher.
++//
++// There's wasm and Debugger code here because the combination forces the use of
++// x28 and exposes the bug when running on the simulator.
++
++if (!wasmIsSupported())
++ quit();
++
++var g = newGlobal('');
++var dbg = new Debugger(g);
++g.eval(`var m = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary('(module (func (export "test")))')))`);
++var re = /./;
++dbg.onEnterFrame = function(frame) { re.exec("x") };
++result = g.eval("m.exports.test()");
Added: head/www/firefox/files/patch-bug1447359
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1447359 Mon May 7 20:31:04 2018 (r469332)
@@ -0,0 +1,45 @@
+commit fef467b5a93d
+Author: Luke Wagner <luke at mozilla.com>
+Date: Thu Mar 22 10:28:13 2018 -0500
+
+ Bug 1447359 - Baldr: add AutoForbidPools in a few missing places (r=lth)
+
+ --HG--
+ extra : rebase_source : 75f1909deb352391529ce5e58a89e5f9cfeb3662
+---
+ js/src/jit/arm64/MacroAssembler-arm64-inl.h | 1 +
+ js/src/jit/arm64/MacroAssembler-arm64.cpp | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git js/src/jit/arm64/MacroAssembler-arm64-inl.h js/src/jit/arm64/MacroAssembler-arm64-inl.h
+index 7061cbfd93ebb..190442f7afa0a 100644
+--- js/src/jit/arm64/MacroAssembler-arm64-inl.h
++++ js/src/jit/arm64/MacroAssembler-arm64-inl.h
+@@ -359,6 +359,7 @@ MacroAssembler::sub32FromStackPtrWithPatch(Register dest)
+ {
+ vixl::UseScratchRegisterScope temps(this);
+ const ARMRegister scratch = temps.AcquireX();
++ AutoForbidPools afp(this, /* max number of instructions in scope = */ 3);
+ CodeOffset offs = CodeOffset(currentOffset());
+ movz(scratch, 0, 0);
+ movk(scratch, 0, 16);
+diff --git js/src/jit/arm64/MacroAssembler-arm64.cpp js/src/jit/arm64/MacroAssembler-arm64.cpp
+index 7b599b7e9d610..4e8fdb6a67019 100644
+--- js/src/jit/arm64/MacroAssembler-arm64.cpp
++++ js/src/jit/arm64/MacroAssembler-arm64.cpp
+@@ -707,6 +707,7 @@ MacroAssembler::patchFarJump(CodeOffset farJump, uint32_t targetOffset)
+ CodeOffset
+ MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc)
+ {
++ AutoForbidPools afp(this, /* max number of instructions in scope = */ 1);
+ CodeOffset offset(currentOffset());
+ Nop();
+ append(desc, CodeOffset(currentOffset()));
+@@ -1077,6 +1078,7 @@ MacroAssembler::comment(const char* msg)
+ CodeOffset
+ MacroAssembler::wasmTrapInstruction()
+ {
++ AutoForbidPools afp(this, /* max number of instructions in scope = */ 1);
+ CodeOffset offs(currentOffset());
+ Unreachable();
+ return offs;
Added: head/www/firefox/files/patch-bug1451292
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1451292 Mon May 7 20:31:04 2018 (r469332)
@@ -0,0 +1,33 @@
+commit b3a02fddbce8
+Author: Lars T Hansen <lhansen at mozilla.com>
+Date: Wed Apr 4 15:48:48 2018 +0200
+
+ Bug 1451292 - Better payload for arm64 breakpoint instruction. r=sstangl
+
+ At least some non-zero payloads confuse GDB and make it iloop on the
+ breakpoint instruction rather than break to the command line as it
+ should. There seems to be no reason not to use a zero payload.
+
+ --HG--
+ extra : rebase_source : 6d6f9aa2911b86b02572f88948d48bc2238c6353
+ extra : amend_source : 9fed9235d481a9eadafc4a3e0075c9fef8b6050d
+---
+ js/src/jit/arm64/MacroAssembler-arm64.cpp | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git js/src/jit/arm64/MacroAssembler-arm64.cpp js/src/jit/arm64/MacroAssembler-arm64.cpp
+index 4ea64b1225d00..a212de0ec2f45 100644
+--- js/src/jit/arm64/MacroAssembler-arm64.cpp
++++ js/src/jit/arm64/MacroAssembler-arm64.cpp
+@@ -237,8 +237,9 @@ MacroAssemblerCompat::profilerEnterFrame(RegisterOrSP framePtr, Register scratch
+ void
+ MacroAssemblerCompat::breakpoint()
+ {
+- static int code = 0xA77;
+- Brk((code++) & 0xffff);
++ // Note, other payloads are possible, but GDB is known to misinterpret them
++ // sometimes and iloop on the breakpoint instead of stopping properly.
++ Brk(0);
+ }
+
+ // Either `any` is valid or `sixtyfour` is valid. Return a 32-bit ARMRegister
Added: head/www/firefox/files/patch-bug1456556
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1456556 Mon May 7 20:31:04 2018 (r469332)
@@ -0,0 +1,22 @@
+commit f6fc0b418aa3
+Author: Andrea Marchesini <amarchesini at mozilla.com>
+Date: Tue May 1 08:47:13 2018 +0200
+
+ Bug 1456556 - FetchConsumer scope-exit RAII must grab 'self' by value, r=erahm
+---
+ dom/fetch/FetchConsumer.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git dom/fetch/FetchConsumer.cpp dom/fetch/FetchConsumer.cpp
+index 134bf7f2e703a..3c3687fea1d5a 100644
+--- dom/fetch/FetchConsumer.cpp
++++ dom/fetch/FetchConsumer.cpp
+@@ -582,7 +582,7 @@ FetchBodyConsumer<Derived>::ContinueConsumeBody(nsresult aStatus,
+ RefPtr<Promise> localPromise = mConsumePromise.forget();
+
+ RefPtr<FetchBodyConsumer<Derived>> self = this;
+- auto autoReleaseObject = mozilla::MakeScopeExit([&] {
++ auto autoReleaseObject = mozilla::MakeScopeExit([self] {
+ self->ReleaseObject();
+ });
+
More information about the svn-ports-all
mailing list