зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1661256 part 12 - Convert calls to JS_MASM_VERBOSE functions called with callWithABI. r=lth
Differential Revision: https://phabricator.services.mozilla.com/D91792
This commit is contained in:
Родитель
f4c5045f13
Коммит
324ad1fd7b
|
@ -58,10 +58,13 @@ namespace jit {
|
|||
_(js::irregexp::CaseInsensitiveCompareNonUnicode) \
|
||||
_(js::irregexp::CaseInsensitiveCompareUnicode) \
|
||||
_(js::irregexp::GrowBacktrackStack) \
|
||||
_(js::jit::AssumeUnreachable) \
|
||||
_(js::jit::Bailout) \
|
||||
_(js::jit::FinishBailoutToBaseline) \
|
||||
_(js::jit::InitBaselineFrameForOsr) \
|
||||
_(js::jit::InvalidationBailout) \
|
||||
_(js::jit::Printf0) \
|
||||
_(js::jit::Printf1) \
|
||||
_(js::NumberMod) \
|
||||
_(js::powi) \
|
||||
_(js::RegExpInstanceOptimizableRaw) \
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "builtin/TypedObject.h"
|
||||
#include "gc/GCProbes.h"
|
||||
#include "jit/ABIFunctions.h"
|
||||
#include "jit/AtomicOp.h"
|
||||
#include "jit/AtomicOperations.h"
|
||||
#include "jit/Bailouts.h"
|
||||
|
@ -30,7 +31,6 @@
|
|||
#include "jit/SharedICHelpers.h"
|
||||
#include "jit/Simulator.h"
|
||||
#include "js/Conversions.h"
|
||||
#include "js/Printf.h"
|
||||
#include "js/ScalarType.h" // js::Scalar::Type
|
||||
#include "vm/ArgumentsObject.h"
|
||||
#include "vm/ArrayBufferViewObject.h"
|
||||
|
@ -39,6 +39,7 @@
|
|||
#include "vm/TypedArrayObject.h"
|
||||
|
||||
#include "gc/Nursery-inl.h"
|
||||
#include "jit/ABIFunctionList-inl.h"
|
||||
#include "jit/shared/Lowering-shared-inl.h"
|
||||
#include "jit/TemplateObject-inl.h"
|
||||
#include "vm/Interpreter-inl.h"
|
||||
|
@ -2162,12 +2163,6 @@ void MacroAssembler::handleFailure() {
|
|||
jump(excTail);
|
||||
}
|
||||
|
||||
#ifdef JS_MASM_VERBOSE
|
||||
static void AssumeUnreachable_(const char* output) {
|
||||
MOZ_ReportAssertionFailure(output, __FILE__, __LINE__);
|
||||
}
|
||||
#endif
|
||||
|
||||
void MacroAssembler::assumeUnreachable(const char* output) {
|
||||
#ifdef JS_MASM_VERBOSE
|
||||
if (!IsCompilingWasm()) {
|
||||
|
@ -2176,11 +2171,12 @@ void MacroAssembler::assumeUnreachable(const char* output) {
|
|||
PushRegsInMask(save);
|
||||
Register temp = regs.takeAnyGeneral();
|
||||
|
||||
using Fn = void (*)(const char* output);
|
||||
setupUnalignedABICall(temp);
|
||||
movePtr(ImmPtr(output), temp);
|
||||
passABIArg(temp);
|
||||
callWithABI(JS_FUNC_TO_DATA_PTR(void*, AssumeUnreachable_), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
callWithABI<Fn, AssumeUnreachable>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
PopRegsInMask(save);
|
||||
}
|
||||
|
@ -2203,17 +2199,6 @@ void MacroAssembler::assertTestInt32(Condition cond, const T& value,
|
|||
template void MacroAssembler::assertTestInt32(Condition, const Address&,
|
||||
const char*);
|
||||
|
||||
#ifdef JS_MASM_VERBOSE
|
||||
static void Printf0_(const char* output) {
|
||||
AutoUnsafeCallWithABI unsafe;
|
||||
|
||||
// Use stderr instead of stdout because this is only used for debug
|
||||
// output. stderr is less likely to interfere with the program's normal
|
||||
// output, and it's always unbuffered.
|
||||
fprintf(stderr, "%s", output);
|
||||
}
|
||||
#endif
|
||||
|
||||
void MacroAssembler::printf(const char* output) {
|
||||
#ifdef JS_MASM_VERBOSE
|
||||
AllocatableRegisterSet regs(RegisterSet::Volatile());
|
||||
|
@ -2222,27 +2207,16 @@ void MacroAssembler::printf(const char* output) {
|
|||
|
||||
Register temp = regs.takeAnyGeneral();
|
||||
|
||||
using Fn = void (*)(const char* output);
|
||||
setupUnalignedABICall(temp);
|
||||
movePtr(ImmPtr(output), temp);
|
||||
passABIArg(temp);
|
||||
callWithABI(JS_FUNC_TO_DATA_PTR(void*, Printf0_));
|
||||
callWithABI<Fn, Printf0>();
|
||||
|
||||
PopRegsInMask(save);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef JS_MASM_VERBOSE
|
||||
static void Printf1_(const char* output, uintptr_t value) {
|
||||
AutoUnsafeCallWithABI unsafe;
|
||||
AutoEnterOOMUnsafeRegion oomUnsafe;
|
||||
js::UniqueChars line = JS_sprintf_append(nullptr, output, value);
|
||||
if (!line) {
|
||||
oomUnsafe.crash("OOM at masm.printf");
|
||||
}
|
||||
fprintf(stderr, "%s", line.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
void MacroAssembler::printf(const char* output, Register value) {
|
||||
#ifdef JS_MASM_VERBOSE
|
||||
AllocatableRegisterSet regs(RegisterSet::Volatile());
|
||||
|
@ -2253,11 +2227,12 @@ void MacroAssembler::printf(const char* output, Register value) {
|
|||
|
||||
Register temp = regs.takeAnyGeneral();
|
||||
|
||||
using Fn = void (*)(const char* output, uintptr_t value);
|
||||
setupUnalignedABICall(temp);
|
||||
movePtr(ImmPtr(output), temp);
|
||||
passABIArg(temp);
|
||||
passABIArg(value);
|
||||
callWithABI(JS_FUNC_TO_DATA_PTR(void*, Printf1_));
|
||||
callWithABI<Fn, Printf1>();
|
||||
|
||||
PopRegsInMask(save);
|
||||
#endif
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "jit/mips64/Simulator-mips64.h"
|
||||
#include "js/friend/StackLimits.h" // js::CheckRecursionLimitWithExtra
|
||||
#include "js/friend/WindowProxy.h" // js::IsWindow
|
||||
#include "js/Printf.h"
|
||||
#include "vm/ArrayObject.h"
|
||||
#include "vm/EqualityOperations.h" // js::StrictlyEqual
|
||||
#include "vm/Interpreter.h"
|
||||
|
@ -2414,5 +2415,28 @@ AtomicsReadWriteModifyFn AtomicsXor(Scalar::Type elementType) {
|
|||
}
|
||||
}
|
||||
|
||||
void AssumeUnreachable(const char* output) {
|
||||
MOZ_ReportAssertionFailure(output, __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
void Printf0(const char* output) {
|
||||
AutoUnsafeCallWithABI unsafe;
|
||||
|
||||
// Use stderr instead of stdout because this is only used for debug
|
||||
// output. stderr is less likely to interfere with the program's normal
|
||||
// output, and it's always unbuffered.
|
||||
fprintf(stderr, "%s", output);
|
||||
}
|
||||
|
||||
void Printf1(const char* output, uintptr_t value) {
|
||||
AutoUnsafeCallWithABI unsafe;
|
||||
AutoEnterOOMUnsafeRegion oomUnsafe;
|
||||
js::UniqueChars line = JS_sprintf_append(nullptr, output, value);
|
||||
if (!line) {
|
||||
oomUnsafe.crash("OOM at masm.printf");
|
||||
}
|
||||
fprintf(stderr, "%s", line.get());
|
||||
}
|
||||
|
||||
} // namespace jit
|
||||
} // namespace js
|
||||
|
|
|
@ -1180,6 +1180,11 @@ AtomicsReadWriteModifyFn AtomicsAnd(Scalar::Type elementType);
|
|||
AtomicsReadWriteModifyFn AtomicsOr(Scalar::Type elementType);
|
||||
AtomicsReadWriteModifyFn AtomicsXor(Scalar::Type elementType);
|
||||
|
||||
// Functions used when JS_MASM_VERBOSE is enabled.
|
||||
void AssumeUnreachable(const char* output);
|
||||
void Printf0(const char* output);
|
||||
void Printf1(const char* output, uintptr_t value);
|
||||
|
||||
enum class TailCallVMFunctionId;
|
||||
enum class VMFunctionId;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче