diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 1a5a687d665b..9ca1c3a3513b 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,8 +19,8 @@
-
-
+
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 9e0bedbf393a..820f8268e1e5 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,8 +17,8 @@
-
-
+
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 6fb8756edf29..325c5d8b0679 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,9 +15,9 @@
-
+
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 1a5a687d665b..9ca1c3a3513b 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,8 +19,8 @@
-
-
+
+
diff --git a/b2g/config/flame/releng-flame.tt b/b2g/config/flame/releng-flame.tt
index a1dd7b15825f..1c49daaf5c68 100644
--- a/b2g/config/flame/releng-flame.tt
+++ b/b2g/config/flame/releng-flame.tt
@@ -1,6 +1,6 @@
[
-{"size": 156447892,
-"digest": "02b2e6bcaff4ccadfd85a75cc1dfb526be7937673ed18b2c6fb7fe2256a725bc778d513e3820d86adaec1636e1771bd0c5663e17bf2d3f1d6b445ff1e0a136f2",
+{"size": 159144712,
+"digest": "97d8223fe9dff2368e1a5fb0c5b7bb87c6521c55d3527bbf6f0d6046556932552c4f8cc19566edc155710f9f94757e24a5416200d68b4ea5db33a4d9d84f52ad",
"filename": "backup-flame.tar.xz",
"algorithm": "sha512"
}
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index dbf339c55f39..77f372a35ef1 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -18,8 +18,8 @@
-
-
+
+
@@ -119,7 +119,7 @@
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index 422a3d674bd4..caba60e33ef0 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "5bd5379f114f542314571a0361089cfd5beb5827",
+ "revision": "ee7c5efe7a7f24887ee7f772311a9a37997ae232",
"repo_path": "/integration/gaia-central"
}
diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml
index 4345c4e6d231..a1b2905321af 100644
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -17,8 +17,8 @@
-
-
+
+
diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml
index 810a2d103694..1b3c5f02cb66 100644
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -15,8 +15,8 @@
-
-
+
+
diff --git a/b2g/config/inari/sources.xml b/b2g/config/inari/sources.xml
index 70f1713ebed9..2f26cf699ace 100644
--- a/b2g/config/inari/sources.xml
+++ b/b2g/config/inari/sources.xml
@@ -19,8 +19,8 @@
-
-
+
+
diff --git a/b2g/config/leo/sources.xml b/b2g/config/leo/sources.xml
index 9c788357905d..699159a474ca 100644
--- a/b2g/config/leo/sources.xml
+++ b/b2g/config/leo/sources.xml
@@ -17,8 +17,8 @@
-
-
+
+
diff --git a/b2g/config/mako/sources.xml b/b2g/config/mako/sources.xml
index 8e02ea6df1fb..9f45639efef7 100644
--- a/b2g/config/mako/sources.xml
+++ b/b2g/config/mako/sources.xml
@@ -17,8 +17,8 @@
-
-
+
+
diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml
index b1e0617c4d8c..c17b25b0ba6a 100644
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -17,8 +17,8 @@
-
-
+
+
diff --git a/browser/base/content/test/social/head.js b/browser/base/content/test/social/head.js
index 2369533ade95..53cc7e25c419 100644
--- a/browser/base/content/test/social/head.js
+++ b/browser/base/content/test/social/head.js
@@ -543,17 +543,18 @@ function resizeAndCheckWidths(first, second, third, checks, cb) {
}
ok(true, count + ": " + "correct number of chats visible");
info(">> Check " + count);
- resizeAndCheckWidths(first, second, third, checks, cb);
- return true;
+ executeSoon(function() {
+ resizeAndCheckWidths(first, second, third, checks, cb);
+ });
}
- return false;
- }
- if (!collapsedObserver()) {
- let m = new MutationObserver(collapsedObserver);
- m.observe(first, {attributes: true });
- m.observe(second, {attributes: true });
- m.observe(third, {attributes: true });
}
+ let m = new MutationObserver(collapsedObserver);
+ m.observe(first, {attributes: true });
+ m.observe(second, {attributes: true });
+ m.observe(third, {attributes: true });
+ // and just in case we are already at the right size, explicitly call the
+ // observer.
+ collapsedObserver(undefined, m);
}, count);
}
diff --git a/browser/components/moz.build b/browser/components/moz.build
index 197c2f22a4e7..266180eeb26d 100644
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -30,10 +30,8 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'browsercompsbase'
-EXTRA_COMPONENTS += [
- 'BrowserComponents.manifest',
-]
EXTRA_PP_COMPONENTS += [
+ 'BrowserComponents.manifest',
'nsBrowserContentHandler.js',
'nsBrowserGlue.js',
]
diff --git a/build/autoconf/ffi.m4 b/build/autoconf/ffi.m4
index 79e8a96096a2..03e7e7939b52 100644
--- a/build/autoconf/ffi.m4
+++ b/build/autoconf/ffi.m4
@@ -46,14 +46,19 @@ if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then
# autotools can't quite handle an MSVC build environment yet.
LDFLAGS=
CFLAGS=
- ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
+ ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" \
+ CXXCPP=\"cl -nologo -EP\" SHELL=sh.exe"
case "${target_cpu}" in
x86_64)
# Need target since MSYS tools into mozilla-build may be 32bit
- ac_configure_args="$ac_configure_args CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64\""
+ ac_configure_args="$ac_configure_args \
+ CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64\" \
+ CXX=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64\""
;;
*)
- ac_configure_args="$ac_configure_args CC=$_topsrcdir/js/src/ctypes/libffi/msvcc.sh"
+ ac_configure_args="$ac_configure_args \
+ CC=$_topsrcdir/js/src/ctypes/libffi/msvcc.sh \
+ CXX=$_topsrcdir/js/src/ctypes/libffi/msvcc.sh"
;;
esac
fi
diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h
index b0b9dfa6e063..a7d1dae41c53 100644
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -505,6 +505,7 @@ GK_ATOM(lang, "lang")
GK_ATOM(language, "language")
GK_ATOM(last, "last")
GK_ATOM(layer, "layer")
+GK_ATOM(LayerActivity, "LayerActivity")
GK_ATOM(layout, "layout")
GK_ATOM(leading, "leading")
GK_ATOM(leaf, "leaf")
@@ -647,6 +648,7 @@ GK_ATOM(ol, "ol")
GK_ATOM(omitXmlDeclaration, "omit-xml-declaration")
GK_ATOM(ona2dpstatuschanged, "ona2dpstatuschanged")
GK_ATOM(onabort, "onabort")
+GK_ATOM(onactivate, "onactivate")
GK_ATOM(onadapteradded, "onadapteradded")
GK_ATOM(onafterprint, "onafterprint")
GK_ATOM(onafterscriptexecute, "onafterscriptexecute")
@@ -660,6 +662,7 @@ GK_ATOM(onaudioprocess, "onaudioprocess")
GK_ATOM(onbeforecopy, "onbeforecopy")
GK_ATOM(onbeforecut, "onbeforecut")
GK_ATOM(onbeforepaste, "onbeforepaste")
+GK_ATOM(onbeforeevicted, "onbeforeevicted")
GK_ATOM(onbeforeprint, "onbeforeprint")
GK_ATOM(onbeforescriptexecute, "onbeforescriptexecute")
GK_ATOM(onbeforeunload, "onbeforeunload")
@@ -726,7 +729,9 @@ GK_ATOM(ondrop, "ondrop")
GK_ATOM(onenabled, "onenabled")
GK_ATOM(onemergencycbmodechange, "onemergencycbmodechange")
GK_ATOM(onerror, "onerror")
+GK_ATOM(onevicted, "onevicted")
GK_ATOM(onfailed, "onfailed")
+GK_ATOM(onfetch, "onfetch")
GK_ATOM(onfocus, "onfocus")
GK_ATOM(onfrequencychange, "onfrequencychange")
GK_ATOM(onspeakerforcedchange, "onspeakerforcedchange")
@@ -743,6 +748,7 @@ GK_ATOM(oniccinfochange, "oniccinfochange")
GK_ATOM(oniccundetected, "oniccundetected")
GK_ATOM(onincoming, "onincoming")
GK_ATOM(oninput, "oninput")
+GK_ATOM(oninstall, "oninstall")
GK_ATOM(oninvalid, "oninvalid")
GK_ATOM(onkeydown, "onkeydown")
GK_ATOM(onkeypress, "onkeypress")
@@ -785,6 +791,7 @@ GK_ATOM(onpageshow, "onpageshow")
GK_ATOM(onpaint, "onpaint")
GK_ATOM(onpairedstatuschanged, "onpairedstatuschanged")
GK_ATOM(onpaste, "onpaste")
+GK_ATOM(onpendingchange, "onpendingchange")
GK_ATOM(onpopuphidden, "onpopuphidden")
GK_ATOM(onpopuphiding, "onpopuphiding")
GK_ATOM(onpopupshowing, "onpopupshowing")
@@ -827,6 +834,7 @@ GK_ATOM(ontouchcancel, "ontouchcancel")
GK_ATOM(ontransitionend, "ontransitionend")
GK_ATOM(onunderflow, "onunderflow")
GK_ATOM(onunload, "onunload")
+GK_ATOM(onupdatefound, "onupdatefound")
GK_ATOM(onupdateready, "onupdateready")
GK_ATOM(onupgradeneeded, "onupgradeneeded")
GK_ATOM(onussdreceived, "onussdreceived")
@@ -926,6 +934,7 @@ GK_ATOM(rectangle, "rectangle")
GK_ATOM(ref, "ref")
GK_ATOM(refresh, "refresh")
GK_ATOM(rel, "rel")
+GK_ATOM(onreloadpage, "onreloadpage")
GK_ATOM(rem, "rem")
GK_ATOM(removeelement, "removeelement")
GK_ATOM(renderingobserverlist, "renderingobserverlist")
@@ -1926,6 +1935,7 @@ GK_ATOM(ondurationchange, "ondurationchange")
GK_ATOM(onvolumechange, "onvolumechange")
GK_ATOM(onaddtrack, "onaddtrack")
GK_ATOM(oncuechange, "oncuechange")
+GK_ATOM(oncurrentchange, "oncurrentchange")
GK_ATOM(onenter, "onenter")
GK_ATOM(onexit, "onexit")
GK_ATOM(onremovetrack, "onremovetrack")
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index 9667173b7630..0017ebbb60db 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -34,6 +34,7 @@
#include "mozilla/dom/WakeLock.h"
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/MobileMessageManager.h"
+#include "mozilla/dom/ServiceWorkerContainer.h"
#include "mozilla/dom/Telephony.h"
#include "mozilla/Hal.h"
#include "nsISiteSpecificUserAgent.h"
@@ -177,6 +178,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessagesManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDeviceStorageStores)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTimeManager)
+ NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mServiceWorkerContainer)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCachedResolveResults)
@@ -286,6 +288,8 @@ Navigator::Invalidate()
if (mTimeManager) {
mTimeManager = nullptr;
}
+
+ mServiceWorkerContainer = nullptr;
}
//*****************************************************************************
@@ -1812,6 +1816,19 @@ Navigator::GetMozCameras(ErrorResult& aRv)
return mCameraManager;
}
+already_AddRefed
+Navigator::ServiceWorker()
+{
+ MOZ_ASSERT(mWindow);
+
+ if (!mServiceWorkerContainer) {
+ mServiceWorkerContainer = new workers::ServiceWorkerContainer(mWindow);
+ }
+
+ nsRefPtr ref = mServiceWorkerContainer;
+ return ref.forget();
+}
+
size_t
Navigator::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h
index 8c0a58c0ff11..524fc0d86325 100644
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -104,6 +104,10 @@ class AudioChannelManager;
#endif
} // namespace system
+namespace workers {
+class ServiceWorkerContainer;
+} // namespace workers
+
class Navigator : public nsIDOMNavigator
, public nsIMozNavigatorNetwork
, public nsWrapperCache
@@ -250,6 +254,9 @@ public:
uint64_t aInnerWindowID,
ErrorResult& aRv);
#endif // MOZ_MEDIA_NAVIGATOR
+
+ already_AddRefed ServiceWorker();
+
bool DoNewResolve(JSContext* aCx, JS::Handle aObject,
JS::Handle aId,
JS::MutableHandle aDesc);
@@ -365,6 +372,7 @@ private:
nsCOMPtr mMessagesManager;
nsTArray > mDeviceStorageStores;
nsRefPtr mTimeManager;
+ nsRefPtr mServiceWorkerContainer;
nsCOMPtr mWindow;
// Hashtable for saving cached objects newresolve created, so we don't create
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index d935ac1a9103..59022a505df3 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -1712,7 +1712,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindow)
if (tmp->mDoc && tmp->mDoc->GetDocumentURI()) {
tmp->mDoc->GetDocumentURI()->GetSpec(uri);
}
- PR_snprintf(name, sizeof(name), "nsGlobalWindow #%ld %s %s",
+ PR_snprintf(name, sizeof(name), "nsGlobalWindow #%llu %s %s",
tmp->mWindowID, tmp->IsInnerWindow() ? "inner" : "outer",
uri.get());
cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
index f0ead7cd8bd7..8459228e8141 100644
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1977,6 +1977,21 @@ nsJSContext::RunCycleCollectorSlice()
gCCStats.FinishCycleCollectionSlice();
}
+//static
+void
+nsJSContext::RunCycleCollectorWorkSlice(int64_t aWorkBudget)
+{
+ if (!NS_IsMainThread()) {
+ return;
+ }
+
+ PROFILER_LABEL("CC", "RunCycleCollectorWorkSlice");
+
+ gCCStats.PrepareForCycleCollectionSlice();
+ nsCycleCollector_collectSliceWork(aWorkBudget);
+ gCCStats.FinishCycleCollectionSlice();
+}
+
static void
ICCTimerFired(nsITimer* aTimer, void* aClosure)
{
diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h
index 9fae2a1730e4..b2a9f42c0730 100644
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -101,6 +101,9 @@ public:
// Run a cycle collector slice, using a heuristic to decide how long to run it.
static void RunCycleCollectorSlice();
+ // Run a cycle collector slice, using the given work budget.
+ static void RunCycleCollectorWorkSlice(int64_t aWorkBudget);
+
static void BeginCycleCollectionCallback();
static void EndCycleCollectionCallback(mozilla::CycleCollectorResults &aResults);
diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf
index 17d2bd6ac75a..08f64d675c34 100644
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -707,6 +707,18 @@ DOMInterfaces = {
'workers': True,
}],
+'InstallPhaseEvent': {
+ 'headerFile': 'ServiceWorkerEvents.h',
+ 'nativeType': 'mozilla::dom::workers::InstallPhaseEvent',
+ 'workers': True
+},
+
+'InstallEvent': {
+ 'headerFile': 'ServiceWorkerEvents.h',
+ 'nativeType': 'mozilla::dom::workers::InstallEvent',
+ 'workers': True
+},
+
'KeyEvent': {
'concrete': False
},
@@ -1019,6 +1031,21 @@ DOMInterfaces = {
]
},
+'ServiceWorker': {
+ 'nativeType': 'mozilla::dom::workers::ServiceWorker',
+ 'headerFile': 'mozilla/dom/workers/bindings/ServiceWorker.h',
+},
+
+'ServiceWorkerContainer': {
+ 'nativeType': 'mozilla::dom::workers::ServiceWorkerContainer',
+ 'headerFile': 'mozilla/dom/ServiceWorkerContainer.h',
+},
+
+'ServiceWorkerGlobalScope': {
+ 'headerFile': 'mozilla/dom/WorkerScope.h',
+ 'workers': True,
+},
+
'SharedWorker': {
'nativeType': 'mozilla::dom::workers::SharedWorker',
'headerFile': 'mozilla/dom/workers/bindings/SharedWorker.h',
diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp
index 88bb4f95bf28..7be3aba227cc 100644
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -25,6 +25,7 @@
#include "mozilla/dom/DOMStorageIPC.h"
#include "mozilla/hal_sandbox/PHalChild.h"
#include "mozilla/ipc/BackgroundChild.h"
+#include "mozilla/ipc/FileDescriptorUtils.h"
#include "mozilla/ipc/GeckoChildProcessHost.h"
#include "mozilla/ipc/TestShellChild.h"
#include "mozilla/layers/CompositorChild.h"
@@ -46,6 +47,7 @@
#include "mozilla/unused.h"
#include "nsIConsoleListener.h"
+#include "nsICycleCollectorListener.h"
#include "nsIIPCBackgroundChildCreateCallback.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIMemoryReporter.h"
@@ -78,6 +80,7 @@
#include "nsIGeolocationProvider.h"
#include "mozilla/dom/PMemoryReportRequestChild.h"
+#include "mozilla/dom/PCycleCollectWithLogsChild.h"
#ifdef MOZ_PERMISSIONS
#include "nsIScriptSecurityManager.h"
@@ -203,6 +206,108 @@ MemoryReportRequestChild::~MemoryReportRequestChild()
MOZ_COUNT_DTOR(MemoryReportRequestChild);
}
+// IPC sender for remote GC/CC logging.
+class CycleCollectWithLogsChild MOZ_FINAL
+ : public PCycleCollectWithLogsChild
+ , public nsICycleCollectorLogSink
+{
+public:
+ NS_DECL_ISUPPORTS
+
+ CycleCollectWithLogsChild(const FileDescriptor& aGCLog,
+ const FileDescriptor& aCCLog)
+ {
+ mGCLog = FileDescriptorToFILE(aGCLog, "w");
+ mCCLog = FileDescriptorToFILE(aCCLog, "w");
+ }
+
+ NS_IMETHOD Open(FILE** aGCLog, FILE** aCCLog) MOZ_OVERRIDE
+ {
+ if (NS_WARN_IF(!mGCLog) || NS_WARN_IF(!mCCLog)) {
+ return NS_ERROR_FAILURE;
+ }
+ *aGCLog = mGCLog;
+ *aCCLog = mCCLog;
+ return NS_OK;
+ }
+
+ NS_IMETHOD CloseGCLog() MOZ_OVERRIDE
+ {
+ MOZ_ASSERT(mGCLog);
+ fclose(mGCLog);
+ mGCLog = nullptr;
+ SendCloseGCLog();
+ return NS_OK;
+ }
+
+ NS_IMETHOD CloseCCLog() MOZ_OVERRIDE
+ {
+ MOZ_ASSERT(mCCLog);
+ fclose(mCCLog);
+ mCCLog = nullptr;
+ SendCloseCCLog();
+ return NS_OK;
+ }
+
+ NS_IMETHOD GetFilenameIdentifier(nsAString& aIdentifier) MOZ_OVERRIDE
+ {
+ return UnimplementedProperty();
+ }
+
+ NS_IMETHOD SetFilenameIdentifier(const nsAString& aIdentifier) MOZ_OVERRIDE
+ {
+ return UnimplementedProperty();
+ }
+
+ NS_IMETHOD GetProcessIdentifier(int32_t *aIdentifier) MOZ_OVERRIDE
+ {
+ return UnimplementedProperty();
+ }
+
+ NS_IMETHOD SetProcessIdentifier(int32_t aIdentifier) MOZ_OVERRIDE
+ {
+ return UnimplementedProperty();
+ }
+
+ NS_IMETHOD GetGcLog(nsIFile** aPath) MOZ_OVERRIDE
+ {
+ return UnimplementedProperty();
+ }
+
+ NS_IMETHOD GetCcLog(nsIFile** aPath) MOZ_OVERRIDE
+ {
+ return UnimplementedProperty();
+ }
+
+private:
+ ~CycleCollectWithLogsChild()
+ {
+ if (mGCLog) {
+ fclose(mGCLog);
+ mGCLog = nullptr;
+ }
+ if (mCCLog) {
+ fclose(mCCLog);
+ mCCLog = nullptr;
+ }
+ // The XPCOM refcount drives the IPC lifecycle; see also
+ // DeallocPCycleCollectWithLogsChild.
+ unused << Send__delete__(this);
+ }
+
+ nsresult UnimplementedProperty()
+ {
+ MOZ_ASSERT(false, "This object is a remote GC/CC logger;"
+ " this property isn't meaningful.");
+ return NS_ERROR_UNEXPECTED;
+ }
+
+ FILE* mGCLog;
+ FILE* mCCLog;
+};
+
+NS_IMPL_ISUPPORTS(CycleCollectWithLogsChild, nsICycleCollectorLogSink);
+
class AlertObserver
{
public:
@@ -669,16 +774,39 @@ ContentChild::DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor)
return true;
}
-bool
-ContentChild::RecvDumpGCAndCCLogsToFile(const nsString& aIdentifier,
- const bool& aDumpAllTraces,
- const bool& aDumpChildProcesses)
+PCycleCollectWithLogsChild*
+ContentChild::AllocPCycleCollectWithLogsChild(const bool& aDumpAllTraces,
+ const FileDescriptor& aGCLog,
+ const FileDescriptor& aCCLog)
{
+ CycleCollectWithLogsChild* actor = new CycleCollectWithLogsChild(aGCLog, aCCLog);
+ // Return actor with refcount 0, which is safe because it has a non-XPCOM type.
+ return actor;
+}
+
+bool
+ContentChild::RecvPCycleCollectWithLogsConstructor(PCycleCollectWithLogsChild* aActor,
+ const bool& aDumpAllTraces,
+ const FileDescriptor& aGCLog,
+ const FileDescriptor& aCCLog)
+{
+ // Take a reference here, where the XPCOM type is regained.
+ nsRefPtr sink = static_cast(aActor);
nsCOMPtr dumper = do_GetService("@mozilla.org/memory-info-dumper;1");
- nsString gcLogPath, ccLogPath;
- dumper->DumpGCAndCCLogsToFile(aIdentifier, aDumpAllTraces,
- aDumpChildProcesses, gcLogPath, ccLogPath);
+ dumper->DumpGCAndCCLogsToSink(aDumpAllTraces, sink);
+
+ // The actor's destructor is called when the last reference goes away...
+ return true;
+}
+
+bool
+ContentChild::DeallocPCycleCollectWithLogsChild(PCycleCollectWithLogsChild* /* aActor */)
+{
+ // ...so when we get here, there's nothing for us to do.
+ //
+ // Also, we're already in ~CycleCollectWithLogsChild (q.v.) at
+ // this point, so we shouldn't touch the actor in any case.
return true;
}
diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h
index cb818a4072b6..f5d65b0739ef 100644
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -142,13 +142,20 @@ public:
const bool &minimizeMemoryUsage,
const nsString &aDMDDumpIdent) MOZ_OVERRIDE;
+ virtual PCycleCollectWithLogsChild*
+ AllocPCycleCollectWithLogsChild(const bool& aDumpAllTraces,
+ const FileDescriptor& aGCLog,
+ const FileDescriptor& aCCLog) MOZ_OVERRIDE;
virtual bool
- RecvAudioChannelNotify() MOZ_OVERRIDE;
+ DeallocPCycleCollectWithLogsChild(PCycleCollectWithLogsChild* aActor) MOZ_OVERRIDE;
+ virtual bool
+ RecvPCycleCollectWithLogsConstructor(PCycleCollectWithLogsChild* aChild,
+ const bool& aDumpAllTraces,
+ const FileDescriptor& aGCLog,
+ const FileDescriptor& aCCLog) MOZ_OVERRIDE;
virtual bool
- RecvDumpGCAndCCLogsToFile(const nsString& aIdentifier,
- const bool& aDumpAllTraces,
- const bool& aDumpChildProcesses) MOZ_OVERRIDE;
+ RecvAudioChannelNotify() MOZ_OVERRIDE;
virtual PTestShellChild* AllocPTestShellChild() MOZ_OVERRIDE;
virtual bool DeallocPTestShellChild(PTestShellChild*) MOZ_OVERRIDE;
diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp
index 115d419377fa..7b037f488683 100644
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -35,6 +35,7 @@
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ExternalHelperAppParent.h"
#include "mozilla/dom/PFileDescriptorSetParent.h"
+#include "mozilla/dom/PCycleCollectWithLogsParent.h"
#include "mozilla/dom/PMemoryReportRequestParent.h"
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/DOMStorageIPC.h"
@@ -50,6 +51,7 @@
#include "mozilla/hal_sandbox/PHalParent.h"
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/BackgroundParent.h"
+#include "mozilla/ipc/FileDescriptorUtils.h"
#include "mozilla/ipc/TestShellParent.h"
#include "mozilla/ipc/InputStreamUtils.h"
#include "mozilla/layers/CompositorParent.h"
@@ -75,12 +77,14 @@
#include "nsIAlertsService.h"
#include "nsIAppsService.h"
#include "nsIClipboard.h"
+#include "nsICycleCollectorListener.h"
#include "nsIDOMGeoGeolocation.h"
#include "mozilla/dom/WakeLock.h"
#include "nsIDOMWindow.h"
#include "nsIExternalProtocolService.h"
#include "nsIGfxInfo.h"
#include "nsIIdleService.h"
+#include "nsIMemoryInfoDumper.h"
#include "nsIMemoryReporter.h"
#include "nsIMozBrowserFrame.h"
#include "nsIMutable.h"
@@ -353,6 +357,82 @@ MemoryReportRequestParent::~MemoryReportRequestParent()
MOZ_COUNT_DTOR(MemoryReportRequestParent);
}
+// IPC receiver for remote GC/CC logging.
+class CycleCollectWithLogsParent MOZ_FINAL : public PCycleCollectWithLogsParent
+{
+public:
+ ~CycleCollectWithLogsParent()
+ {
+ MOZ_COUNT_DTOR(CycleCollectWithLogsParent);
+ }
+
+ static bool AllocAndSendConstructor(ContentParent* aManager,
+ bool aDumpAllTraces,
+ nsICycleCollectorLogSink* aSink,
+ nsIDumpGCAndCCLogsCallback* aCallback)
+ {
+ CycleCollectWithLogsParent *actor;
+ FILE* gcLog;
+ FILE* ccLog;
+ nsresult rv;
+
+ actor = new CycleCollectWithLogsParent(aSink, aCallback);
+ rv = actor->mSink->Open(&gcLog, &ccLog);
+ if (NS_WARN_IF(NS_FAILED(rv))) {
+ delete actor;
+ return false;
+ }
+
+ return aManager->
+ SendPCycleCollectWithLogsConstructor(actor,
+ aDumpAllTraces,
+ FILEToFileDescriptor(gcLog),
+ FILEToFileDescriptor(ccLog));
+ }
+
+private:
+ virtual bool RecvCloseGCLog() MOZ_OVERRIDE
+ {
+ unused << mSink->CloseGCLog();
+ return true;
+ }
+
+ virtual bool RecvCloseCCLog() MOZ_OVERRIDE
+ {
+ unused << mSink->CloseCCLog();
+ return true;
+ }
+
+ virtual bool Recv__delete__() MOZ_OVERRIDE
+ {
+ // Report completion to mCallback only on successful
+ // completion of the protocol.
+ nsCOMPtr gcLog, ccLog;
+ mSink->GetGcLog(getter_AddRefs(gcLog));
+ mSink->GetCcLog(getter_AddRefs(ccLog));
+ unused << mCallback->OnDump(gcLog, ccLog, /* parent = */ false);
+ return true;
+ }
+
+ virtual void ActorDestroy(ActorDestroyReason aReason) MOZ_OVERRIDE
+ {
+ // If the actor is unexpectedly destroyed, we deliberately
+ // don't call Close[GC]CLog on the sink, because the logs may
+ // be incomplete. See also the nsCycleCollectorLogSinkToFile
+ // implementaiton of those methods, and its destructor.
+ }
+
+ CycleCollectWithLogsParent(nsICycleCollectorLogSink *aSink,
+ nsIDumpGCAndCCLogsCallback *aCallback)
+ : mSink(aSink), mCallback(aCallback)
+ {
+ MOZ_COUNT_CTOR(CycleCollectWithLogsParent);
+ }
+
+ nsCOMPtr mSink;
+ nsCOMPtr mCallback;
+};
+
// A memory reporter for ContentParent objects themselves.
class ContentParentsMemoryReporter MOZ_FINAL : public nsIMemoryReporter
{
@@ -2590,6 +2670,32 @@ ContentParent::DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* act
return true;
}
+PCycleCollectWithLogsParent*
+ContentParent::AllocPCycleCollectWithLogsParent(const bool& aDumpAllTraces,
+ const FileDescriptor& aGCLog,
+ const FileDescriptor& aCCLog)
+{
+ MOZ_CRASH("Don't call this; use ContentParent::CycleCollectWithLogs");
+}
+
+bool
+ContentParent::DeallocPCycleCollectWithLogsParent(PCycleCollectWithLogsParent* aActor)
+{
+ delete aActor;
+ return true;
+}
+
+bool
+ContentParent::CycleCollectWithLogs(bool aDumpAllTraces,
+ nsICycleCollectorLogSink* aSink,
+ nsIDumpGCAndCCLogsCallback* aCallback)
+{
+ return CycleCollectWithLogsParent::AllocAndSendConstructor(this,
+ aDumpAllTraces,
+ aSink,
+ aCallback);
+}
+
PTestShellParent*
ContentParent::AllocPTestShellParent()
{
diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h
index b29acebe55a9..f5d600b9dac3 100644
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -28,7 +28,9 @@
class mozIApplication;
class nsConsoleService;
+class nsICycleCollectorLogSink;
class nsIDOMBlob;
+class nsIDumpGCAndCCLogsCallback;
class nsIMemoryReporter;
class ParentIdleListener;
@@ -224,6 +226,11 @@ public:
const nsString& aPageURL,
const bool& aIsAudio,
const bool& aIsVideo) MOZ_OVERRIDE;
+
+ bool CycleCollectWithLogs(bool aDumpAllTraces,
+ nsICycleCollectorLogSink* aSink,
+ nsIDumpGCAndCCLogsCallback* aCallback);
+
protected:
void OnChannelConnected(int32_t pid) MOZ_OVERRIDE;
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
@@ -374,6 +381,13 @@ private:
const nsString &aDMDDumpIdent) MOZ_OVERRIDE;
virtual bool DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor) MOZ_OVERRIDE;
+ virtual PCycleCollectWithLogsParent*
+ AllocPCycleCollectWithLogsParent(const bool& aDumpAllTraces,
+ const FileDescriptor& aGCLog,
+ const FileDescriptor& aCCLog) MOZ_OVERRIDE;
+ virtual bool
+ DeallocPCycleCollectWithLogsParent(PCycleCollectWithLogsParent* aActor) MOZ_OVERRIDE;
+
virtual PTestShellParent* AllocPTestShellParent() MOZ_OVERRIDE;
virtual bool DeallocPTestShellParent(PTestShellParent* shell) MOZ_OVERRIDE;
diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl
index f6dc678ecff0..6a7477a4eaa5 100644
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -10,6 +10,7 @@ include protocol PBlob;
include protocol PBluetooth;
include protocol PBrowser;
include protocol PCompositor;
+include protocol PCycleCollectWithLogs;
include protocol PCrashReporter;
include protocol PExternalHelperApp;
include protocol PDeviceStorageRequest;
@@ -273,6 +274,7 @@ intr protocol PContent
manages PBluetooth;
manages PBrowser;
manages PCrashReporter;
+ manages PCycleCollectWithLogs;
manages PDeviceStorageRequest;
manages PFileSystemRequest;
manages PExternalHelperApp;
@@ -337,14 +339,14 @@ child:
async SpeakerManagerNotify();
/**
- * Dump this process's GC and CC logs.
+ * Dump this process's GC and CC logs to the provided files.
*
- * For documentation on the args, see dumpGCAndCCLogsToFile in
+ * For documentation on the other args, see dumpGCAndCCLogsToFile in
* nsIMemoryInfoDumper.idl
*/
- async DumpGCAndCCLogsToFile(nsString identifier,
- bool dumpAllTraces,
- bool dumpChildProcesses);
+ PCycleCollectWithLogs(bool dumpAllTraces,
+ FileDescriptor gcLog,
+ FileDescriptor ccLog);
PTestShell();
diff --git a/dom/ipc/PCycleCollectWithLogs.ipdl b/dom/ipc/PCycleCollectWithLogs.ipdl
new file mode 100644
index 000000000000..c1fb560b19d0
--- /dev/null
+++ b/dom/ipc/PCycleCollectWithLogs.ipdl
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+include protocol PContent;
+
+namespace mozilla {
+namespace dom {
+
+protocol PCycleCollectWithLogs {
+ manager PContent;
+
+parent:
+ CloseGCLog();
+ CloseCCLog();
+
+ __delete__();
+};
+
+}
+}
diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build
index 05b12cf6ae08..8b9d82c3af45 100644
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -78,6 +78,7 @@ IPDL_SOURCES += [
'PContentPermission.ipdlh',
'PContentPermissionRequest.ipdl',
'PCrashReporter.ipdl',
+ 'PCycleCollectWithLogs.ipdl',
'PDocumentRenderer.ipdl',
'PFileDescriptorSet.ipdl',
'PFilePicker.ipdl',
diff --git a/dom/tests/mochitest/chrome/test_cyclecollector.xul b/dom/tests/mochitest/chrome/test_cyclecollector.xul
index 8d2b2160ff85..28bb5e7a9545 100644
--- a/dom/tests/mochitest/chrome/test_cyclecollector.xul
+++ b/dom/tests/mochitest/chrome/test_cyclecollector.xul
@@ -36,11 +36,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=
}
};
+ // Start an incremental GC, to make sure that calling ccSlice
+ // when an IGC is running finishes the GC.
+ SpecialPowers.Cu.getJSTestingFunctions().gcslice(1);
+
// Make sure that we call the observer even if we're in the middle
// of an ICC when we add the observer. See bug 981033.
- // XXX This will assert if we try to start an ICC during a IGC.
- //SpecialPowers.finishCC();
- //SpecialPowers.ccSlice(1);
+ SpecialPowers.finishCC();
+ SpecialPowers.ccSlice(1);
obs.addObserver(observer, "cycle-collector-begin", false);
diff --git a/dom/tests/mochitest/general/test_interfaces.html b/dom/tests/mochitest/general/test_interfaces.html
index 5669981650c5..af2ab515fa34 100644
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -809,6 +809,10 @@ var interfaceNamesInGlobalScope =
"ScrollAreaEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
"Selection",
+// IMPORTANT: Do not change this list without review from a DOM peer!
+ {name: "ServiceWorker", pref: "dom.serviceWorkers.enabled"},
+// IMPORTANT: Do not change this list without review from a DOM peer!
+ {name: "ServiceWorkerContainer", pref: "dom.serviceWorkers.enabled"},
// IMPORTANT: Do not change this list without review from a DOM peer!
"SettingsLock",
// IMPORTANT: Do not change this list without review from a DOM peer!
diff --git a/dom/webidl/InstallEvent.webidl b/dom/webidl/InstallEvent.webidl
new file mode 100644
index 000000000000..9c6d40349177
--- /dev/null
+++ b/dom/webidl/InstallEvent.webidl
@@ -0,0 +1,28 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For more information on this interface, please see
+ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ */
+
+// While not explicitly restricted to ServiceWorkerGlobalScope, it probably
+// should be. https://github.com/slightlyoff/ServiceWorker/issues/254
+[Constructor(DOMString type, optional InstallEventInit eventInitDict),
+ Func="mozilla::dom::workers::ServiceWorkerEventsVisible"]
+interface InstallEvent : InstallPhaseEvent {
+ // The currently active worker for this scope when this worker is asked to
+ // install itself.
+ // This may be null when a ServiceWorker is being installed for a previously
+ // uncontrolled scope.
+ // https://github.com/slightlyoff/ServiceWorker/issues/260
+ readonly attribute ServiceWorker? activeWorker;
+ void replace();
+};
+
+// Should be in the spec soon to satisfy conventions about events.
+// https://github.com/slightlyoff/ServiceWorker/issues/216.
+dictionary InstallEventInit : EventInit {
+ ServiceWorker? activeWorker = null;
+};
diff --git a/dom/webidl/InstallPhaseEvent.webidl b/dom/webidl/InstallPhaseEvent.webidl
new file mode 100644
index 000000000000..04337749eba3
--- /dev/null
+++ b/dom/webidl/InstallPhaseEvent.webidl
@@ -0,0 +1,17 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * For more information on this interface, please see
+ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ */
+
+// While not explicitly restricted to ServiceWorkerGlobalScope, it probably
+// should be. https://github.com/slightlyoff/ServiceWorker/issues/254
+[Constructor(DOMString type, optional EventInit eventInitDict),
+ Func="mozilla::dom::workers::ServiceWorkerEventsVisible"]
+interface InstallPhaseEvent : Event {
+ // https://github.com/slightlyoff/ServiceWorker/issues/261
+ void waitUntil(Promise p);
+};
diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl
index 2e7cf6c2fcc7..3affccbb980e 100644
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -355,6 +355,12 @@ partial interface Navigator {
};
#endif // MOZ_MEDIA_NAVIGATOR
+// Service Workers/Navigation Controllers
+partial interface Navigator {
+ [Pref="dom.serviceWorkers.enabled"]
+ readonly attribute ServiceWorkerContainer serviceWorker;
+};
+
partial interface Navigator {
[Throws, Pref="beacon.enabled"]
boolean sendBeacon(DOMString url,
diff --git a/dom/webidl/ServiceWorker.webidl b/dom/webidl/ServiceWorker.webidl
new file mode 100644
index 000000000000..0bab287ec748
--- /dev/null
+++ b/dom/webidl/ServiceWorker.webidl
@@ -0,0 +1,31 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ *
+ */
+
+// Still unclear what should be subclassed.
+// https://github.com/slightlyoff/ServiceWorker/issues/189
+[Pref="dom.serviceWorkers.enabled"]
+interface ServiceWorker : EventTarget {
+ readonly attribute DOMString scope;
+ readonly attribute DOMString url;
+
+ readonly attribute ServiceWorkerState state;
+ attribute EventHandler onstatechange;
+};
+
+ServiceWorker implements AbstractWorker;
+
+enum ServiceWorkerState {
+ "parsed",
+ "installing",
+ "installed",
+ "activating",
+ "activated",
+ "redundant"
+};
diff --git a/dom/webidl/ServiceWorkerContainer.webidl b/dom/webidl/ServiceWorkerContainer.webidl
new file mode 100644
index 000000000000..0f189bde427a
--- /dev/null
+++ b/dom/webidl/ServiceWorkerContainer.webidl
@@ -0,0 +1,50 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ *
+ */
+
+[Pref="dom.serviceWorkers.enabled"]
+interface ServiceWorkerContainer {
+ // FIXME(nsm):
+ // https://github.com/slightlyoff/ServiceWorker/issues/198
+ // and discussion at https://etherpad.mozilla.org/serviceworker07apr
+ [Unforgeable] readonly attribute ServiceWorker? installing;
+ [Unforgeable] readonly attribute ServiceWorker? waiting;
+ [Unforgeable] readonly attribute ServiceWorker? current;
+
+ [Throws]
+ Promise getAll();
+
+ [Throws]
+ Promise register(DOMString url, optional RegistrationOptionList options);
+
+ [Throws]
+ Promise unregister(DOMString? scope);
+
+ // Promise
+ [Throws]
+ Promise whenReady();
+
+ attribute EventHandler onupdatefound;
+ attribute EventHandler oncurrentchange;
+ attribute EventHandler onreloadpage;
+ attribute EventHandler onerror;
+};
+
+// Testing only.
+[ChromeOnly, Pref="dom.serviceWorkers.testing.enabled"]
+partial interface ServiceWorkerContainer {
+ [Throws]
+ Promise clearAllServiceWorkerData();
+ [Throws]
+ DOMString getControllingWorkerScriptURLForPath(DOMString path);
+};
+
+dictionary RegistrationOptionList {
+ DOMString scope = "*";
+};
diff --git a/dom/webidl/ServiceWorkerGlobalScope.webidl b/dom/webidl/ServiceWorkerGlobalScope.webidl
new file mode 100644
index 000000000000..b9c3911a0d44
--- /dev/null
+++ b/dom/webidl/ServiceWorkerGlobalScope.webidl
@@ -0,0 +1,48 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * The origin of this IDL file is
+ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ *
+ * You are granted a license to use, reproduce and create derivative works of
+ * this document.
+ */
+
+// The Pref controls exposure in general, the Func restricts it to inside the
+// ServiceWorkerGlobalScope (itself).
+[Global, Func="mozilla::dom::workers::ServiceWorkerGlobalScope::Visible",
+ Pref="dom.serviceWorkers.enabled"]
+interface ServiceWorkerGlobalScope : WorkerGlobalScope {
+ // FIXME(nsm): Bug 982725
+ // readonly attribute CacheList caches;
+
+ // FIXME(nsm): Bug 982726
+ // A container for a list of window objects, identifiable by ID, that
+ // correspond to windows (or workers) that are "controlled" by this SW
+ // readonly attribute ServiceWorkerClients clients;
+
+ [Unforgeable] readonly attribute DOMString scope;
+
+ // FIXME(nsm): Bug 995484
+ // ResponsePromise fetch((Request or [EnsureUTF16] DOMString) request);
+
+ void update();
+ void unregister();
+
+ attribute EventHandler oninstall;
+ attribute EventHandler onactivate;
+ attribute EventHandler onfetch;
+ attribute EventHandler onbeforeevicted;
+ attribute EventHandler onevicted;
+
+ // The event.source of these MessageEvents are instances of Client
+ attribute EventHandler onmessage;
+
+ // close() method inherited from WorkerGlobalScope is not exposed.
+ // FIXME(nsm): For now, overridden so it can be a no-op.
+ void close();
+};
+
+
diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl
index bd237d4962b5..b12f224cb426 100644
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -57,8 +57,8 @@ typedef any Transferable;
//[Throws] readonly attribute WindowProxy parent;
[Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy? parent;
[Throws] readonly attribute Element? frameElement;
- //[Throws] WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", optional DOMString features = "", optional boolean replace = false);
- [Throws] WindowProxy? open(optional DOMString url = "", optional DOMString target = "", optional DOMString features = "");
+ //[Throws] WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "", optional boolean replace = false);
+ [Throws] WindowProxy? open(optional DOMString url = "", optional DOMString target = "", [TreatNullAs=EmptyString] optional DOMString features = "");
// We think the indexed getter is a bug in the spec, it actually needs to live
// on the WindowProxy
//getter WindowProxy (unsigned long index);
diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build
index c24945b40df8..5c690310899a 100644
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -214,6 +214,8 @@ WEBIDL_FILES = [
'InputEvent.webidl',
'InputMethod.webidl',
'InspectorUtils.webidl',
+ 'InstallEvent.webidl',
+ 'InstallPhaseEvent.webidl',
'InterAppConnection.webidl',
'InterAppConnectionRequest.webidl',
'InterAppMessagePort.webidl',
@@ -299,6 +301,9 @@ WEBIDL_FILES = [
'ScriptProcessorNode.webidl',
'ScrollAreaEvent.webidl',
'Selection.webidl',
+ 'ServiceWorker.webidl',
+ 'ServiceWorkerContainer.webidl',
+ 'ServiceWorkerGlobalScope.webidl',
'SettingsManager.webidl',
'ShadowRoot.webidl',
'SharedWorker.webidl',
diff --git a/dom/workers/MessagePort.h b/dom/workers/MessagePort.h
index bc1d0a9a6e8f..6eeffbbfbb3f 100644
--- a/dom/workers/MessagePort.h
+++ b/dom/workers/MessagePort.h
@@ -6,7 +6,7 @@
#ifndef mozilla_dom_workers_messageport_h_
#define mozilla_dom_workers_messageport_h_
-#include "Workers.h"
+#include "mozilla/dom/workers/Workers.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/dom/BindingDeclarations.h"
diff --git a/dom/workers/ServiceWorker.cpp b/dom/workers/ServiceWorker.cpp
new file mode 100644
index 000000000000..7a9ba872b90f
--- /dev/null
+++ b/dom/workers/ServiceWorker.cpp
@@ -0,0 +1,46 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "ServiceWorker.h"
+
+#include "nsPIDOMWindow.h"
+#include "SharedWorker.h"
+#include "WorkerPrivate.h"
+
+#include "mozilla/dom/Promise.h"
+
+using namespace mozilla::dom;
+USING_WORKERS_NAMESPACE
+
+ServiceWorker::ServiceWorker(nsPIDOMWindow* aWindow,
+ SharedWorker* aSharedWorker)
+ : DOMEventTargetHelper(aWindow),
+ mSharedWorker(aSharedWorker)
+{
+ AssertIsOnMainThread();
+ MOZ_ASSERT(mSharedWorker);
+}
+
+ServiceWorker::~ServiceWorker()
+{
+ AssertIsOnMainThread();
+}
+
+NS_IMPL_ADDREF_INHERITED(ServiceWorker, DOMEventTargetHelper)
+NS_IMPL_RELEASE_INHERITED(ServiceWorker, DOMEventTargetHelper)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ServiceWorker)
+NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
+
+NS_IMPL_CYCLE_COLLECTION_INHERITED(ServiceWorker, DOMEventTargetHelper,
+ mSharedWorker)
+
+JSObject*
+ServiceWorker::WrapObject(JSContext* aCx)
+{
+ AssertIsOnMainThread();
+
+ return ServiceWorkerBinding::Wrap(aCx, this);
+}
diff --git a/dom/workers/ServiceWorker.h b/dom/workers/ServiceWorker.h
new file mode 100644
index 000000000000..0311d06dd880
--- /dev/null
+++ b/dom/workers/ServiceWorker.h
@@ -0,0 +1,77 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_dom_workers_serviceworker_h__
+#define mozilla_dom_workers_serviceworker_h__
+
+#include "mozilla/DOMEventTargetHelper.h"
+#include "mozilla/dom/BindingDeclarations.h"
+#include "mozilla/dom/ServiceWorkerBinding.h" // For ServiceWorkerState.
+
+class nsPIDOMWindow;
+
+namespace mozilla {
+namespace dom {
+
+class Promise;
+
+namespace workers {
+
+class SharedWorker;
+
+class ServiceWorker MOZ_FINAL : public DOMEventTargetHelper
+{
+ friend class RuntimeService;
+public:
+ NS_DECL_ISUPPORTS_INHERITED
+ NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorker, DOMEventTargetHelper)
+
+ IMPL_EVENT_HANDLER(statechange)
+ IMPL_EVENT_HANDLER(error)
+
+ virtual JSObject*
+ WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+
+ ServiceWorkerState
+ State() const
+ {
+ return mState;
+ }
+
+ void
+ GetScope(nsString& aScope) const
+ {
+ aScope = mScope;
+ }
+
+ void
+ GetUrl(nsString& aURL) const
+ {
+ aURL = mURL;
+ }
+
+private:
+ // This class can only be created from the RuntimeService.
+ ServiceWorker(nsPIDOMWindow* aWindow, SharedWorker* aSharedWorker);
+
+ // This class is reference-counted and will be destroyed from Release().
+ ~ServiceWorker();
+
+ ServiceWorkerState mState;
+ nsString mScope;
+ nsString mURL;
+
+ // To allow ServiceWorkers to potentially drop the backing DOMEventTargetHelper and
+ // re-instantiate it later, they simply own a SharedWorker member that
+ // can be released and recreated as required rather than re-implement some of
+ // the SharedWorker logic.
+ nsRefPtr mSharedWorker;
+};
+
+} // namespace workers
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_workers_serviceworker_h__
diff --git a/dom/workers/ServiceWorkerContainer.cpp b/dom/workers/ServiceWorkerContainer.cpp
new file mode 100644
index 000000000000..2b198bd31de0
--- /dev/null
+++ b/dom/workers/ServiceWorkerContainer.cpp
@@ -0,0 +1,110 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "ServiceWorkerContainer.h"
+
+#include "nsPIDOMWindow.h"
+
+#include "nsCycleCollectionParticipant.h"
+
+#include "mozilla/dom/Promise.h"
+#include "mozilla/dom/ServiceWorkerContainerBinding.h"
+#include "mozilla/dom/workers/bindings/ServiceWorker.h"
+
+namespace mozilla {
+namespace dom {
+namespace workers {
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ServiceWorkerContainer)
+NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
+
+NS_IMPL_ADDREF_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
+NS_IMPL_RELEASE_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
+
+NS_IMPL_CYCLE_COLLECTION_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper, mWindow)
+
+JSObject*
+ServiceWorkerContainer::WrapObject(JSContext* aCx)
+{
+ return ServiceWorkerContainerBinding::Wrap(aCx, this);
+}
+
+already_AddRefed
+ServiceWorkerContainer::Register(const nsAString& aScriptURL,
+ const RegistrationOptionList& aOptions,
+ ErrorResult& aRv)
+{
+ // FIXME(nsm): Bug 984048
+ aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
+ return nullptr;
+}
+
+already_AddRefed
+ServiceWorkerContainer::Unregister(const nsAString& aScope,
+ ErrorResult& aRv)
+{
+ // FIXME(nsm): Bug 984048
+ aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
+ return nullptr;
+}
+
+already_AddRefed
+ServiceWorkerContainer::GetInstalling()
+{
+ // FIXME(nsm): Bug 1002570
+ return nullptr;
+}
+
+already_AddRefed
+ServiceWorkerContainer::GetWaiting()
+{
+ // FIXME(nsm): Bug 1002570
+ return nullptr;
+}
+
+already_AddRefed
+ServiceWorkerContainer::GetCurrent()
+{
+ // FIXME(nsm): Bug 1002570
+ return nullptr;
+}
+
+already_AddRefed
+ServiceWorkerContainer::GetAll(ErrorResult& aRv)
+{
+ // FIXME(nsm): Bug 1002571
+ aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
+ return nullptr;
+}
+
+already_AddRefed
+ServiceWorkerContainer::WhenReady(ErrorResult& aRv)
+{
+ // FIXME(nsm): Bug 984048
+ aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
+ return nullptr;
+}
+
+// Testing only.
+already_AddRefed
+ServiceWorkerContainer::ClearAllServiceWorkerData(ErrorResult& aRv)
+{
+ aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
+ return nullptr;
+}
+
+// Testing only.
+void
+ServiceWorkerContainer::GetControllingWorkerScriptURLForPath(
+ const nsAString& aPath,
+ nsString& aScriptURL,
+ ErrorResult& aRv)
+{
+ aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
+}
+} // namespace workers
+} // namespace dom
+} // namespace mozilla
diff --git a/dom/workers/ServiceWorkerContainer.h b/dom/workers/ServiceWorkerContainer.h
new file mode 100644
index 000000000000..ae98c7c93239
--- /dev/null
+++ b/dom/workers/ServiceWorkerContainer.h
@@ -0,0 +1,94 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_dom_workers_serviceworkercontainer_h__
+#define mozilla_dom_workers_serviceworkercontainer_h__
+
+#include "mozilla/DOMEventTargetHelper.h"
+
+class nsPIDOMWindow;
+
+namespace mozilla {
+namespace dom {
+
+class Promise;
+struct RegistrationOptionList;
+
+namespace workers {
+
+class ServiceWorker;
+
+// Lightweight serviceWorker APIs collection.
+class ServiceWorkerContainer MOZ_FINAL : public DOMEventTargetHelper
+{
+public:
+ NS_DECL_ISUPPORTS_INHERITED
+ NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerContainer, DOMEventTargetHelper)
+
+ IMPL_EVENT_HANDLER(updatefound)
+ IMPL_EVENT_HANDLER(currentchange)
+ IMPL_EVENT_HANDLER(reloadpage)
+ IMPL_EVENT_HANDLER(error)
+
+ explicit ServiceWorkerContainer(nsPIDOMWindow* aWindow)
+ : mWindow(aWindow)
+ {
+ SetIsDOMBinding();
+ }
+
+ nsPIDOMWindow*
+ GetParentObject() const
+ {
+ return mWindow;
+ }
+
+ JSObject*
+ WrapObject(JSContext* aCx);
+
+ already_AddRefed
+ Register(const nsAString& aScriptURL,
+ const RegistrationOptionList& aOptions,
+ ErrorResult& aRv);
+
+ already_AddRefed
+ Unregister(const nsAString& scope, ErrorResult& aRv);
+
+ already_AddRefed
+ GetInstalling();
+
+ already_AddRefed
+ GetWaiting();
+
+ already_AddRefed
+ GetCurrent();
+
+ already_AddRefed
+ GetAll(ErrorResult& aRv);
+
+ already_AddRefed
+ WhenReady(ErrorResult& aRv);
+
+ // Testing only.
+ already_AddRefed
+ ClearAllServiceWorkerData(ErrorResult& aRv);
+
+ // Testing only.
+ void
+ GetControllingWorkerScriptURLForPath(const nsAString& aPath,
+ nsString& aScriptURL,
+ ErrorResult& aRv);
+private:
+ ~ServiceWorkerContainer()
+ { }
+
+ nsCOMPtr mWindow;
+};
+
+} // namespace workers
+} // namespace dom
+} // namespace mozilla
+
+#endif /* mozilla_dom_workers_serviceworkercontainer_h__ */
diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp
new file mode 100644
index 000000000000..7b895365afca
--- /dev/null
+++ b/dom/workers/ServiceWorkerEvents.cpp
@@ -0,0 +1,66 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "ServiceWorkerEvents.h"
+
+#include "nsContentUtils.h"
+
+#include "mozilla/dom/Promise.h"
+#include "mozilla/dom/WorkerScope.h"
+#include "mozilla/dom/workers/bindings/ServiceWorker.h"
+#include "mozilla/dom/ServiceWorkerGlobalScopeBinding.h"
+
+using namespace mozilla::dom;
+
+BEGIN_WORKERS_NAMESPACE
+
+bool
+ServiceWorkerEventsVisible(JSContext* aCx, JSObject* aObj)
+{
+ ServiceWorkerGlobalScope* scope = nullptr;
+ nsresult rv = UnwrapObject(aObj, scope);
+ return NS_SUCCEEDED(rv) && scope;
+}
+
+InstallPhaseEvent::InstallPhaseEvent(EventTarget* aOwner)
+ : Event(aOwner, nullptr, nullptr)
+{
+}
+
+void
+InstallPhaseEvent::WaitUntil(Promise& aPromise)
+{
+ MOZ_ASSERT(!NS_IsMainThread());
+
+ // Only first caller counts.
+ if (EventPhase() == AT_TARGET && !mPromise) {
+ mPromise = &aPromise;
+ }
+}
+
+NS_IMPL_ADDREF_INHERITED(InstallPhaseEvent, Event)
+NS_IMPL_RELEASE_INHERITED(InstallPhaseEvent, Event)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(InstallPhaseEvent)
+NS_INTERFACE_MAP_END_INHERITING(Event)
+
+NS_IMPL_CYCLE_COLLECTION_INHERITED(InstallPhaseEvent, Event, mPromise)
+
+InstallEvent::InstallEvent(EventTarget* aOwner)
+ : InstallPhaseEvent(aOwner)
+{
+}
+
+NS_IMPL_ADDREF_INHERITED(InstallEvent, InstallPhaseEvent)
+NS_IMPL_RELEASE_INHERITED(InstallEvent, InstallPhaseEvent)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(InstallEvent)
+NS_INTERFACE_MAP_END_INHERITING(InstallPhaseEvent)
+
+NS_IMPL_CYCLE_COLLECTION_INHERITED(InstallEvent, InstallPhaseEvent, mActiveWorker)
+
+END_WORKERS_NAMESPACE
diff --git a/dom/workers/ServiceWorkerEvents.h b/dom/workers/ServiceWorkerEvents.h
new file mode 100644
index 000000000000..73f7f7fd8790
--- /dev/null
+++ b/dom/workers/ServiceWorkerEvents.h
@@ -0,0 +1,133 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_dom_workers_serviceworkerevents_h__
+#define mozilla_dom_workers_serviceworkerevents_h__
+
+#include "mozilla/dom/Event.h"
+#include "mozilla/dom/InstallPhaseEventBinding.h"
+#include "mozilla/dom/InstallEventBinding.h"
+
+namespace mozilla {
+namespace dom {
+ class Promise;
+} // namespace dom
+} // namespace mozilla
+
+BEGIN_WORKERS_NAMESPACE
+
+class ServiceWorker;
+
+bool
+ServiceWorkerEventsVisible(JSContext* aCx, JSObject* aObj);
+
+class InstallPhaseEvent : public Event
+{
+ nsRefPtr mPromise;
+
+protected:
+ InstallPhaseEvent(mozilla::dom::EventTarget* aOwner);
+
+public:
+ NS_DECL_ISUPPORTS_INHERITED
+ NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(InstallPhaseEvent, Event)
+ NS_FORWARD_TO_EVENT
+
+ virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
+ {
+ return mozilla::dom::InstallPhaseEventBinding_workers::Wrap(aCx, this);
+ }
+
+ static already_AddRefed
+ Constructor(mozilla::dom::EventTarget* aOwner,
+ const nsAString& aType,
+ const EventInit& aOptions)
+ {
+ nsRefPtr e = new InstallPhaseEvent(aOwner);
+ bool trusted = e->Init(aOwner);
+ e->InitEvent(aType, aOptions.mBubbles, aOptions.mCancelable);
+ e->SetTrusted(trusted);
+ return e.forget();
+ }
+
+ static already_AddRefed
+ Constructor(const GlobalObject& aGlobal,
+ const nsAString& aType,
+ const EventInit& aOptions,
+ ErrorResult& aRv)
+ {
+ nsCOMPtr target = do_QueryInterface(aGlobal.GetAsSupports());
+ return Constructor(target, aType, aOptions);
+ }
+
+ void
+ WaitUntil(Promise& aPromise);
+
+ already_AddRefed
+ GetPromise() const
+ {
+ nsRefPtr p = mPromise;
+ return p.forget();
+ }
+};
+
+class InstallEvent MOZ_FINAL : public InstallPhaseEvent
+{
+ // FIXME(nsm): Bug 982787 will allow actually populating this.
+ nsRefPtr mActiveWorker;
+
+protected:
+ InstallEvent(mozilla::dom::EventTarget* aOwner);
+
+public:
+ NS_DECL_ISUPPORTS_INHERITED
+ NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(InstallEvent, InstallPhaseEvent)
+ NS_FORWARD_TO_EVENT
+
+ virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
+ {
+ return mozilla::dom::InstallEventBinding_workers::Wrap(aCx, this);
+ }
+
+ static already_AddRefed
+ Constructor(mozilla::dom::EventTarget* aOwner,
+ const nsAString& aType,
+ const InstallEventInit& aOptions)
+ {
+ nsRefPtr e = new InstallEvent(aOwner);
+ bool trusted = e->Init(aOwner);
+ e->InitEvent(aType, aOptions.mBubbles, aOptions.mCancelable);
+ e->SetTrusted(trusted);
+ e->mActiveWorker = aOptions.mActiveWorker;
+ return e.forget();
+ }
+
+ static already_AddRefed
+ Constructor(const GlobalObject& aGlobal,
+ const nsAString& aType,
+ const InstallEventInit& aOptions,
+ ErrorResult& aRv)
+ {
+ nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports());
+ return Constructor(owner, aType, aOptions);
+ }
+
+ already_AddRefed
+ GetActiveWorker() const
+ {
+ nsRefPtr sw = mActiveWorker;
+ return sw.forget();
+ }
+
+ void
+ Replace()
+ {
+ // FIXME(nsm): Unspecced. Bug 982711
+ NS_WARNING("Not Implemented");
+ };
+};
+
+END_WORKERS_NAMESPACE
+#endif /* mozilla_dom_workers_serviceworkerevents_h__ */
diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp
index 72667ab6e8d4..9871c76d13ab 100644
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -5821,8 +5821,9 @@ WorkerPrivate::CreateGlobalScope(JSContext* aCx)
nsRefPtr globalScope;
if (IsSharedWorker()) {
globalScope = new SharedWorkerGlobalScope(this, SharedWorkerName());
- }
- else {
+ } else if (IsServiceWorker()) {
+ globalScope = new ServiceWorkerGlobalScope(this, SharedWorkerName());
+ } else {
globalScope = new DedicatedWorkerGlobalScope(this);
}
diff --git a/dom/workers/WorkerScope.cpp b/dom/workers/WorkerScope.cpp
index 8fab805ec18f..27167ed3be4b 100644
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -10,6 +10,7 @@
#include "mozilla/EventListenerManager.h"
#include "mozilla/dom/FunctionBinding.h"
#include "mozilla/dom/DedicatedWorkerGlobalScopeBinding.h"
+#include "mozilla/dom/ServiceWorkerGlobalScopeBinding.h"
#include "mozilla/dom/SharedWorkerGlobalScopeBinding.h"
#include "mozilla/dom/Console.h"
@@ -341,6 +342,35 @@ SharedWorkerGlobalScope::WrapGlobalObject(JSContext* aCx)
true);
}
+ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(WorkerPrivate* aWorkerPrivate,
+ const nsACString& aScope)
+ : WorkerGlobalScope(aWorkerPrivate),
+ mScope(NS_ConvertUTF8toUTF16(aScope))
+{
+}
+
+/* static */ bool
+ServiceWorkerGlobalScope::Visible(JSContext* aCx, JSObject* aObj)
+{
+ ServiceWorkerGlobalScope* self = nullptr;
+ nsresult rv = UNWRAP_WORKER_OBJECT(ServiceWorkerGlobalScope, aObj, self);
+ return NS_SUCCEEDED(rv) && self;
+}
+
+JSObject*
+ServiceWorkerGlobalScope::WrapGlobalObject(JSContext* aCx)
+{
+ mWorkerPrivate->AssertIsOnWorkerThread();
+ MOZ_ASSERT(mWorkerPrivate->IsServiceWorker());
+
+ JS::CompartmentOptions options;
+ mWorkerPrivate->CopyJSCompartmentOptions(options);
+
+ return ServiceWorkerGlobalScopeBinding_workers::Wrap(aCx, this, this, options,
+ GetWorkerPrincipal(),
+ true);
+}
+
bool
GetterOnlyJSNative(JSContext* aCx, unsigned aArgc, JS::Value* aVp)
{
diff --git a/dom/workers/WorkerScope.h b/dom/workers/WorkerScope.h
index cfe21efd1e32..2f4b0147c5bc 100644
--- a/dom/workers/WorkerScope.h
+++ b/dom/workers/WorkerScope.h
@@ -154,13 +154,60 @@ public:
virtual JSObject*
WrapGlobalObject(JSContext* aCx) MOZ_OVERRIDE;
- void GetName(DOMString& aName) const {
+ void GetName(DOMString& aName) const
+ {
aName.AsAString() = NS_ConvertUTF8toUTF16(mName);
}
IMPL_EVENT_HANDLER(connect)
};
+class ServiceWorkerGlobalScope MOZ_FINAL : public WorkerGlobalScope
+{
+ const nsString mScope;
+ ~ServiceWorkerGlobalScope() { }
+
+public:
+ ServiceWorkerGlobalScope(WorkerPrivate* aWorkerPrivate, const nsACString& aScope);
+
+ static bool
+ Visible(JSContext* aCx, JSObject* aObj);
+
+ virtual JSObject*
+ WrapGlobalObject(JSContext* aCx) MOZ_OVERRIDE;
+
+ void
+ GetScope(DOMString& aScope) const
+ {
+ aScope.AsAString() = mScope;
+ }
+
+ void
+ Close() const
+ {
+ // no-op close.
+ }
+
+ void
+ Update()
+ {
+ // FIXME(nsm): Bug 982728
+ }
+
+ void
+ Unregister()
+ {
+ // FIXME(nsm): Bug 982728
+ }
+
+ IMPL_EVENT_HANDLER(activate)
+ IMPL_EVENT_HANDLER(beforeevicted)
+ IMPL_EVENT_HANDLER(evicted)
+ IMPL_EVENT_HANDLER(fetch)
+ IMPL_EVENT_HANDLER(install)
+ IMPL_EVENT_HANDLER(message)
+};
+
JSObject*
CreateGlobalScope(JSContext* aCx);
diff --git a/dom/workers/moz.build b/dom/workers/moz.build
index e437a1eb625f..69595c784fd0 100644
--- a/dom/workers/moz.build
+++ b/dom/workers/moz.build
@@ -8,6 +8,7 @@ TEST_DIRS += ['test']
# Public stuff.
EXPORTS.mozilla.dom += [
+ 'ServiceWorkerContainer.h',
'WorkerPrivate.h',
'WorkerRunnable.h',
'WorkerScope.h',
@@ -25,6 +26,7 @@ EXPORTS.mozilla.dom.workers.bindings += [
'Location.h',
'MessagePort.h',
'Navigator.h',
+ 'ServiceWorker.h',
'SharedWorker.h',
'URL.h',
'WorkerFeature.h',
@@ -45,6 +47,9 @@ SOURCES += [
'RegisterBindings.cpp',
'RuntimeService.cpp',
'ScriptLoader.cpp',
+ 'ServiceWorker.cpp',
+ 'ServiceWorkerContainer.cpp',
+ 'ServiceWorkerEvents.cpp',
'SharedWorker.cpp',
'URL.cpp',
'WorkerPrivate.cpp',
diff --git a/dom/workers/test/moz.build b/dom/workers/test/moz.build
index c49eb6ceffc7..ae9dc4af3294 100644
--- a/dom/workers/test/moz.build
+++ b/dom/workers/test/moz.build
@@ -6,6 +6,7 @@
DIRS += [
'extensions',
+ 'serviceworkers',
]
MOCHITEST_MANIFESTS += ['mochitest.ini']
diff --git a/dom/workers/test/serviceworkers/mochitest.ini b/dom/workers/test/serviceworkers/mochitest.ini
new file mode 100644
index 000000000000..51b3fe37d32b
--- /dev/null
+++ b/dom/workers/test/serviceworkers/mochitest.ini
@@ -0,0 +1 @@
+[test_navigator.html]
diff --git a/dom/workers/test/serviceworkers/moz.build b/dom/workers/test/serviceworkers/moz.build
new file mode 100644
index 000000000000..8421b15157a7
--- /dev/null
+++ b/dom/workers/test/serviceworkers/moz.build
@@ -0,0 +1,7 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+MOCHITEST_MANIFESTS += ['mochitest.ini']
diff --git a/dom/workers/test/serviceworkers/test_navigator.html b/dom/workers/test/serviceworkers/test_navigator.html
new file mode 100644
index 000000000000..b11732b56bff
--- /dev/null
+++ b/dom/workers/test/serviceworkers/test_navigator.html
@@ -0,0 +1,41 @@
+
+
+
+
+ Bug 930348 - test stub Navigator ServiceWorker utilities.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gfx/layers/TiledLayerBuffer.h b/gfx/layers/TiledLayerBuffer.h
index 6717f71ff25a..dd965dd909fa 100644
--- a/gfx/layers/TiledLayerBuffer.h
+++ b/gfx/layers/TiledLayerBuffer.h
@@ -123,6 +123,19 @@ public:
const nsIntRegion& GetPaintedRegion() const { return mPaintedRegion; }
void ClearPaintedRegion() { mPaintedRegion.SetEmpty(); }
+ void ResetPaintedAndValidState() {
+ mPaintedRegion.SetEmpty();
+ mValidRegion.SetEmpty();
+ mRetainedWidth = 0;
+ mRetainedHeight = 0;
+ for (size_t i = 0; i < mRetainedTiles.Length(); i++) {
+ if (!IsPlaceholder(mRetainedTiles[i])) {
+ AsDerived().ReleaseTile(mRetainedTiles[i]);
+ }
+ }
+ mRetainedTiles.Clear();
+ }
+
// Given a position i, this function returns the position inside the current tile.
int GetTileStart(int i, int aTileLength) const {
return (i >= 0) ? (i % aTileLength)
diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp
index c1cdf599529a..9b4235649c36 100644
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -142,10 +142,12 @@ typedef GeckoContentController::APZStateChange APZStateChange;
* Pref that allows or disallows checkerboarding
*
* "apz.asyncscroll.throttle"
- * The time period in ms that throttles mozbrowserasyncscroll event.
+ * The time period that throttles mozbrowserasyncscroll event.
+ * Units: milliseconds
*
* "apz.asyncscroll.timeout"
- * The timeout in ms for mAsyncScrollTimeoutTask delay task.
+ * The timeout for mAsyncScrollTimeoutTask delay task.
+ * Units: milliseconds
*
* "apz.axis_lock_mode"
* The preferred axis locking style. See AxisLockMode for possible values.
@@ -155,6 +157,7 @@ typedef GeckoContentController::APZStateChange APZStateChange;
* content is being unruly/slow and we don't get a response back within this
* time, we will just pretend that content did not preventDefault any touch
* events we dispatched to it.
+ * Units: milliseconds
*
* "apz.cross_slide_enabled"
* Pref that enables integration with the Metro "cross-slide" gesture.
@@ -165,10 +168,11 @@ typedef GeckoContentController::APZStateChange APZStateChange;
* opposite axis.
*
* "apz.fling_accel_interval_ms"
- * The time in milliseconds that determines whether a second fling will be
- * treated as accelerated. If two flings are started within this interval,
- * the second one will be accelerated. Setting an interval of 0 means that
- * acceleration will be disabled.
+ * The time that determines whether a second fling will be treated as
+ * accelerated. If two flings are started within this interval, the second one
+ * will be accelerated. Setting an interval of 0 means that acceleration will
+ * be disabled.
+ * Units: milliseconds
*
* "apz.fling_accel_base_mult"
* "apz.fling_accel_supplemental_mult"
@@ -184,15 +188,18 @@ typedef GeckoContentController::APZStateChange APZStateChange;
* "apz.fling_repaint_interval"
* Maximum amount of time flinging before sending a viewport change. This will
* asynchronously repaint the page.
+ * Units: milliseconds
*
* "apz.fling_stopped_threshold"
* When flinging, if the velocity goes below this number, we just stop the
* animation completely. This is to prevent asymptotically approaching 0
* velocity and rerendering unnecessarily.
+ * Units: screen pixels per millisecond
*
* "apz.max_velocity_inches_per_ms"
- * Maximum velocity in inches per millisecond. Velocity will be capped at this
- * value if a faster fling occurs. Negative values indicate unlimited velocity.
+ * Maximum velocity. Velocity will be capped at this value if a faster fling
+ * occurs. Negative values indicate unlimited velocity.
+ * Units: (real-world, i.e. screen) inches per millisecond
*
* "apz.max_velocity_queue_size"
* Maximum size of velocity queue. The queue contains last N velocity records.
@@ -202,6 +209,7 @@ typedef GeckoContentController::APZStateChange APZStateChange;
* "apz.min_skate_speed"
* Minimum amount of speed along an axis before we switch to "skate" multipliers
* rather than using the "stationary" multipliers.
+ * Units: CSS pixels per millisecond
*
* "apz.num_paint_duration_samples"
* Number of samples to store of how long it took to paint after the previous
@@ -216,6 +224,7 @@ typedef GeckoContentController::APZStateChange APZStateChange;
* device DPI, before we start panning the screen. This is to prevent us from
* accidentally processing taps as touch moves, and from very short/accidental
* touches moving the screen.
+ * Units: (real-world, i.e. screen) inches
*
* "apz.use_paint_duration"
* Whether or not to use the estimated paint duration as a factor when projecting
diff --git a/gfx/layers/client/ClientTiledThebesLayer.cpp b/gfx/layers/client/ClientTiledThebesLayer.cpp
index ddea0badcf9f..47f356023633 100644
--- a/gfx/layers/client/ClientTiledThebesLayer.cpp
+++ b/gfx/layers/client/ClientTiledThebesLayer.cpp
@@ -393,9 +393,7 @@ ClientTiledThebesLayer::RenderLayer()
// Clear the low precision tiled buffer
updatedLowPrecision = true;
mLowPrecisionValidRegion.SetEmpty();
- mContentClient->mLowPrecisionTiledBuffer.PaintThebes(mLowPrecisionValidRegion,
- mLowPrecisionValidRegion,
- callback, data);
+ mContentClient->mLowPrecisionTiledBuffer.ResetPaintedAndValidState();
}
// We send a Painted callback if we clear the valid region of the low
diff --git a/ipc/glue/FileDescriptorUtils.cpp b/ipc/glue/FileDescriptorUtils.cpp
index 3762fa0db839..590b91e658e2 100644
--- a/ipc/glue/FileDescriptorUtils.cpp
+++ b/ipc/glue/FileDescriptorUtils.cpp
@@ -14,6 +14,13 @@
#include "prio.h"
#include "private/pprio.h"
+#include
+#ifdef XP_WIN
+#include
+#else
+#include
+#endif
+
using mozilla::ipc::CloseFileRunnable;
#ifdef DEBUG
@@ -76,3 +83,54 @@ CloseFileRunnable::Run()
CloseFile();
return NS_OK;
}
+
+namespace mozilla {
+namespace ipc {
+
+FILE*
+FileDescriptorToFILE(const FileDescriptor& aDesc,
+ const char* aOpenMode)
+{
+ if (!aDesc.IsValid()) {
+ errno = EBADF;
+ return nullptr;
+ }
+ FileDescriptor::PlatformHandleType handle = aDesc.PlatformHandle();
+#ifdef XP_WIN
+ int fd = _open_osfhandle(reinterpret_cast(handle), 0);
+ if (fd == -1) {
+ CloseHandle(handle);
+ return nullptr;
+ }
+#else
+ int fd = handle;
+#endif
+ FILE* file = fdopen(fd, aOpenMode);
+ if (!file) {
+ int saved_errno = errno;
+ close(fd);
+ errno = saved_errno;
+ }
+ return file;
+}
+
+FileDescriptor
+FILEToFileDescriptor(FILE* aStream)
+{
+ if (!aStream) {
+ errno = EBADF;
+ return FileDescriptor();
+ }
+#ifdef XP_WIN
+ int fd = _fileno(aStream);
+ if (fd == -1) {
+ return FileDescriptor();
+ }
+ return FileDescriptor(reinterpret_cast(_get_osfhandle(fd)));
+#else
+ return FileDescriptor(fileno(aStream));
+#endif
+}
+
+} // namespace ipc
+} // namespace mozilla
diff --git a/ipc/glue/FileDescriptorUtils.h b/ipc/glue/FileDescriptorUtils.h
index 81a9ae178cf7..c6e339c71738 100644
--- a/ipc/glue/FileDescriptorUtils.h
+++ b/ipc/glue/FileDescriptorUtils.h
@@ -9,6 +9,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "nsIRunnable.h"
+#include
namespace mozilla {
namespace ipc {
@@ -42,6 +43,17 @@ private:
void CloseFile();
};
+// On failure, FileDescriptorToFILE closes the given descriptor; on
+// success, fclose()ing the returned FILE* will close the handle.
+// This is meant for use with FileDescriptors received over IPC.
+FILE* FileDescriptorToFILE(const FileDescriptor& aDesc,
+ const char* aOpenMode);
+
+// FILEToFileDescriptor does not consume the given FILE*; it must be
+// fclose()d as normal, and this does not invalidate the returned
+// FileDescriptor.
+FileDescriptor FILEToFileDescriptor(FILE* aStream);
+
} // namespace ipc
} // namespace mozilla
diff --git a/js/src/Makefile.in b/js/src/Makefile.in
index 02a3756e8482..d37a7d1ff79f 100644
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -39,6 +39,11 @@ SHARED_LIBRARY_LIBS += \
$(NULL)
endif
+# Windows needs this to be linked with a static library.
+ifndef MOZ_NATIVE_FFI
+DEFINES += -DFFI_BUILDING
+endif
+
endif # JS_HAS_CTYPES
DASH_R = -r
diff --git a/js/src/assembler/jit/ExecutableAllocator.h b/js/src/assembler/jit/ExecutableAllocator.h
index 4616e563b024..4ae75ce9b6d9 100644
--- a/js/src/assembler/jit/ExecutableAllocator.h
+++ b/js/src/assembler/jit/ExecutableAllocator.h
@@ -33,6 +33,7 @@
#include "assembler/wtf/Platform.h"
#include "jit/arm/Simulator-arm.h"
+#include "jit/mips/Simulator-mips.h"
#include "js/HashTable.h"
#include "js/Vector.h"
@@ -61,7 +62,7 @@ extern "C" void sync_instruction_memory(caddr_t v, u_int len);
#include
#endif
-#if WTF_CPU_MIPS && WTF_OS_LINUX
+#if WTF_CPU_MIPS && WTF_OS_LINUX && !JS_MIPS_SIMULATOR
#include
#endif
@@ -418,7 +419,7 @@ public:
static void cacheFlush(void*, size_t)
{
}
-#elif defined(JS_ARM_SIMULATOR)
+#elif defined(JS_ARM_SIMULATOR) || defined(JS_MIPS_SIMULATOR)
static void cacheFlush(void *code, size_t size)
{
js::jit::Simulator::FlushICache(code, size);
diff --git a/js/src/assembler/wtf/Platform.h b/js/src/assembler/wtf/Platform.h
index 4e78ae5c4eb9..06bc5b3fe5f1 100644
--- a/js/src/assembler/wtf/Platform.h
+++ b/js/src/assembler/wtf/Platform.h
@@ -157,6 +157,16 @@
#define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1
#endif /* MIPS */
+#if defined(JS_MIPS_SIMULATOR)
+#define WTF_MIPS_ARCH 32
+#define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v)
+#define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v)
+#define WTF_MIPS_ARCH_REV 2
+#define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v)
+#define WTF_MIPS_DOUBLE_FLOAT 1
+#undef WTF_MIPS_FP64
+#endif
+
/* WTF_CPU_PPC - PowerPC 32-bit */
#if defined(__ppc__) \
|| defined(__PPC__) \
@@ -379,6 +389,12 @@
# define WTF_CPU_ARM 1
#endif
+#if defined(JS_MIPS_SIMULATOR)
+# undef WTF_CPU_X86
+# undef WTF_CPU_X64
+# define WTF_CPU_MIPS 1
+#endif
+
#if WTF_CPU_ARM || WTF_CPU_MIPS
#define WTF_CPU_NEEDS_ALIGNED_ACCESS 1
#endif
diff --git a/js/src/ctypes/libffi-patches/00-base.patch b/js/src/ctypes/libffi-patches/00-base.patch
new file mode 100644
index 000000000000..ec441c504c22
--- /dev/null
+++ b/js/src/ctypes/libffi-patches/00-base.patch
@@ -0,0 +1,111 @@
+Modifications to upstream libffi needed for the Mozilla build:
+* Clear INFO_DEPS so that builds don't fail when makeinfo isn't present.
+ - This can be removed if https://github.com/atgreen/libffi/issues/111 is fixed.
+* Various workarounds for pymake bugs.
+ - Once pymake support is fully deprecated, hunks 2 & 3 be safely removed.
+
+diff --git a/js/src/ctypes/libffi/Makefile.in b/js/src/ctypes/libffi/Makefile.in
+--- a/js/src/ctypes/libffi/Makefile.in
++++ b/js/src/ctypes/libffi/Makefile.in
+@@ -358,17 +358,17 @@ am__v_TEXI2PDF_1 =
+ AM_V_texinfo = $(am__v_texinfo_@AM_V@)
+ am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
+ am__v_texinfo_0 = -q
+ am__v_texinfo_1 =
+ AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
+ am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
+ am__v_texidevnull_0 = > /dev/null
+ am__v_texidevnull_1 =
+-INFO_DEPS = $(srcdir)/doc/libffi.info
++INFO_DEPS =
+ am__TEXINFO_TEX_DIR = $(srcdir)
+ DVIS = doc/libffi.dvi
+ PDFS = doc/libffi.pdf
+ PSS = doc/libffi.ps
+ HTMLS = doc/libffi.html
+ TEXINFOS = doc/libffi.texi
+ TEXI2DVI = texi2dvi
+ TEXI2PDF = $(TEXI2DVI) --pdf --batch
+@@ -1292,57 +1292,57 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/freebsd.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/sysv.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/unix64.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/win32.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/win64.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@src/xtensa/$(DEPDIR)/ffi.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@src/xtensa/$(DEPDIR)/sysv.Plo@am__quote@
+
+-.S.o:
++%.o: %.S
+ @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ @am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ @am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
+
+-.S.obj:
++%.obj: %.S
+ @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ @am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ @am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+-.S.lo:
++%.lo: %.S
+ @am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ @am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ @am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<
+
+-.c.o:
++%.o: %.c
+ @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+-.c.obj:
++%.obj: %.c
+ @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+-.c.lo:
++%.lo: %.c
+ @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+ mostlyclean-libtool:
+@@ -1443,17 +1443,17 @@ doc/libffi.html: doc/libffi.texi $(srcdi
+ -@rm -f vti.tmp
+ @cp $(srcdir)/doc/version.texi $@
+
+ mostlyclean-vti:
+ -rm -f vti.tmp
+
+ maintainer-clean-vti:
+ @MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi
+-.dvi.ps:
++%.ps: %.dvi
+ $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(DVIPS) $(AM_V_texinfo) -o $@ $<
+
+ uninstall-dvi-am:
+ @$(NORMAL_UNINSTALL)
+ @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
diff --git a/js/src/ctypes/libffi/ChangeLog.libffi b/js/src/ctypes/libffi/ChangeLog.libffi
index 5272f3360a0c..49ba8dad3a31 100644
--- a/js/src/ctypes/libffi/ChangeLog.libffi
+++ b/js/src/ctypes/libffi/ChangeLog.libffi
@@ -1,35 +1,6 @@
-2010-01-15 Anthony Green
+2011-02-08 Andreas Tobler
- * README: Add notes on building with Microsoft Visual C++.
-
-2010-01-15 Daniel Witte
-
- * msvcc.sh: New file.
-
- * src/x86/win32.S: Port assembly routines to MSVC and #ifdef.
- * src/x86/ffi.c: Tweak function declaration and remove excess
- parens.
- * include/ffi.h.in: Add __declspec(align(8)) to typedef struct
- ffi_closure.
-
- * src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new
- function ffi_call_win32 on X86_WIN32.
- * src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32.
- (ffi_call_STDCALL): Remove.
-
- * src/prep_cif.c (ffi_prep_cif): Move stack space allocation code
- to ffi_prep_cif_machdep for x86.
- * src/x86/ffi.c (ffi_prep_cif_machdep): To here.
-
-2010-01-15 Oliver Kiddle
-
- * src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for
- Sun Studio compiler compatibility.
-
-2010-01-12 Conrad Irwin
-
- * doc/libffi.texi: Add closure example.
- * doc/libffi.info: Rebuilt.
+ * testsuite/lib/libffi.exp: Tweak for stand-alone mode.
2009-12-25 Samuli Suominen
@@ -603,8 +574,8 @@
* Makefile.am, include/Makefile.am: Move headers to
libffi_la_SOURCES for new automake.
* Makefile.in, include/Makefile.in: Rebuilt.
-
- * testsuite/lib/wrapper.exp: Copied from gcc tree to allow for
+
+ * testsuite/lib/wrapper.exp: Copied from gcc tree to allow for
execution outside of gcc tree.
* testsuite/lib/target-libpath.exp: Ditto.
diff --git a/js/src/ctypes/libffi/ChangeLog b/js/src/ctypes/libffi/ChangeLog.libffi-3.1
similarity index 71%
rename from js/src/ctypes/libffi/ChangeLog
rename to js/src/ctypes/libffi/ChangeLog.libffi-3.1
index 5768c10b4ac7..8f7f50d6f993 100644
--- a/js/src/ctypes/libffi/ChangeLog
+++ b/js/src/ctypes/libffi/ChangeLog.libffi-3.1
@@ -1,3 +1,1692 @@
+2014-03-16 Josh Triplett
+
+ * ChangeLog: Archive to ChangeLog.libffi-3.1 and delete. Future
+ changelogs will come from git, with autogenerated snapshots shipped in
+ distributed tarballs.
+
+2014-03-16 Josh Triplett
+
+ Add support for stdcall, thiscall, and fastcall on non-Windows
+ x86-32.
+
+ Linux supports the stdcall calling convention, either via
+ functions explicitly declared with the stdcall attribute, or via
+ code compiled with -mrtd which effectively makes stdcall the
+ default.
+
+ This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
+ non-Windows x86-32 platforms, as non-default calling conventions.
+
+ * Makefile.am: Compile in src/x86/win32.S on non-Windows x86-32.
+ * src/x86/ffitarget.h: Add FFI_STDCALL, FFI_THISCALL, and
+ FFI_FASTCALL on non-Windows x86-32. Increase trampoline size to
+ accomodate these calling conventions, and unify some ifdeffery.
+ * src/x86/ffi.c: Add support for FFI_STDCALL, FFI_THISCALL, and
+ FFI_FASTCALL on non-Windows x86-32 platforms; update ifdeffery.
+ * src/x86/win32.S: Support compiling on non-Windows x86-32
+ platforms. On those platforms, avoid redefining the SYSV symbols
+ already provided by src/x86/sysv.S.
+ * testsuite/libffi.call/closure_stdcall.c: Run on non-Windows.
+ #define __stdcall if needed.
+ * testsuite/libffi.call/closure_thiscall.c: Run on non-Windows.
+ #define __fastcall if needed.
+ * testsuite/libffi.call/fastthis1_win32.c: Run on non-Windows.
+ * testsuite/libffi.call/fastthis2_win32.c: Ditto.
+ * testsuite/libffi.call/fastthis3_win32.c: Ditto.
+ * testsuite/libffi.call/many2_win32.c: Ditto.
+ * testsuite/libffi.call/many_win32.c: Ditto.
+ * testsuite/libffi.call/strlen2_win32.c: Ditto.
+ * testsuite/libffi.call/strlen_win32.c: Ditto.
+ * testsuite/libffi.call/struct1_win32.c: Ditto.
+ * testsuite/libffi.call/struct2_win32.c: Ditto.
+
+2014-03-16 Josh Triplett
+
+ * prep_cif.c: Remove unnecessary ifdef for X86_WIN32.
+ ffi_prep_cif_core had a special case for X86_WIN32, checking for
+ FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI
+ range before returning FFI_BAD_ABI. However, on X86_WIN32,
+ FFI_THISCALL already falls in that range, making the special case
+ unnecessary. Remove it.
+
+2014-03-16 Josh Triplett
+
+ * testsuite/libffi.call/closure_stdcall.c,
+ testsuite/libffi.call/closure_thiscall.c: Remove fragile stack
+ pointer checks. These files included inline assembly to save the
+ stack pointer before and after the call, and compare the values.
+ However, compilers can and do leave the stack in different states
+ for these two pieces of inline assembly, such as by saving a
+ temporary value on the stack across the call; observed with gcc
+ -Os, and verified as spurious through careful inspection of
+ disassembly.
+
+2014-03-16 Josh Triplett
+
+ * testsuite/libffi.call/many.c: Avoid spurious failure due to
+ excess floating-point precision.
+ * testsuite/libffi.call/many_win32.c: Ditto.
+
+2014-03-16 Josh Triplett
+
+ * libtool-ldflags: Re-add.
+
+2014-03-16 Josh Triplett
+
+ * Makefile.in, aclocal.m4, compile, config.guess, config.sub,
+ configure, depcomp, include/Makefile.in, install-sh,
+ libtool-ldflags, ltmain.sh, m4/libtool.m4, m4/ltoptions.m4,
+ m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4,
+ man/Makefile.in, mdate-sh, missing, testsuite/Makefile.in: Delete
+ autogenerated files from version control.
+ * .gitignore: Add autogenerated files.
+ * autogen.sh: New script to generate the autogenerated files.
+ * README: Document requirement to run autogen.sh when building
+ directly from version control.
+ * .travis.yml: Run autogen.sh
+
+2014-03-14 Anthony Green
+
+ * configure, Makefile.in: Rebuilt.
+
+2014-03-10 Mike Hommey
+
+ * configure.ac: Allow building for mipsel with Android NDK r8.
+ * Makefile.am (AM_MAKEFLAGS): Replace double quotes with single
+ quotes.
+
+2014-03-10 Landry Breuil
+
+ * configure.ac: Ensure the linker supports @unwind sections in libffi.
+
+2014-03-01 Anthony Green
+
+ * Makefile.am (EXTRA_DIST): Replace old scripts with
+ generate-darwin-source-and-headers.py.
+ * Makefile.in: Rebuilt.
+
+2014-02-28 Anthony Green
+
+ * Makefile.am (AM_CFLAGS): Reintroduce missing -DFFI_DEBUG for
+ --enable-debug builds.
+ * Makefile.in: Rebuilt.
+
+2014-02-28 Makoto Kato
+
+ * src/closures.c: Fix build failure when using clang for Android.
+
+2014-02-28 Marcin Wojdyr
+
+ * libffi.pc.in (toolexeclibdir): use -L${toolexeclibdir} instead
+ of -L${libdir}.
+
+2014-02-28 Paulo Pizarro
+
+ * src/bfin/sysv.S: Calling functions in shared libraries requires
+ considering the GOT.
+
+2014-02-28 Josh Triplett
+
+ * src/x86/ffi64.c (classify_argument): Handle case where
+ FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE.
+
+2014-02-28 Anthony Green
+
+ * ltmain.sh: Generate with libtool-2.4.2.418.
+ * m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4: Ditto.
+ * configure: Rebuilt.
+
+2014-02-28 Dominik Vogt
+
+ * configure.ac (AC_ARG_ENABLE struct): Fix typo in help
+ message.
+ (AC_ARG_ENABLE raw_api): Ditto.
+ * configure, fficonfig.h.in: Rebuilt.
+
+2014-02-28 Will Newton
+
+ * src/arm/sysv.S: Initialize IP register with FP.
+
+2014-02-28 Yufeng Zhang
+
+ * src/aarch64/sysv.S (ffi_closure_SYSV): Use x29 as the
+ main CFA reg; update cfi_rel_offset.
+
+2014-02-15 Marcus Comstedt
+
+ * src/powerpc/ffi_linux64.c, src/powerpc/linux64_closure.S: Remove
+ assumption on contents of r11 in closure.
+
+2014-02-09 Heiher
+
+ * src/mips/n32.S: Fix call floating point va function.
+
+2014-01-21 Zachary Waldowski
+
+ * src/aarch64/ffi.c: Fix missing semicolons on assertions under
+ debug mode.
+
+2013-12-30 Zachary Waldowski
+
+ * .gitignore: Exclude darwin_* generated source and build_* trees.
+ * src/aarch64/ffi.c, src/arm/ffi.c, src/x86/ffi.c: Inhibit Clang
+ previous prototype warnings.
+ * src/arm/ffi.c: Prevent NULL dereference, fix short type warning
+ * src/dlmalloc.c: Fix warnings from set_segment_flags return type,
+ and the native use of size_t for malloc on platforms
+ * src/arm/sysv.S: Use unified syntax. Clang clean-ups for
+ ARM_FUNC_START.
+ * generate-osx-source-and-headers.py: Remove.
+ * build-ios.sh: Remove.
+ * libffi.xcodeproj/project.pbxproj: Rebuild targets. Include
+ x86_64+aarch64 pieces in library. Export headers properly.
+ * src/x86/ffi64.c: More Clang warning clean-ups.
+ * src/closures.c (open_temp_exec_file_dir): Use size_t.
+ * src/prep_cif.c (ffi_prep_cif_core): Cast ALIGN result.
+ * src/aarch64/sysv.S: Use CNAME for global symbols. Only use
+ .size for ELF targets.
+ * src/aarch64/ffi.c: Clean up for double == long double. Clean up
+ from Clang warnings. Use Clang cache invalidation builtin. Use
+ size_t in place of unsigned in many places. Accommodate for
+ differences in Apple AArch64 ABI.
+
+2013-12-02 Daniel RodrÃguez Troitiño
+
+ * generate-darwin-source-and-headers.py: Clean up, modernize,
+ merged version of previous scripts.
+
+2013-11-21 Anthony Green
+
+ * configure, Makefile.in, include/Makefile.in, include/ffi.h.in,
+ man/Makefile.in, testsuite/Makefile.in, fficonfig.h.in: Rebuilt.
+
+2013-11-21 Alan Modra
+
+ * Makefile.am (EXTRA_DIST): Add new src/powerpc files.
+ (nodist_libffi_la_SOURCES ): Likewise.
+ * configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc.
+ * include/ffi.h.in (ffi_prep_types): Declare.
+ * src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types.
+ * src/types.c (FFI_NONCONST_TYPEDEF): Define and use for
+ HAVE_LONG_DOUBLE_VARIANT.
+ * src/powerpc/ffi_powerpc.h: New file.
+ * src/powerpc/ffi.c: Split into..
+ * src/powerpc/ffi_sysv.c: ..new file, and..
+ * src/powerpc/ffi_linux64.c: ..new file, rewriting parts.
+ * src/powerpc/ffitarget.h (enum ffi_abi): Rewrite powerpc ABI
+ selection as bits controlling features.
+ * src/powerpc/linux64.S: For consistency, use POWERPC64 rather
+ than __powerpc64__.
+ * src/powerpc/linux64_closure.S: Likewise.
+ * src/powerpc/ppc_closure.S: Likewise. Move .note.FNU-stack
+ inside guard.
+ * src/powerpc/sysv.S: Likewise.
+ * configure: Regenerate.
+ * fficonfig.h.in: Regenerate.
+ * Makefile.in: Regenerate.
+
+2013-11-20 Alan Modra
+
+ * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use
+ NUM_FPR_ARG_REGISTERS64 and NUM_GPR_ARG_REGISTERS64 not their
+ 32-bit versions for 64-bit code.
+ * src/powerpc/linux64_closure.S: Don't use the return value area
+ as a parameter save area on ELFv2.
+
+2013-11-18 Iain Sandoe
+
+ * src/powerpc/darwin.S (EH): Correct use of pcrel FDE encoding.
+ * src/powerpc/darwin_closure.S (EH): Likewise. Modernise picbase
+ labels.
+
+2013-11-18 Anthony Green
+
+ * src/arm/ffi.c (ffi_call): Hoist declaration of temp to top of
+ function.
+ * src/arm/ffi.c (ffi_closure_inner): Moderize function declaration
+ to appease compiler.
+ Thanks for Gregory P. Smith .
+
+2013-11-18 Anthony Green
+
+ * README (tested): Mention PowerPC ELFv2.
+
+2013-11-16 Alan Modra
+
+ * src/powerpc/ppc_closure.S: Move errant #endif to where it belongs.
+ Don't bl .Luint128.
+
+2013-11-16 Alan Modra
+
+ * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use #if _CALL_ELF
+ test to select parameter save sizing for ELFv2 vs. ELFv1.
+ * src/powerpc/ffitarget.h (FFI_V2_TYPE_FLOAT_HOMOG,
+ FFI_V2_TYPE_DOUBLE_HOMOG, FFI_V2_TYPE_SMALL_STRUCT): Define.
+ (FFI_TRAMPOLINE_SIZE): Define variant for ELFv2.
+ * src/powerpc/ffi.c (FLAG_ARG_NEEDS_PSAVE): Define.
+ (discover_homogeneous_aggregate): New function.
+ (ffi_prep_args64): Adjust start of param save area for ELFv2.
+ Handle homogenous floating point struct parms.
+ (ffi_prep_cif_machdep_core): Adjust space calculation for ELFv2.
+ Handle ELFv2 return values. Set FLAG_ARG_NEEDS_PSAVE. Handle
+ homogenous floating point structs.
+ (ffi_call): Increase size of smst_buffer for ELFv2. Handle ELFv2.
+ (flush_icache): Compile for ELFv2.
+ (ffi_prep_closure_loc): Set up ELFv2 trampoline.
+ (ffi_closure_helper_LINUX64): Don't return all structs directly
+ to caller. Handle homogenous floating point structs. Handle
+ ELFv2 struct return values.
+ * src/powerpc/linux64.S (ffi_call_LINUX64): Set up r2 for
+ ELFv2. Adjust toc save location. Call function pointer using
+ r12. Handle FLAG_RETURNS_SMST. Don't predict branches.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Set up r2
+ for ELFv2. Define ELFv2 versions of STACKFRAME, PARMSAVE, and
+ RETVAL. Handle possibly missing parameter save area. Handle
+ ELFv2 return values.
+ (.note.GNU-stack): Move inside outer #ifdef.
+
+2013-11-16 Alan Modra
+
+ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Revert 2013-02-08
+ change. Do not consume an int arg when returning a small struct
+ for FFI_SYSV ABI.
+ (ffi_call): Only use bounce buffer when FLAG_RETURNS_SMST.
+ Properly copy bounce buffer to destination.
+ * src/powerpc/sysv.S: Revert 2013-02-08 change.
+ * src/powerpc/ppc_closure.S: Remove stray '+'.
+
+2013-11-16 Alan Modra
+
+ * src/powerpc/ffi.c (ffi_prep_args64): Align struct parameters
+ according to __STRUCT_PARM_ALIGN__.
+ (ffi_prep_cif_machdep_core): Likewise.
+ (ffi_closure_helper_LINUX64): Likewise.
+
+2013-11-16 Alan Modra
+
+ * src/powerpc/linux64.S (ffi_call_LINUX64): Tweak restore of r28.
+ (.note.GNU-stack): Move inside outer #ifdef.
+ * src/powerpc/linux64_closure.S (STACKFRAME, PARMSAVE,
+ RETVAL): Define and use throughout.
+ (ffi_closure_LINUX64): Save fprs before buying stack.
+ (.note.GNU-stack): Move inside outer #ifdef.
+
+2013-11-16 Alan Modra
+
+ * src/powerpc/ffitarget.h (FFI_TARGET_SPECIFIC_VARIADIC): Define.
+ (FFI_EXTRA_CIF_FIELDS): Define.
+ * src/powerpc/ffi.c (ffi_prep_args64): Save fprs as per the
+ ABI, not to both fpr and param save area.
+ (ffi_prep_cif_machdep_core): Renamed from ffi_prep_cif_machdep.
+ Keep initial flags. Formatting. Remove dead FFI_LINUX_SOFT_FLOAT
+ code.
+ (ffi_prep_cif_machdep, ffi_prep_cif_machdep_var): New functions.
+ (ffi_closure_helper_LINUX64): Pass floating point as per ABI,
+ not to both fpr and parameter save areas.
+
+ * libffi/testsuite/libffi.call/cls_double_va.c (main): Correct
+ function cast and don't call ffi_prep_cif.
+ * libffi/testsuite/libffi.call/cls_longdouble_va.c (main): Likewise.
+
+2013-11-15 Andrew Haley
+
+ * doc/libffi.texi (Closure Example): Fix the sample code.
+ * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt.
+
+2013-11-15 Andrew Haley
+
+ * testsuite/libffi.call/va_struct1.c (main): Fix broken test.
+ * testsuite/libffi.call/cls_uint_va.c (cls_ret_T_fn): Likewise
+ * testsuite/libffi.call/cls_struct_va1.c (test_fn): Likewise.
+ * testsuite/libffi.call/va_1.c (main): Likewise.
+
+2013-11-14 David Schneider
+
+ * src/arm/ffi.c: Fix register allocation for mixed float and
+ doubles.
+ * testsuite/libffi.call/cls_many_mixed_float_double.c: Testcase
+ for many mixed float and double arguments.
+
+2013-11-13 Alan Modra
+
+ * doc/libffi.texi (Simple Example): Correct example code.
+ * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt.
+
+2013-11-13 Anthony Green
+
+ * include/ffi_common.h: Respect HAVE_ALLOCA_H for GNU compiler
+ based build. (Thanks to tmr111116 on github)
+
+2013-11-09 Anthony Green
+
+ * m4/libtool.m4: Refresh.
+ * configure, Makefile.in: Rebuilt.
+ * README: Add more notes about next release.
+
+2013-11-09 Shigeharu TAKENO
+
+ * m4/ax_gcc_archflag.m4 (ax_gcc_arch): Don't recognize
+ UltraSPARC-IIi as ultrasparc3.
+
+2013-11-06 Mark Kettenis
+
+ * src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to
+ 16-bytes.
+
+2013-11-06 Konstantin Belousov
+
+ * src/x86/freebsd.S (ffi_closure_raw_SYSV): Mark the assembler
+ source as not requiring executable stack.
+
+2013-11-02 Anthony Green
+
+ * doc/libffi.texi (The Basics): Clarify return value buffer size
+ requirements. Also, NULL result buffer pointers are no longer
+ supported.
+ * doc/libffi.info: Rebuilt.
+
+2013-11-02 Mischa Jonker
+
+ * Makefile.am (nodist_libffi_la_SOURCES): Fix build error.
+ * Makefile.in: Rebuilt.
+
+2013-11-02 David Schneider
+
+ * src/arm/ffi.c: more robust argument handling for closures on arm hardfloat
+ * testsuite/libffi.call/many_mixed.c: New file.
+ * testsuite/libffi.call/cls_many_mixed_args.c: More tests.
+
+2013-11-02 Vitaly Budovski
+
+ * src/x86/ffi.c (ffi_prep_cif_machdep): Don't align stack for win32.
+
+2013-10-23 Mark H Weaver
+
+ * src/mips/ffi.c: Fix handling of uint32_t arguments on the
+ MIPS N32 ABI.
+
+2013-10-13 Sandra Loosemore
+
+ * README: Add Nios II to table of supported platforms.
+ * Makefile.am (EXTRA_DIST): Add nios2 files.
+ (nodist_libffi_la_SOURCES): Likewise.
+ * Makefile.in: Regenerated.
+ * configure.ac (nios2*-linux*): New host.
+ (NIOS2): Add AM_CONDITIONAL.
+ * configure: Regenerated.
+ * src/nios2/ffi.c: New.
+ * src/nios2/ffitarget.h: New.
+ * src/nios2/sysv.S: New.
+ * src/prep_cif.c (initialize_aggregate): Handle extra structure
+ alignment via FFI_AGGREGATE_ALIGNMENT.
+ (ffi_prep_cif_core): Conditionalize structure return for NIOS2.
+
+2013-10-10 Sandra Loosemore
+
+ * testsuite/libffi.call/cls_many_mixed_args.c (cls_ret_double_fn):
+ Fix uninitialized variable.
+
+2013-10-11 Marcus Shawcroft
+
+ * testsuite/libffi.call/many.c (many): Replace * with +.
+
+2013-10-08 OndÅ™ej BÃlka
+
+ * src/aarch64/ffi.c, src/aarch64/sysv.S, src/arm/ffi.c,
+ src/arm/gentramp.sh, src/bfin/sysv.S, src/closures.c,
+ src/dlmalloc.c, src/ia64/ffi.c, src/microblaze/ffi.c,
+ src/microblaze/sysv.S, src/powerpc/darwin_closure.S,
+ src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/sh/ffi.c,
+ src/tile/tile.S, testsuite/libffi.call/nested_struct11.c: Fix
+ spelling errors.
+
+2013-10-08 Anthony Green
+
+ * aclocal.m4, compile, config.guess, config.sub, depcomp,
+ install-sh, mdate-sh, missing, texinfo.tex: Update from upstream.
+ * configure.ac: Update version to 3.0.14-rc0.
+ * Makefile.in, configure, Makefile.in, include/Makefile.in,
+ man/Makefile.in, testsuite/Makefile.in: Rebuilt.
+ * README: Mention M88K and VAX.
+
+2013-07-15 Miod Vallat
+
+ * Makefile.am,
+ configure.ac,
+ src/m88k/ffi.c,
+ src/m88k/ffitarget.h,
+ src/m88k/obsd.S,
+ src/vax/elfbsd.S,
+ src/vax/ffi.c,
+ src/vax/ffitarget.h: Add m88k and vax support.
+
+2013-06-24 Alan Modra
+
+ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Move var declaration
+ before statements.
+ (ffi_prep_args64): Support little-endian.
+ (ffi_closure_helper_SYSV, ffi_closure_helper_LINUX64): Likewise.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise.
+ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Likewise.
+
+2013-06-12 Mischa Jonker
+
+ * configure.ac: Add support for ARC.
+ * Makefile.am: Likewise.
+ * README: Add ARC details.
+ * src/arc/arcompact.S: New.
+ * src/arc/ffi.c: Likewise.
+ * src/arc/ffitarget.h: Likewise.
+
+2013-03-28 David Schneider
+
+ * src/arm/ffi.c: Fix support for ARM hard-float calling convention.
+ * src/arm/sysv.S: call different methods for SYSV and VFP ABIs.
+ * testsuite/libffi.call/cls_many_mixed_args.c: testcase for a closure with
+ mixed arguments, many doubles.
+ * testsuite/libffi.call/many_double.c: testcase for calling a function using
+ more than 8 doubles.
+ * testcase/libffi.call/many.c: use absolute value to check result against an
+ epsilon
+
+2013-03-17 Anthony Green
+
+ * README: Update for 3.0.13.
+ * configure.ac: Ditto.
+ * configure: Rebuilt.
+ * doc/*: Update version.
+
+2013-03-17 Dave Korn
+
+ * src/closures.c (is_emutramp_enabled
+ [!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside
+ enclosing #if scope.
+
+2013-03-17 Anthony Green
+
+ * configure.ac: Only modify toolexecdir in certain cases.
+ * configure: Rebuilt.
+
+2013-03-16 Gilles Talis
+
+ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Don't use
+ fparg_count,etc on __NO_FPRS__ targets.
+
+2013-03-16 Alan Hourihane
+
+ * src/m68k/sysv.S (epilogue): Don't use extb instruction on
+ m680000 machines.
+
+2013-03-16 Alex Gaynor
+
+ * src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack.
+
+2013-03-13 Markos Chandras
+
+ * configure.ac: Add support for Imagination Technologies Meta.
+ * Makefile.am: Likewise.
+ * README: Add Imagination Technologies Meta details.
+ * src/metag/ffi.c: New.
+ * src/metag/ffitarget.h: Likewise.
+ * src/metag/sysv.S: Likewise.
+
+2013-02-24 Andreas Schwab
+
+ * doc/libffi.texi (Structures): Fix missing category argument of
+ @deftp.
+
+2013-02-11 Anthony Green
+
+ * configure.ac: Update release number to 3.0.12.
+ * configure: Rebuilt.
+ * README: Update release info.
+
+2013-02-10 Anthony Green
+
+ * README: Add Moxie.
+ * src/moxie/ffi.c: Created.
+ * src/moxie/eabi.S: Created.
+ * src/moxie/ffitarget.h: Created.
+ * Makefile.am (nodist_libffi_la_SOURCES): Add Moxie.
+ * Makefile.in: Rebuilt.
+ * configure.ac: Add Moxie.
+ * configure: Rebuilt.
+ * testsuite/libffi.call/huge_struct.c: Disable format string
+ warnings for moxie*-*-elf tests.
+
+2013-02-10 Anthony Green
+
+ * Makefile.am (LTLDFLAGS): Fix reference.
+ * Makefile.in: Rebuilt.
+
+2013-02-10 Anthony Green
+
+ * README: Update supported platforms. Update test results link.
+
+2013-02-09 Anthony Green
+
+ * testsuite/libffi.call/negint.c: Remove forced -O2.
+ * testsuite/libffi.call/many2.c (foo): Remove GCCism.
+ * testsuite/libffi.call/ffitest.h: Add default PRIuPTR definition.
+
+ * src/sparc/v8.S (ffi_closure_v8): Import ancient ulonglong
+ closure return type fix developed by Martin v. Löwis for cpython
+ fork.
+
+2013-02-08 Andreas Tobler
+
+ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix small struct
+ support.
+ * src/powerpc/sysv.S: Ditto.
+
+2013-02-08 Anthony Green
+
+ * testsuite/libffi.call/cls_longdouble.c: Remove xfail for
+ arm*-*-*.
+
+2013-02-08 Anthony Green
+
+ * src/sparc/ffi.c (ffi_prep_closure_loc): Fix cache flushing for GCC.
+
+2013-02-08 Matthias Klose
+
+ * man/ffi_prep_cif.3: Clean up for debian linter.
+
+2013-02-08 Peter Bergner
+
+ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed
+ on the stack.
+
+2013-02-08 Anthony Green
+
+ * Makefile.am (EXTRA_DIST): Add missing files.
+ * testsuite/Makefile.am (EXTRA_DIST): Ditto.
+ * Makefile.in: Rebuilt.
+
+2013-02-08 Anthony Green
+
+ * configure.ac: Move sparc asm config checks to within functions
+ for compatibility with sun tools.
+ * configure: Rebuilt.
+ * src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9
+ systems.
+ * src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache
+ flusher.
+
+2013-02-08 Nathan Rossi
+
+ * src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of
+ small big-endian structures.
+ (ffi_prep_args): Ditto.
+
+2013-02-07 Anthony Green
+
+ * src/sparc/v8.S (ffi_call_v8): Fix typo from last patch
+ (effectively hiding ffi_call_v8).
+
+2013-02-07 Anthony Green
+
+ * configure.ac: Update bug reporting address.
+ * configure.in: Rebuild.
+
+ * src/sparc/v8.S (ffi_flush_icache): Out-of-line cache flusher for
+ Sun compiler.
+ * src/sparc/ffi.c (ffi_call): Remove warning.
+ Call ffi_flush_icache for non-GCC builds.
+ (ffi_prep_closure_loc): Use ffi_flush_icache.
+
+ * Makefile.am (EXTRA_DIST): Add libtool-ldflags.
+ * Makefile.in: Rebuilt.
+ * libtool-ldflags: New file.
+
+2013-02-07 Daniel Schepler
+
+ * configure.ac: Correctly identify x32 systems as 64-bit.
+ * m4/libtool.m4: Remove libtool expr error.
+ * aclocal.m4, configure: Rebuilt.
+
+2013-02-07 Anthony Green
+
+ * configure.ac: Fix GCC usage test.
+ * configure: Rebuilt.
+ * README: Mention LLVM/GCC x86_64 issue.
+ * testsuite/Makefile.in: Rebuilt.
+
+2013-02-07 Anthony Green
+
+ * testsuite/libffi.call/cls_double_va.c (main): Replace // style
+ comments with /* */ for xlc compiler.
+ * testsuite/libffi.call/stret_large.c (main): Ditto.
+ * testsuite/libffi.call/stret_large2.c (main): Ditto.
+ * testsuite/libffi.call/nested_struct1.c (main): Ditto.
+ * testsuite/libffi.call/huge_struct.c (main): Ditto.
+ * testsuite/libffi.call/float_va.c (main): Ditto.
+ * testsuite/libffi.call/cls_struct_va1.c (main): Ditto.
+ * testsuite/libffi.call/cls_pointer_stack.c (main): Ditto.
+ * testsuite/libffi.call/cls_pointer.c (main): Ditto.
+ * testsuite/libffi.call/cls_longdouble_va.c (main): Ditto.
+
+2013-02-06 Anthony Green
+
+ * man/ffi_prep_cif.3: Clean up for debian lintian checker.
+
+2013-02-06 Anthony Green
+
+ * Makefile.am (pkgconfigdir): Add missing pkgconfig install bits.
+ * Makefile.in: Rebuild.
+
+2013-02-02 Mark H Weaver
+
+ * src/x86/ffi64.c (ffi_call): Sign-extend integer arguments passed
+ via general purpose registers.
+
+2013-01-21 Nathan Rossi
+
+ * README: Add MicroBlaze details.
+ * Makefile.am: Add MicroBlaze support.
+ * configure.ac: Likewise.
+ * src/microblaze/ffi.c: New.
+ * src/microblaze/ffitarget.h: Likewise.
+ * src/microblaze/sysv.S: Likewise.
+
+2013-01-21 Nathan Rossi
+ * testsuite/libffi.call/return_uc.c: Fixed issue.
+
+2013-01-21 Chris Zankel
+
+ * README: Add Xtensa support.
+ * Makefile.am: Likewise.
+ * configure.ac: Likewise.
+ * Makefile.in Regenerate.
+ * configure: Likewise.
+ * src/prep_cif.c: Handle Xtensa.
+ * src/xtensa: New directory.
+ * src/xtensa/ffi.c: New file.
+ * src/xtensa/ffitarget.h: Ditto.
+ * src/xtensa/sysv.S: Ditto.
+
+2013-01-11 Anthony Green
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style
+ comments with /* */ for xlc compiler.
+ * src/powerpc/aix.S (ffi_call_AIX): Ditto.
+ * testsuite/libffi.call/ffitest.h (allocate_mmap): Delete
+ deprecated inline function.
+ * testsuite/libffi.special/ffitestcxx.h: Ditto.
+ * README: Add update for AIX support.
+
+2013-01-11 Anthony Green
+
+ * configure.ac: Robustify pc relative reloc check.
+ * m4/ax_cc_maxopt.m4: Don't -malign-double. This is an ABI
+ changing option for 32-bit x86.
+ * aclocal.m4, configure: Rebuilt.
+ * README: Update supported target list.
+
+2013-01-10 Anthony Green
+
+ * README (tested): Add Compiler column to table.
+
+2013-01-10 Anthony Green
+
+ * src/x86/ffi64.c (struct register_args): Make sse array and array
+ of unions for sunpro compiler compatibility.
+
+2013-01-10 Anthony Green
+
+ * configure.ac: Test target platform size_t size. Handle both 32
+ and 64-bit builds for x86_64-* and i?86-* targets (allowing for
+ CFLAG option to change default settings).
+ * configure, aclocal.m4: Rebuilt.
+
+2013-01-10 Anthony Green
+
+ * testsuite/libffi.special/special.exp: Only run exception
+ handling tests when using GNU compiler.
+
+ * m4/ax_compiler_vendor.m4: New file.
+ * configure.ac: Test for compiler vendor and don't use
+ AX_CFLAGS_WARN_ALL with the sun compiler.
+ * aclocal.m4, configure: Rebuilt.
+
+2013-01-10 Anthony Green
+
+ * include/ffi_common.h: Don't use GCCisms to define types when
+ building with the SUNPRO compiler.
+
+2013-01-10 Anthony Green
+
+ * configure.ac: Put local.exp in the right place.
+ * configure: Rebuilt.
+
+ * src/x86/ffi.c: Update comment about regparm function attributes.
+ * src/x86/sysv.S (ffi_closure_SYSV): The SUNPRO compiler requires
+ that all function arguments be passed on the stack (no regparm
+ support).
+
+2013-01-08 Anthony Green
+
+ * configure.ac: Generate local.exp. This sets CC_FOR_TARGET
+ when we are using the vendor compiler.
+ * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): Point to
+ ../local.exp.
+ * configure, testsuite/Makefile.in: Rebuilt.
+
+ * testsuite/libffi.call/call.exp: Run tests with different
+ options, depending on whether or not we are using gcc or the
+ vendor compiler.
+ * testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on
+ whether or not we are building/testing with gcc.
+
+2013-01-08 Anthony Green
+
+ * configure.ac: Switch x86 solaris target to X86 by default.
+ * configure: Rebuilt.
+
+2013-01-08 Anthony Green
+
+ * configure.ac: Fix test for read-only eh_frame.
+ * configure: Rebuilt.
+
+2013-01-08 Anthony Green
+
+ * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info
+ when building with the GNU toolchain.
+ * testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor
+ compiler.
+
+2013-01-07 Thorsten Glaser
+
+ * testsuite/libffi.call/cls_uchar_va.c,
+ testsuite/libffi.call/cls_ushort_va.c,
+ testsuite/libffi.call/va_1.c: Testsuite fixes.
+
+2013-01-07 Thorsten Glaser
+
+ * src/m68k/ffi.c (CIF_FLAGS_SINT8, CIF_FLAGS_SINT16): Define.
+ (ffi_prep_cif_machdep): Fix 8-bit and 16-bit signed calls.
+ * src/m68k/sysv.S (ffi_call_SYSV, ffi_closure_SYSV): Ditto.
+
+2013-01-04 Anthony Green
+
+ * Makefile.am (AM_CFLAGS): Don't automatically add -fexceptions
+ and -Wall. This is set in the configure script after testing for
+ GCC.
+ * Makefile.in: Rebuilt.
+
+2013-01-02 rofl0r
+
+ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix build error on ppc
+ when long double == double.
+
+2013-01-02 Reini Urban
+
+ * Makefile.am (libffi_la_LDFLAGS): Add -no-undefined to LDFLAGS
+ (required for shared libs on cygwin/mingw).
+ * Makefile.in: Rebuilt.
+
+2012-10-31 Alan Modra
+
+ * src/powerpc/linux64_closure.S: Add new ABI support.
+ * src/powerpc/linux64.S: Likewise.
+
+2012-10-30 Magnus Granberg
+ Pavel Labushev
+
+ * configure.ac: New options pax_emutramp
+ * configure, fficonfig.h.in: Regenerated
+ * src/closures.c: New function emutramp_enabled_check() and
+ checks.
+
+2012-10-30 Frederick Cheung
+
+ * configure.ac: Enable FFI_MAP_EXEC_WRIT for Darwin 12 (mountain
+ lion) and future version.
+ * configure: Rebuild.
+
+2012-10-30 James Greenhalgh
+ Marcus Shawcroft
+
+ * README: Add details of aarch64 port.
+ * src/aarch64/ffi.c: New.
+ * src/aarch64/ffitarget.h: Likewise.
+ * src/aarch64/sysv.S: Likewise.
+ * Makefile.am: Support aarch64.
+ * configure.ac: Support aarch64.
+ * Makefile.in, configure: Rebuilt.
+
+2012-10-30 James Greenhalgh
+ Marcus Shawcroft
+
+ * testsuite/lib/libffi.exp: Add support for aarch64.
+ * testsuite/libffi.call/cls_struct_va1.c: New.
+ * testsuite/libffi.call/cls_uchar_va.c: Likewise.
+ * testsuite/libffi.call/cls_uint_va.c: Likewise.
+ * testsuite/libffi.call/cls_ulong_va.c: Likewise.
+ * testsuite/libffi.call/cls_ushort_va.c: Likewise.
+ * testsuite/libffi.call/nested_struct11.c: Likewise.
+ * testsuite/libffi.call/uninitialized.c: Likewise.
+ * testsuite/libffi.call/va_1.c: Likewise.
+ * testsuite/libffi.call/va_struct1.c: Likewise.
+ * testsuite/libffi.call/va_struct2.c: Likewise.
+ * testsuite/libffi.call/va_struct3.c: Likewise.
+
+2012-10-12 Walter Lee
+
+ * Makefile.am: Add TILE-Gx/TILEPro support.
+ * configure.ac: Likewise.
+ * Makefile.in: Regenerate.
+ * configure: Likewise.
+ * src/prep_cif.c (ffi_prep_cif_core): Handle TILE-Gx/TILEPro.
+ * src/tile: New directory.
+ * src/tile/ffi.c: New file.
+ * src/tile/ffitarget.h: Ditto.
+ * src/tile/tile.S: Ditto.
+
+2012-10-12 Matthias Klose
+
+ * generate-osx-source-and-headers.py: Normalize whitespace.
+
+2012-09-14 David Edelsohn
+
+ * configure: Regenerated.
+
+2012-08-26 Andrew Pinski
+
+ PR libffi/53014
+ * src/mips/ffi.c (ffi_prep_closure_loc): Allow n32 with soft-float and n64 with
+ soft-float.
+
+2012-08-08 Uros Bizjak
+
+ * src/s390/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
+ just return FFI_BAD_ABI when things are wrong.
+
+2012-07-18 H.J. Lu
+
+ PR libffi/53982
+ PR libffi/53973
+ * src/x86/ffitarget.h: Check __ILP32__ instead of __LP64__ for x32.
+ (FFI_SIZEOF_JAVA_RAW): Defined to 4 for x32.
+
+2012-05-16 H.J. Lu
+
+ * configure: Regenerated.
+
+2012-05-05 Nicolas Lelong
+
+ * libffi.xcodeproj/project.pbxproj: Fixes.
+ * README: Update for iOS builds.
+
+2012-04-23 Alexandre Keunecke I. de Mendonca
+
+ * configure.ac: Add Blackfin/sysv support
+ * Makefile.am: Add Blackfin/sysv support
+ * src/bfin/ffi.c: Add Blackfin/sysv support
+ * src/bfin/ffitarget.h: Add Blackfin/sysv support
+
+2012-04-11 Anthony Green
+
+ * Makefile.am (EXTRA_DIST): Add new script.
+ * Makefile.in: Rebuilt.
+
+2012-04-11 Zachary Waldowski
+
+ * generate-ios-source-and-headers.py,
+ libffi.xcodeproj/project.pbxproj: Support a Mac static library via
+ Xcode. Set iOS compatibility to 4.0. Move iOS trampoline
+ generation into an Xcode "run script" phase. Include both as
+ Xcode build scripts. Don't always regenerate config files.
+
+2012-04-10 Anthony Green
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon.
+
+2012-04-06 Anthony Green
+
+ * Makefile.am (EXTRA_DIST): Add new iOS/xcode files.
+ * Makefile.in: Rebuilt.
+
+2012-04-06 Mike Lewis
+
+ * generate-ios-source-and-headers.py: New file.
+ * libffi.xcodeproj/project.pbxproj: New file.
+ * README: Update instructions on building iOS binary.
+ * build-ios.sh: Delete.
+
+2012-04-06 Anthony Green
+
+ * src/x86/ffi64.c (UINT128): Define differently for Intel and GNU
+ compilers, then use it.
+
+2012-04-06 H.J. Lu
+
+ * m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32.
+
+2012-04-06 Anthony Green
+
+ * testsuite/Makefile.am (EXTRA_DIST): Add missing test cases.
+ * testsuite/Makefile.in: Rebuilt.
+
+2012-04-05 Zachary Waldowski
+
+ * include/ffi.h.in: Add missing trampoline table fields.
+ * src/arm/sysv.S: Fix ENTRY definition, and wrap symbol references
+ in CNAME.
+ * src/x86/ffi.c: Wrap Windows specific code in ifdefs.
+
+2012-04-02 Peter Bergner
+
+ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp.
+ Silence casting pointer to integer of different size warning.
+ Delete goto to previously deleted label.
+ (ffi_call): Silence possibly undefined warning.
+ (ffi_closure_helper_SYSV): Declare variable type.
+
+2012-04-02 Peter Rosin
+
+ * src/x86/win32.S (ffi_call_win32): Sign/zero extend the return
+ value in the Intel version as is already done for the AT&T version.
+ (ffi_closure_SYSV): Likewise.
+ (ffi_closure_raw_SYSV): Likewise.
+ (ffi_closure_STDCALL): Likewise.
+
+2012-03-29 Peter Rosin
+
+ * src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame
+ generation, fix the ENDP label and remove the surplus third arg
+ from the 'lea' insn.
+
+2012-03-29 Peter Rosin
+
+ * src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label
+ visible outside the PROC, so that ffi_closure_raw_THISCALL can see
+ it. Also instruct the assembler to add a frame to the function.
+
+2012-03-23 Peter Rosin
+
+ * Makefile.am (AM_CPPFLAGS): Add -DFFI_BUILDING.
+ * Makefile.in: Rebuilt.
+ * include/ffi.h.in [MSVC]: Add __declspec(dllimport) decorations
+ to all data exports, when compiling libffi clients using MSVC.
+
+2012-03-29 Peter Rosin
+
+ * src/x86/ffitarget.h (ffi_abi): Add new ABI FFI_MS_CDECL and
+ make it the default for MSVC.
+ (FFI_TYPE_MS_STRUCT): New structure return convention.
+ * src/x86/ffi.c (ffi_prep_cif_machdep): Tweak the structure
+ return convention for FFI_MS_CDECL to be FFI_TYPE_MS_STRUCT
+ instead of an ordinary FFI_TYPE_STRUCT.
+ (ffi_prep_args): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT.
+ (ffi_call): Likewise.
+ (ffi_prep_incoming_args_SYSV): Likewise.
+ (ffi_raw_call): Likewise.
+ (ffi_prep_closure_loc): Treat FFI_MS_CDECL as FFI_SYSV.
+ * src/x86/win32.S (ffi_closure_SYSV): For FFI_TYPE_MS_STRUCT,
+ return a pointer to the result structure in eax and don't pop
+ that pointer from the stack, the caller takes care of it.
+ (ffi_call_win32): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT.
+ (ffi_closure_raw_SYSV): Likewise.
+
+2012-03-22 Peter Rosin
+
+ * testsuite/libffi.call/closure_stdcall.c [MSVC]: Add inline
+ assembly version with Intel syntax.
+ * testsuite/libffi.call/closure_thiscall.c [MSVC]: Likewise.
+
+2012-03-23 Peter Rosin
+
+ * testsuite/libffi.call/ffitest.h: Provide abstration of
+ __attribute__((fastcall)) in the form of a __FASTCALL__
+ define. Define it to __fastcall for MSVC.
+ * testsuite/libffi.call/fastthis1_win32.c: Use the above.
+ * testsuite/libffi.call/fastthis2_win32.c: Likewise.
+ * testsuite/libffi.call/fastthis3_win32.c: Likewise.
+ * testsuite/libffi.call/strlen2_win32.c: Likewise.
+ * testsuite/libffi.call/struct1_win32.c: Likewise.
+ * testsuite/libffi.call/struct2_win32.c: Likewise.
+
+2012-03-22 Peter Rosin
+
+ * src/x86/win32.S [MSVC] (ffi_closure_THISCALL): Remove the manual
+ frame on function entry, MASM adds one automatically.
+
+2012-03-22 Peter Rosin
+
+ * testsuite/libffi.call/ffitest.h [MSVC]: Add kludge for missing
+ bits in the MSVC headers.
+
+2012-03-22 Peter Rosin
+
+ * testsuite/libffi.call/cls_12byte.c: Adjust to the C89 style
+ with no declarations after statements.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_18byte.c: Likewise.
+ * testsuite/libffi.call/cls_19byte.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte1.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_5_1_byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.c: Likewise.
+ * testsuite/libffi.call/cls_64byte.c: Likewise.
+ * testsuite/libffi.call/cls_6_1_byte.c: Likewise.
+ * testsuite/libffi.call/cls_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7_1_byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_9byte1.c: Likewise.
+ * testsuite/libffi.call/cls_9byte2.c: Likewise.
+ * testsuite/libffi.call/cls_align_double.c: Likewise.
+ * testsuite/libffi.call/cls_align_float.c: Likewise.
+ * testsuite/libffi.call/cls_align_longdouble.c: Likewise.
+ * testsuite/libffi.call/cls_align_longdouble_split.c: Likewise.
+ * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise.
+ * testsuite/libffi.call/cls_align_pointer.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint16.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint32.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint64.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint16.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint32.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint64.c: Likewise.
+ * testsuite/libffi.call/cls_dbls_struct.c: Likewise.
+ * testsuite/libffi.call/cls_pointer_stack.c: Likewise.
+ * testsuite/libffi.call/err_bad_typedef.c: Likewise.
+ * testsuite/libffi.call/huge_struct.c: Likewise.
+ * testsuite/libffi.call/nested_struct.c: Likewise.
+ * testsuite/libffi.call/nested_struct1.c: Likewise.
+ * testsuite/libffi.call/nested_struct10.c: Likewise.
+ * testsuite/libffi.call/nested_struct2.c: Likewise.
+ * testsuite/libffi.call/nested_struct3.c: Likewise.
+ * testsuite/libffi.call/nested_struct4.c: Likewise.
+ * testsuite/libffi.call/nested_struct5.c: Likewise.
+ * testsuite/libffi.call/nested_struct6.c: Likewise.
+ * testsuite/libffi.call/nested_struct7.c: Likewise.
+ * testsuite/libffi.call/nested_struct8.c: Likewise.
+ * testsuite/libffi.call/nested_struct9.c: Likewise.
+ * testsuite/libffi.call/stret_large.c: Likewise.
+ * testsuite/libffi.call/stret_large2.c: Likewise.
+ * testsuite/libffi.call/stret_medium.c: Likewise.
+ * testsuite/libffi.call/stret_medium2.c: Likewise.
+ * testsuite/libffi.call/struct1.c: Likewise.
+ * testsuite/libffi.call/struct1_win32.c: Likewise.
+ * testsuite/libffi.call/struct2.c: Likewise.
+ * testsuite/libffi.call/struct2_win32.c: Likewise.
+ * testsuite/libffi.call/struct3.c: Likewise.
+ * testsuite/libffi.call/struct4.c: Likewise.
+ * testsuite/libffi.call/struct5.c: Likewise.
+ * testsuite/libffi.call/struct6.c: Likewise.
+ * testsuite/libffi.call/struct7.c: Likewise.
+ * testsuite/libffi.call/struct8.c: Likewise.
+ * testsuite/libffi.call/struct9.c: Likewise.
+ * testsuite/libffi.call/testclosure.c: Likewise.
+
+2012-03-21 Peter Rosin
+
+ * testsuite/libffi.call/float_va.c (float_va_fn): Use %f when
+ printing doubles (%lf is for long doubles).
+ (main): Likewise.
+
+2012-03-21 Peter Rosin
+
+ * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
+ (set_ld_library_path_env_vars): Add the library search dir to PATH
+ (and save PATH for later).
+ (restore_ld_library_path_env_vars): Restore PATH.
+
+2012-03-21 Peter Rosin
+
+ * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
+ (set_ld_library_path_env_vars): Add the library search dir to PATH
+ (and save PATH for later).
+ (restore_ld_library_path_env_vars): Restore PATH.
+
+2012-03-20 Peter Rosin
+
+ * testsuite/libffi.call/strlen2_win32.c (main): Remove bug.
+ * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label
+ visible outside the PROC, so that ffi_closure_THISCALL can see it.
+
+2012-03-20 Peter Rosin
+
+ * testsuite/libffi.call/strlen2_win32.c (main): Remove bug.
+ * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label
+ visible outside the PROC, so that ffi_closure_THISCALL can see it.
+
+2012-03-19 Alan Hourihane
+
+ * src/m68k/ffi.c: Add MINT support.
+ * src/m68k/sysv.S: Ditto.
+
+2012-03-06 Chung-Lin Tang
+
+ * src/arm/ffi.c (ffi_call): Add __ARM_EABI__ guard around call to
+ ffi_call_VFP().
+ (ffi_prep_closure_loc): Add __ARM_EABI__ guard around use of
+ ffi_closure_VFP.
+ * src/arm/sysv.S: Add __ARM_EABI__ guard around VFP code.
+
+2012-03-19 chennam
+
+ * src/powerpc/ffi_darwin.c (ffi_prep_closure_loc): Fix AIX closure
+ support.
+
+2012-03-13 Kaz Kojima
+
+ * src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
+ just return FFI_BAD_ABI when things are wrong.
+ * src/sh64/ffi.c (ffi_prep_closure_loc): Ditto.
+
+2012-03-09 David Edelsohn
+
+ * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64
+ change to return value of ffi_closure_helper_DARWIN and load type
+ from return type.
+
+2012-03-03 H.J. Lu
+
+ * src/x86/ffi64.c (ffi_call): Cast the return value to unsigned
+ long.
+ (ffi_prep_closure_loc): Cast to 64bit address in trampoline.
+ (ffi_closure_unix64_inner): Cast return pointer to unsigned long
+ first.
+
+ * src/x86/ffitarget.h (FFI_SIZEOF_ARG): Defined to 8 for x32.
+ (ffi_arg): Set to unsigned long long for x32.
+ (ffi_sarg): Set to long long for x32.
+
+2012-03-03 H.J. Lu
+
+ * src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI.
+
+2012-03-03 Andoni Morales Alastruey
+
+ * configure.ac: Add -no-undefined for both 32- and 64-bit x86
+ windows-like hosts.
+ * configure: Rebuilt.
+
+2012-02-27 Mikael Pettersson
+
+ PR libffi/52223
+ * Makefile.am (FLAGS_TO_PASS): Define.
+ * Makefile.in: Regenerate.
+
+2012-02-23 Anthony Green
+
+ * src/*/ffitarget.h: Ensure that users never include ffitarget.h
+ directly.
+
+2012-02-23 Kai Tietz
+
+ PR libffi/52221
+ * src/x86/ffi.c (ffi_closure_raw_THISCALL): New
+ prototype.
+ (ffi_prep_raw_closure_loc): Use ffi_closure_raw_THISCALL for
+ thiscall-convention.
+ (ffi_raw_call): Use ffi_prep_args_raw.
+ * src/x86/win32.S (ffi_closure_raw_THISCALL): Add
+ implementation for stub.
+
+2012-02-10 Kai Tietz
+
+ * configure.ac (AM_LTLDFLAGS): Add -no-undefine for x64
+ windows target.
+ * configure: Regenerated.
+
+2012-02-08 Kai Tietz
+
+ * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32
+ also FFI_THISCALL.
+ * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype.
+ (FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code.
+ (ffi_prep_closure_loc): Add FFI_THISCALL support.
+ * src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size.
+ * src/x86/win32.S (ffi_closure_THISCALL): New closure code
+ for thiscall-calling convention.
+ * testsuite/libffi.call/closure_thiscall.c: New test.
+
+2012-01-28 Kai Tietz
+
+ * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new
+ argument to prototype for specify calling-convention.
+ (ffi_call): Add support for stdcall/thiscall convention.
+ (ffi_prep_args): Likewise.
+ (ffi_raw_call): Likewise.
+ * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and
+ FFI_FASTCALL.
+ * src/x86/win32.S (_ffi_call_win32): Add support for
+ fastcall/thiscall calling-convention calls.
+ * testsuite/libffi.call/fastthis1_win32.c: New test.
+ * testsuite/libffi.call/fastthis2_win32.c: New test.
+ * testsuite/libffi.call/fastthis3_win32.c: New test.
+ * testsuite/libffi.call/strlen2_win32.c: New test.
+ * testsuite/libffi.call/many2_win32.c: New test.
+ * testsuite/libffi.call/struct1_win32.c: New test.
+ * testsuite/libffi.call/struct2_win32.c: New test.
+
+2012-01-23 Uros Bizjak
+
+ * src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI.
+
+2012-01-23 Anthony Green
+ Chris Young
+
+ * configure.ac: Add Amiga support.
+ * configure: Rebuilt.
+
+2012-01-23 Dmitry Nadezhin
+
+ * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions.
+
+2012-01-23 Andreas Schwab
+
+ * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain
+ mc68000. Test for __HAVE_68881__ in addition to __MC68881__.
+
+2012-01-19 Jakub Jelinek
+
+ PR rtl-optimization/48496
+ * src/ia64/ffi.c (ffi_call): Fix up aliasing violations.
+
+2012-01-09 Rainer Orth
+
+ * configure.ac (i?86-*-*): Set TARGET to X86_64.
+ * configure: Regenerate.
+
+2011-12-07 Andrew Pinski
+
+ PR libffi/50051
+ * src/mips/n32.S: Add ".set mips4".
+
+2011-11-21 Andreas Tobler
+
+ * configure: Regenerate.
+
+2011-11-12 David Gilbert
+
+ * doc/libffi.texi, include/ffi.h.in, include/ffi_common.h,
+ man/Makefile.am, man/ffi.3, man/ffi_prep_cif.3,
+ man/ffi_prep_cif_var.3, src/arm/ffi.c, src/arm/ffitarget.h,
+ src/cris/ffi.c, src/prep_cif.c,
+ testsuite/libffi.call/cls_double_va.c,
+ testsuite/libffi.call/cls_longdouble_va.c,
+ testsuite/libffi.call/float_va.c: Many changes to support variadic
+ function calls.
+
+2011-11-12 Kyle Moffett
+
+ * src/powerpc/ffi.c, src/powerpc/ffitarget.h,
+ src/powerpc/ppc_closure.S, src/powerpc/sysv.S: Many changes for
+ softfloat powerpc variants.
+
+2011-11-12 Petr Salinger
+
+ * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Fix kfreebsd support.
+ * configure: Rebuilt.
+
+2011-11-12 Timothy Wall
+
+ * src/arm/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Max
+ alignment of 4 for wince on ARM.
+
+2011-11-12 Kyle Moffett
+ Anthony Green
+
+ * src/ppc/sysv.S, src/ppc/ffi.c: Remove use of ppc string
+ instructions (not available on some cores, like the PPC440).
+
+2011-11-12 Kimura Wataru
+
+ * m4/ax_enable_builddir: Change from string comparison to numeric
+ comparison for wc output.
+ * configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS
+ X 10.7.
+ * configure: Rebuilt.
+
+2011-11-12 Anthony Green
+
+ * Makefile.am (AM_CCASFLAGS): Add -g option to build assembly
+ files with debug info.
+ * Makefile.in: Rebuilt.
+
+2011-11-12 Jasper Lievisse Adriaanse
+
+ * README: Update list of supported OpenBSD systems.
+
+2011-11-12 Anthony Green
+
+ * libtool-version: Update.
+ * Makefile.am (nodist_libffi_la_SOURCES): Add src/debug.c if
+ FFI_DEBUG.
+ (libffi_la_SOURCES): Remove src/debug.c
+ (EXTRA_DIST): Add src/debug.c
+ * Makefile.in: Rebuilt.
+ * README: Update for 3.0.11.
+
+2011-11-10 Richard Henderson
+
+ * configure.ac (GCC_AS_CFI_PSEUDO_OP): Use it instead of inline check.
+ * configure, aclocal.m4: Rebuild.
+
+2011-09-04 Iain Sandoe
+
+ PR libffi/49594
+ * src/powerpc/darwin_closure.S (stubs): Make the stub binding
+ helper reference track the architecture pointer size.
+
+2011-08-25 Andrew Haley
+
+ * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly
+ instructions.
+ * src/arm/sysv.S (ffi_arm_trampoline): Put them here instead.
+
+2011-07-11 Andrew Haley