Merge pull request #494 from rmottola/master

part of tweaks
This commit is contained in:
Cameron Kaiser 2018-05-13 16:45:13 -07:00 committed by GitHub
commit d9f9fb2ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 50 additions and 33 deletions

View File

@ -219,9 +219,11 @@ struct writeBuf
};
#ifdef __ppc__
#define TAG_CFF 0x43464620
#define TAG_CFF 0x43464620
#define TAG_HEAD 0x68656164
#else
#define TAG_CFF 0x20464643
#define TAG_CFF 0x20464643
#define TAG_HEAD 0x64616568
#endif
bool
@ -246,7 +248,7 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
records[i].offset = offset;
records[i].data = data;
records[i].length = CFDataGetLength(data);
bool skipChecksumAdjust = (tag == 0x68656164); // 'head'
bool skipChecksumAdjust = (tag == TAG_HEAD); // 'head'
records[i].checkSum = CalcTableChecksum(reinterpret_cast<const uint32_t*>(CFDataGetBytePtr(data)),
records[i].length, skipChecksumAdjust);
offset += records[i].length;
@ -309,7 +311,7 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
}
records[i].data = data;
records[i].length = (uint32_t)dataLength;
bool skipChecksumAdjust = (tag == 0x68656164); // 'head'
bool skipChecksumAdjust = (tag == TAG_HEAD); // 'head'
records[i].checkSum = CalcTableChecksum(
reinterpret_cast<const uint32_t*>(CFDataGetBytePtr(data)),
records[i].length, skipChecksumAdjust);
@ -342,7 +344,7 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
// write tables
int checkSumAdjustmentOffset = 0;
for (CFIndex i = 0; i<count; i++) {
if (records[i].tag == 0x68656164) {
if (records[i].tag == TAG_HEAD) {
checkSumAdjustmentOffset = buf.offset + 2*4;
}
buf.writeMem(CFDataGetBytePtr(records[i].data), CFDataGetLength(records[i].data));

View File

@ -61,15 +61,8 @@ enum class SurfaceFormat : int8_t {
// The following values are endian-independent synonyms. The _UINT32 suffix
// indicates that the name reflects the layout when viewed as a uint32_t
// value.
#if MOZ_BIG_ENDIAN
A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
X8R8G8B8_UINT32 = B8G8R8X8 // 0x00RRGGBB
#elif MOZ_LITTLE_ENDIAN
A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
X8R8G8B8_UINT32 = X8R8G8B8 // 0x00RRGGBB
#else
# error "bad endianness"
#endif
};
inline bool IsOpaque(SurfaceFormat aFormat)

View File

@ -21,4 +21,3 @@ ac_add_options --with-distribution-id=com.floodgap
ac_add_options --enable-webrtc
ac_add_options --disable-ion
ac_add_options --disable-ctypes

View File

@ -170,7 +170,7 @@ static void
GenerateProfilingPrologue(MacroAssembler& masm, unsigned framePushed, ExitReason reason,
AsmJSProfilingOffsets* offsets, Label* maybeEntry = nullptr)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
#if !defined (JS_CODEGEN_ARM)
Register scratch = ABIArgGenerator::NonArg_VolatileReg;
#else
@ -225,7 +225,7 @@ static void
GenerateProfilingEpilogue(MacroAssembler& masm, unsigned framePushed, ExitReason reason,
AsmJSProfilingOffsets* offsets)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
Register scratch = ABIArgGenerator::NonReturn_VolatileReg0;
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_ARM64) || \
defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
@ -500,7 +500,7 @@ AsmJSProfilingFrameIterator::AsmJSProfilingFrameIterator(const AsmJSActivation&
exitReason_(ExitReason::None),
codeRange_(nullptr)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
// If profiling hasn't been enabled for this module, then CallerFPFromFP
// will be trash, so ignore the entire activation. In practice, this only
// happens if profiling is enabled while module->active() (in this case,

View File

@ -54,7 +54,7 @@ using namespace js::wasm;
using mozilla::IsNaN;
using mozilla::PodZero;
#if(0) // bug 881882
#if !defined(JS_CODEGEN_PPC_OSX) // bug 881882
static bool
CloneModule(JSContext* cx, MutableHandle<AsmJSModuleObject*> moduleObj)
@ -1273,7 +1273,7 @@ js::IsAsmJSFunction(JSContext *cx, unsigned argc, Value *vp)
bool
js::IsAsmJSFunction(HandleFunction fun)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
return fun->isNative() && fun->maybeNative() == CallAsmJS;
#else
return false;
@ -1283,7 +1283,7 @@ js::IsAsmJSFunction(HandleFunction fun)
JSString*
js::AsmJSFunctionToString(JSContext* cx, HandleFunction fun)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
AsmJSModule& module = FunctionToEnclosingModule(fun);
const AsmJSModule::ExportedFunction& f = FunctionToExportedFunction(fun, module);
uint32_t begin = module.srcStart() + f.startOffsetInModule();

View File

@ -270,7 +270,7 @@ AsmJSModule::lookupHeapAccess(void* pc) const
bool
AsmJSModule::finish(ExclusiveContext* cx, TokenStream& tokenStream, MacroAssembler& masm)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
MOZ_ASSERT(!isFinished());
uint32_t endBeforeCurly = tokenStream.currentToken().pos.end;
@ -1755,7 +1755,7 @@ AsmJSModule::heapLength() const
void
AsmJSModule::setProfilingEnabled(bool enabled, JSContext* cx)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
MOZ_ASSERT(isDynamicallyLinked());
if (profilingEnabled_ == enabled)

View File

@ -77,7 +77,7 @@ class AutoSetHandlingSignal
}
};
#if(0) // bug 881882
#if !defined(JS_CODEGEN_PPC_OSX) // bug 881882
#if defined(XP_WIN)
# define XMM_sig(p,i) ((p)->Xmm##i)
@ -1226,7 +1226,7 @@ JitInterruptHandler(int signum, siginfo_t* info, void* context)
bool
js::EnsureSignalHandlersInstalled(JSRuntime* rt)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
#if defined(XP_DARWIN) && defined(ASMJS_MAY_USE_SIGNAL_HANDLERS_FOR_OOB)
// On OSX, each JSRuntime gets its own handler thread.
if (!rt->asmJSMachExceptionHandler.installed() && !rt->asmJSMachExceptionHandler.install(rt))
@ -1324,7 +1324,7 @@ js::EnsureSignalHandlersInstalled(JSRuntime* rt)
void
js::InterruptRunningJitCode(JSRuntime* rt)
{
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
// If signal handlers weren't installed, then Ion and asm.js emit normal
// interrupt checks and don't need asynchronous interruption.
if (!rt->canUseSignalHandlers())

View File

@ -53,7 +53,7 @@ using mozilla::UniquePtr;
using JS::AsmJSOption;
using JS::GenericNaN;
#if(0) // bug 881882
#if !defined(JS_CODEGEN_PPC_OSX) // bug 881882
/*****************************************************************************/
// ParseNode utilities
@ -6871,7 +6871,7 @@ Warn(AsmJSParser& parser, int errorNumber, const char* str)
return false;
}
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
static bool
EstablishPreconditions(ExclusiveContext* cx, AsmJSParser& parser)
{
@ -6918,9 +6918,11 @@ bool
js::ValidateAsmJS(ExclusiveContext* cx, AsmJSParser& parser, ParseNode* stmtList, bool* validated)
{
*validated = false;
#if defined(JS_CODEGEN_PPC_OSX) // bug 881882
Warn(parser, JSMSG_USE_ASM_TYPE_FAIL, "AsmJS not currently supported on PowerPC; downgrading to IonPower");
return NoExceptionPending(cx);
#if(0) // bug 881882
#else
// Various conditions disable asm.js optimizations.
if (!EstablishPreconditions(cx, parser))
@ -6989,7 +6991,7 @@ js::IsAsmJSCompilationAvailable(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
#if(0)
#if !defined(JS_CODEGEN_PPC_OSX)
// See EstablishPreconditions.
#ifdef JS_CODEGEN_NONE
bool available = false;

View File

@ -1142,7 +1142,6 @@ L_ffi_closure_SYSV_inner$stub:
#if defined(X86_WIN32) && !defined(__OS2__)
.section .eh_frame,"w"
#endif
.Lframe1:
.LSCIE1:
.long .LECIE1-.LASCIE1 /* Length of Common Information Entry */
@ -1301,6 +1300,7 @@ L_ffi_closure_SYSV_inner$stub:
/* End of DW_CFA_xxx CFI instructions. */
.align 4
.LEFDE5:
#endif /* defined(X86_WIN32) && !defined(__OS2__), for the eh_frame */
#endif /* !_MSC_VER */

View File

@ -307,7 +307,11 @@ AtomicOperations::isLockfree(int32_t size)
|| defined(__ppc__) || defined(__PPC__)
# include "jit/none/AtomicOperations-ppc.h"
#elif defined(JS_CODEGEN_NONE)
#if defined(__i386__) || defined(__x86_64__)
# include "jit/x86-shared/AtomicOperations-x86-shared.h"
#else
# include "jit/none/AtomicOperations-none.h"
#endif
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
# include "jit/x86-shared/AtomicOperations-x86-shared.h"
#else

View File

@ -327,7 +327,7 @@ MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const T& src, AnyRegi
#if defined(JS_CODEGEN_PPC_OSX)
load32ByteSwapped(src, dest.gpr());
#elif defined(JS_CODEGEN_X86)
load32Byte(src, dest.gpr());
load32(src, dest.gpr());
#endif
break;
case Scalar::Uint32:
@ -335,14 +335,14 @@ MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const T& src, AnyRegi
#if defined(JS_CODEGEN_PPC_OSX)
load32ByteSwapped(src, temp);
#elif defined(JS_CODEGEN_X86)
load32Byte(src, temp);
load32(src, temp);
#endif
convertUInt32ToDouble(temp, dest.fpu());
} else {
#if defined(JS_CODEGEN_PPC_OSX)
load32ByteSwapped(src, dest.gpr());
#elif defined(JS_CODEGEN_X86)
load32Byte(src, temp);
load32(src, temp);
#endif
// Bail out if the value doesn't fit into a signed int32 value. This

View File

@ -31,7 +31,8 @@ LOCAL_INCLUDES += [
OS_LIBS += CONFIG['EDITLINE_LIBS']
OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
OS_LIBS += ['-Wl,-stack_size,0x10000000', '-framework Carbon']
if CONFIG['OS_ARCH'] == 'Darwin' and CONFIG['CPU_ARCH'] == 'ppc':
OS_LIBS += ['-Wl,-stack_size,0x10000000', '-framework Carbon']
# Prepare module loader JS code for embedding
GENERATED_FILES += ['shellmoduleloader.out.h']

View File

@ -101,6 +101,14 @@ endif
ARCH = darwin
#fix missing libmozglue.dylib on TenFourFox Intel build
ifeq ($(CPU_ARCH), x86)
EXTRA_SHARED_LIBS += \
-L$(DIST)/bin \
$(NULL)
endif
DSO_CFLAGS = -fPIC
# May override this with different compatibility and current version numbers.
DARWIN_DYLIB_VERSIONS = -compatibility_version 1 -current_version 1

View File

@ -91,6 +91,14 @@ endif
endif
ifeq ($(OS_ARCH), Darwin)
#fix missing libmozglue.dylib on TenFourFox Intel build
ifeq ($(CPU_ARCH), x86)
EXTRA_SHARED_LIBS += \
-L$(DIST)/bin \
$(NULL)
endif
EXTRA_SHARED_LIBS += -dylib_file @executable_path/libplc4.dylib:$(DIST)/lib/libplc4.dylib -dylib_file @executable_path/libplds4.dylib:$(DIST)/lib/libplds4.dylib
endif