Skip to content

Commit

Permalink
Merge pull request WebPlatformForEmbedded#2 from LibertyGlobal/lgi-co…
Browse files Browse the repository at this point in the history
…mcast-upstream

Lgi comcast upstream
  • Loading branch information
jacek-manko-red authored Mar 11, 2021
2 parents 03dc152 + b887e3b commit 63e3cbd
Show file tree
Hide file tree
Showing 229 changed files with 31,342 additions and 436 deletions.
7 changes: 5 additions & 2 deletions Source/JavaScriptCore/heap/GCIncomingRefCountedSetInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,20 @@ bool GCIncomingRefCountedSet<T>::addReference(JSCell* cell, T* object)
template<typename T>
void GCIncomingRefCountedSet<T>::sweep()
{
size_t bytes = 0;
for (size_t i = 0; i < m_vector.size(); ++i) {
T* object = m_vector[i];
size_t size = object->gcSizeEstimateInBytes();
ASSERT(object->isDeferred());
ASSERT(object->numberOfIncomingReferences());
if (!object->filterIncomingReferences(removeDead))
if (!object->filterIncomingReferences(removeDead)) {
bytes += size;
continue;
m_bytes -= size;
}
m_vector[i--] = m_vector.last();
m_vector.removeLast();
}
m_bytes = bytes;
}

template<typename T>
Expand Down
1 change: 0 additions & 1 deletion Source/JavaScriptCore/heap/HeapInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "Heap.h"
#include "HeapCellInlines.h"
#include "IndexingHeader.h"
#include "JSCallee.h"
#include "JSCast.h"
#include "Structure.h"
#include <type_traits>
Expand Down
1 change: 1 addition & 0 deletions Source/JavaScriptCore/heap/LocalAllocatorInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#pragma once

#include "HeapInlines.h"
#include "LocalAllocator.h"

namespace JSC {
Expand Down
6 changes: 3 additions & 3 deletions Source/JavaScriptCore/inspector/AsyncStackTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ void AsyncStackTrace::truncate(size_t maxDepth)

// The subtree being truncated must be removed from it's parent before
// updating its parent pointer chain.
auto* sourceNode = lastUnlockedAncestor->m_parent.get();
RefPtr<AsyncStackTrace> sourceNode = lastUnlockedAncestor->m_parent;
lastUnlockedAncestor->remove();

while (sourceNode) {
previousNode->m_parent = AsyncStackTrace::create(sourceNode->m_callStack.copyRef(), true, nullptr);
previousNode->m_parent->m_childCount = 1;
previousNode = previousNode->m_parent.get();

if (sourceNode == newStackTraceRoot)
if (sourceNode.get() == newStackTraceRoot)
break;

sourceNode = sourceNode->m_parent.get();
sourceNode = sourceNode->m_parent;
}

previousNode->m_truncated = true;
Expand Down
3 changes: 3 additions & 0 deletions Source/JavaScriptCore/interpreter/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,9 @@ class GetStackTraceFunctor {

void Interpreter::getStackTrace(JSCell* owner, Vector<StackFrame>& results, size_t framesToSkip, size_t maxStackSize)
{
if (Options::disableStackTrace())
return;

DisallowGC disallowGC;
VM& vm = m_vm;
CallFrame* callFrame = vm.topCallFrame;
Expand Down
4 changes: 4 additions & 0 deletions Source/JavaScriptCore/runtime/ConsoleObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "JSCInlines.h"
#include "ScriptArguments.h"
#include "ScriptCallStackFactory.h"
#include "Options.h"

namespace JSC {

Expand Down Expand Up @@ -114,6 +115,9 @@ static EncodedJSValue consoleLogWithLevel(ExecState* exec, MessageLevel level)
if (!client)
return JSValue::encode(jsUndefined());

if (Options::disableConsoleLog())
return JSValue::encode(jsUndefined());

client->logWithLevel(exec, Inspector::createScriptArguments(exec, 0), level);
return JSValue::encode(jsUndefined());
}
Expand Down
3 changes: 3 additions & 0 deletions Source/JavaScriptCore/runtime/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ static void recomputeDependentOptions()
if (Options::softReservedZoneSize() < Options::reservedZoneSize() + minimumReservedZoneSize)
Options::softReservedZoneSize() = Options::reservedZoneSize() + minimumReservedZoneSize;

if (!getenv("RFC_ENABLE_WEBKIT_INSPECTOR"))
Options::disableStackTrace() = true;

#if USE(JSVALUE32_64)
// FIXME: Make probe OSR exit work on 32-bit:
// https://bugs.webkit.org/show_bug.cgi?id=177956
Expand Down
3 changes: 3 additions & 0 deletions Source/JavaScriptCore/runtime/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ constexpr bool enableWebAssemblyStreamingApi = false;
\
v(bool, useWebAssembly, true, Normal, "Expose the WebAssembly global object.") \
\
v(bool, disableStackTrace, false, Normal, "Disable stack trace generatoin for errors/exceptions.") \
\
v(bool, enableSpectreMitigations, true, Restricted, "Enable Spectre mitigations.") \
v(bool, enableSpectreGadgets, false, Restricted, "enable gadgets to test Spectre mitigations.") \
v(bool, usePoisoning, true, Normal, "Poison is randomized at load time when true, and initialized to 0 if false which defeats some Spectre and type confusion mitigations, but allows tools such as leak detectors to function better.") \
Expand Down Expand Up @@ -515,6 +517,7 @@ constexpr bool enableWebAssemblyStreamingApi = false;
v(bool, useTracePoints, false, Normal, nullptr) \
v(bool, traceLLIntExecution, false, Configurable, nullptr) \
v(bool, traceLLIntSlowPath, false, Configurable, nullptr) \
v(bool, disableConsoleLog, false, Normal, "Disable printing of JS console logs.") \


enum OptionEquivalence {
Expand Down
41 changes: 20 additions & 21 deletions Source/ThirdParty/libwebrtc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

find_package(Vpx 1.7.0)
if (NOT LIBVPX_FOUND)
message(FATAL_ERROR "libvpx is needed for USE_LIBWEBRTC.")
endif ()
#find_package(Vpx 1.7.0)
#if (NOT LIBVPX_FOUND)
# message(FATAL_ERROR "libvpx is needed for USE_LIBWEBRTC.")
#endif ()

find_package(LibEvent)
if (NOT LIBEVENT_FOUND)
Expand All @@ -16,10 +16,10 @@ if (NOT ALSALIB_FOUND)
message(FATAL_ERROR "alsa-lib is needed for USE_LIBWEBRTC.")
endif ()

find_package(Opus 1.3)
if (NOT LIBOPUS_FOUND)
message(FATAL_ERROR "libopus is needed for USE_LIBWEBRTC.")
endif ()
#find_package(Opus 1.3)
#if (NOT LIBOPUS_FOUND)
# message(FATAL_ERROR "libopus is needed for USE_LIBWEBRTC.")
#endif ()

set(webrtc_SOURCES
Source/third_party/abseil-cpp/absl/base/dynamic_annotations.cc
Expand Down Expand Up @@ -366,9 +366,9 @@ set(webrtc_SOURCES
Source/webrtc/api/audio_codecs/isac/audio_decoder_isac_float.cc
Source/webrtc/api/audio_codecs/isac/audio_encoder_isac_fix.cc
Source/webrtc/api/audio_codecs/isac/audio_encoder_isac_float.cc
Source/webrtc/api/audio_codecs/opus/audio_decoder_opus.cc
Source/webrtc/api/audio_codecs/opus/audio_encoder_opus.cc
Source/webrtc/api/audio_codecs/opus/audio_encoder_opus_config.cc
# Source/webrtc/api/audio_codecs/opus/audio_decoder_opus.cc
# Source/webrtc/api/audio_codecs/opus/audio_encoder_opus.cc
# Source/webrtc/api/audio_codecs/opus/audio_encoder_opus_config.cc
Source/webrtc/api/audio_options.cc
Source/webrtc/api/call/transport.cc
Source/webrtc/api/candidate.cc
Expand Down Expand Up @@ -747,9 +747,9 @@ set(webrtc_SOURCES
Source/webrtc/modules/audio_coding/codecs/isac/main/source/transform.c
Source/webrtc/modules/audio_coding/codecs/legacy_encoded_audio_frame.cc
Source/webrtc/modules/audio_coding/codecs/legacy_encoded_audio_frame.h
Source/webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc
Source/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
Source/webrtc/modules/audio_coding/codecs/opus/opus_interface.c
# Source/webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc
# Source/webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc
# Source/webrtc/modules/audio_coding/codecs/opus/opus_interface.c
Source/webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc
Source/webrtc/modules/audio_coding/codecs/pcm16b/audio_encoder_pcm16b.cc
Source/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c
Expand Down Expand Up @@ -799,11 +799,11 @@ set(webrtc_SOURCES
Source/webrtc/modules/audio_device/fine_audio_buffer.cc
Source/webrtc/modules/audio_device/linux/alsasymboltable_linux.cc
Source/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
Source/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
# Source/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc
Source/webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.cc
Source/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
# Source/webrtc/modules/audio_device/linux/audio_mixer_manager_pulse_linux.cc
Source/webrtc/modules/audio_device/linux/latebindingsymboltable_linux.cc
Source/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc
# Source/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc
Source/webrtc/modules/audio_mixer/audio_frame_manipulator.cc
Source/webrtc/modules/audio_mixer/audio_mixer_impl.cc
Source/webrtc/modules/audio_mixer/default_output_rate_calculator.cc
Expand Down Expand Up @@ -1372,15 +1372,14 @@ target_compile_definitions(webrtc PRIVATE
WEBRTC_CODEC_G722
WEBRTC_CODEC_ILBC
WEBRTC_CODEC_ISAC
WEBRTC_CODEC_OPUS
WEBRTC_CODEC_RED
WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE
WEBRTC_INTELLIGIBILITY_ENHANCER=0
WEBRTC_LINUX
WEBRTC_NS_FLOAT
WEBRTC_OPUS_SUPPORT_120MS_PTIME=0
WEBRTC_OPUS_VARIABLE_COMPLEXITY=0
WEBRTC_USE_BUILTIN_OPUS=1
WEBRTC_USE_BUILTIN_OPUS=0
WEBRTC_POSIX
WEBRTC_USE_BUILTIN_ISAC_FIX=1
WEBRTC_USE_BUILTIN_ISAC_FLOAT=0
Expand Down Expand Up @@ -1427,11 +1426,11 @@ target_include_directories(webrtc PRIVATE
Source/webrtc/modules/audio_coding/codecs/isac/main/include
)

target_link_libraries(webrtc ${VPX_LIBRARY})
#target_link_libraries(webrtc ${VPX_LIBRARY})

target_link_libraries(webrtc ${EVENT_LIBRARY})

target_link_libraries(webrtc ${OPUS_LIBRARY})
#target_link_libraries(webrtc ${OPUS_LIBRARY})

# libsrtp package compilation
set(libsrtp_SOURCES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int64_t VCMTiming::RenderTimeMsInternal(uint32_t frame_timestamp,
int64_t now_ms) const {
if (min_playout_delay_ms_ == 0 && max_playout_delay_ms_ == 0) {
// Render as soon as possible.
return 0;
// return 0;
}
int64_t estimated_complete_time_ms =
ts_extrapolator_->ExtrapolateLocalTime(frame_timestamp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ typedef void* SockOptArg;
#endif // WEBRTC_POSIX

#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__)
#include <linux/sockios.h>

int64_t GetSocketRecvTimestamp(int socket) {
struct timeval tv_ioctl;
Expand Down
6 changes: 5 additions & 1 deletion Source/WTF/wtf/Assertions.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,11 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(v
#if LOG_DISABLED
#define LOG(channel, ...) ((void)0)
#else
#define LOG(channel, ...) WTFLog(&LOG_CHANNEL(channel), __VA_ARGS__)
#define LOG(channel, ...) \
do { \
if (LOG_CHANNEL(channel).state == WTFLogChannelOn) \
WTFLog(&LOG_CHANNEL(channel), __VA_ARGS__); \
} while (0)
#endif

/* LOG_VERBOSE */
Expand Down
8 changes: 8 additions & 0 deletions Source/WTF/wtf/MediaTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ class WTF_EXPORT_PRIVATE MediaTime {
MediaTime operator-(const MediaTime& rhs) const;
MediaTime operator-() const;
MediaTime operator*(int32_t) const;
#if 0
bool operator<(const MediaTime& rhs) const { return compare(rhs) == LessThan; }
#else
bool operator<(const MediaTime& rhs) const {
if (m_timeFlags == Valid && m_timeFlags == rhs.m_timeFlags && m_timeScale == rhs.m_timeScale)
return m_timeValue < rhs.m_timeValue;
return compare(rhs) == LessThan;
}
#endif
bool operator>(const MediaTime& rhs) const { return compare(rhs) == GreaterThan; }
bool operator!=(const MediaTime& rhs) const { return compare(rhs) != EqualTo; }
bool operator==(const MediaTime& rhs) const { return compare(rhs) == EqualTo; }
Expand Down
1 change: 1 addition & 0 deletions Source/WTF/wtf/MemoryPressureHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ MemoryPressureHandler::MemoryPressureHandler()
: m_windowsMeasurementTimer(RunLoop::main(), this, &MemoryPressureHandler::windowsMeasurementTimerFired)
#endif
{
m_installed = false;
}

void MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor(bool use)
Expand Down
10 changes: 6 additions & 4 deletions Source/WTF/wtf/MemoryPressureHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ class MemoryPressureHandler {
WTF_EXPORT_PRIVATE static MemoryPressureHandler& singleton();

WTF_EXPORT_PRIVATE void install();
WTF_EXPORT_PRIVATE void uninstall();

WTF_EXPORT_PRIVATE void setShouldUsePeriodicMemoryMonitor(bool);

#if OS(LINUX)
WTF_EXPORT_PRIVATE void triggerMemoryPressureEvent(bool isCritical);
WTF_EXPORT_PRIVATE void triggerMemoryPressureEvent(bool isCritical, bool isSynchronous);
#endif

void setMemoryKillCallback(WTF::Function<void()>&& function) { m_memoryKillCallback = WTFMove(function); }
Expand Down Expand Up @@ -154,8 +155,6 @@ class MemoryPressureHandler {
size_t thresholdForMemoryKill();
void memoryPressureStatusChanged();

void uninstall();

void holdOff(Seconds);

MemoryPressureHandler();
Expand All @@ -175,7 +174,7 @@ class MemoryPressureHandler {

unsigned m_pageCount { 0 };

bool m_installed { false };
std::atomic<bool> m_installed;
LowMemoryHandler m_lowMemoryHandler;

std::atomic<bool> m_underMemoryPressure;
Expand All @@ -198,6 +197,8 @@ class MemoryPressureHandler {
RunLoop::Timer<MemoryPressureHandler> m_holdOffTimer;
void holdOffTimerFired();

struct MemoryUsagePollerThreadContext;

class MemoryUsagePoller {
WTF_MAKE_NONCOPYABLE(MemoryUsagePoller); WTF_MAKE_FAST_ALLOCATED;
public:
Expand All @@ -206,6 +207,7 @@ class MemoryPressureHandler {

private:
RefPtr<Thread> m_thread;
RefPtr<MemoryUsagePollerThreadContext> m_context;
};

std::unique_ptr<MemoryUsagePoller> m_memoryUsagePoller;
Expand Down
3 changes: 2 additions & 1 deletion Source/WTF/wtf/linux/MemoryFootprintLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if 0
#include "config.h"
#include "MemoryFootprint.h"

Expand Down Expand Up @@ -107,3 +107,4 @@ size_t memoryFootprint()
}

}
#endif
Loading

0 comments on commit 63e3cbd

Please sign in to comment.