Log Message
Add some pointer profiling support to B3 and Air. https://bugs.webkit.org/show_bug.cgi?id=184165 <rdar://problem/39022125>
Reviewed by JF Bastien. * b3/B3LowerMacros.cpp: * b3/B3LowerMacrosAfterOptimizations.cpp: * b3/B3MathExtras.cpp: * b3/B3ReduceStrength.cpp: * b3/air/AirCCallSpecial.cpp: (JSC::B3::Air::CCallSpecial::generate): * b3/air/AirCCallSpecial.h: * b3/testb3.cpp: (JSC::B3::testCallSimple): (JSC::B3::testCallRare): (JSC::B3::testCallRareLive): (JSC::B3::testCallSimplePure): (JSC::B3::testCallFunctionWithHellaArguments): (JSC::B3::testCallFunctionWithHellaArguments2): (JSC::B3::testCallFunctionWithHellaArguments3): (JSC::B3::testCallSimpleDouble): (JSC::B3::testCallSimpleFloat): (JSC::B3::testCallFunctionWithHellaDoubleArguments): (JSC::B3::testCallFunctionWithHellaFloatArguments): (JSC::B3::testLinearScanWithCalleeOnStack): (JSC::B3::testInterpreter): (JSC::B3::testLICMPure): (JSC::B3::testLICMPureSideExits): (JSC::B3::testLICMPureWritesPinned): (JSC::B3::testLICMPureWrites): (JSC::B3::testLICMReadsLocalState): (JSC::B3::testLICMReadsPinned): (JSC::B3::testLICMReads): (JSC::B3::testLICMPureNotBackwardsDominant): (JSC::B3::testLICMPureFoiledByChild): (JSC::B3::testLICMPureNotBackwardsDominantFoiledByChild): (JSC::B3::testLICMExitsSideways): (JSC::B3::testLICMWritesLocalState): (JSC::B3::testLICMWrites): (JSC::B3::testLICMFence): (JSC::B3::testLICMWritesPinned): (JSC::B3::testLICMControlDependent): (JSC::B3::testLICMControlDependentNotBackwardsDominant): (JSC::B3::testLICMControlDependentSideExits): (JSC::B3::testLICMReadsPinnedWritesPinned): (JSC::B3::testLICMReadsWritesDifferentHeaps): (JSC::B3::testLICMReadsWritesOverlappingHeaps): (JSC::B3::testLICMDefaultCall): (JSC::B3::testShuffleDoesntTrashCalleeSaves): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs): (JSC::FTL::DFG::LowerDFGToB3::compileCallEval): * jit/GPRInfo.h: * runtime/PtrTag.h: * wasm/WasmBinding.cpp: (JSC::Wasm::wasmToWasm):
Modified Paths
- trunk/Source/_javascript_Core/ChangeLog
- trunk/Source/_javascript_Core/b3/B3LowerMacros.cpp
- trunk/Source/_javascript_Core/b3/B3LowerMacrosAfterOptimizations.cpp
- trunk/Source/_javascript_Core/b3/B3MathExtras.cpp
- trunk/Source/_javascript_Core/b3/B3ReduceStrength.cpp
- trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.cpp
- trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.h
- trunk/Source/_javascript_Core/b3/testb3.cpp
- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp
- trunk/Source/_javascript_Core/jit/GPRInfo.h
- trunk/Source/_javascript_Core/runtime/PtrTag.h
- trunk/Source/_javascript_Core/wasm/WasmBinding.cpp
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (230097 => 230098)
--- trunk/Source/_javascript_Core/ChangeLog 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-03-30 05:13:32 UTC (rev 230098)
@@ -1,3 +1,64 @@
+2018-03-29 Mark Lam <mark....@apple.com>
+
+ Add some pointer profiling support to B3 and Air.
+ https://bugs.webkit.org/show_bug.cgi?id=184165
+ <rdar://problem/39022125>
+
+ Reviewed by JF Bastien.
+
+ * b3/B3LowerMacros.cpp:
+ * b3/B3LowerMacrosAfterOptimizations.cpp:
+ * b3/B3MathExtras.cpp:
+ * b3/B3ReduceStrength.cpp:
+ * b3/air/AirCCallSpecial.cpp:
+ (JSC::B3::Air::CCallSpecial::generate):
+ * b3/air/AirCCallSpecial.h:
+ * b3/testb3.cpp:
+ (JSC::B3::testCallSimple):
+ (JSC::B3::testCallRare):
+ (JSC::B3::testCallRareLive):
+ (JSC::B3::testCallSimplePure):
+ (JSC::B3::testCallFunctionWithHellaArguments):
+ (JSC::B3::testCallFunctionWithHellaArguments2):
+ (JSC::B3::testCallFunctionWithHellaArguments3):
+ (JSC::B3::testCallSimpleDouble):
+ (JSC::B3::testCallSimpleFloat):
+ (JSC::B3::testCallFunctionWithHellaDoubleArguments):
+ (JSC::B3::testCallFunctionWithHellaFloatArguments):
+ (JSC::B3::testLinearScanWithCalleeOnStack):
+ (JSC::B3::testInterpreter):
+ (JSC::B3::testLICMPure):
+ (JSC::B3::testLICMPureSideExits):
+ (JSC::B3::testLICMPureWritesPinned):
+ (JSC::B3::testLICMPureWrites):
+ (JSC::B3::testLICMReadsLocalState):
+ (JSC::B3::testLICMReadsPinned):
+ (JSC::B3::testLICMReads):
+ (JSC::B3::testLICMPureNotBackwardsDominant):
+ (JSC::B3::testLICMPureFoiledByChild):
+ (JSC::B3::testLICMPureNotBackwardsDominantFoiledByChild):
+ (JSC::B3::testLICMExitsSideways):
+ (JSC::B3::testLICMWritesLocalState):
+ (JSC::B3::testLICMWrites):
+ (JSC::B3::testLICMFence):
+ (JSC::B3::testLICMWritesPinned):
+ (JSC::B3::testLICMControlDependent):
+ (JSC::B3::testLICMControlDependentNotBackwardsDominant):
+ (JSC::B3::testLICMControlDependentSideExits):
+ (JSC::B3::testLICMReadsPinnedWritesPinned):
+ (JSC::B3::testLICMReadsWritesDifferentHeaps):
+ (JSC::B3::testLICMReadsWritesOverlappingHeaps):
+ (JSC::B3::testLICMDefaultCall):
+ (JSC::B3::testShuffleDoesntTrashCalleeSaves):
+ * ftl/FTLLowerDFGToB3.cpp:
+ (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
+ (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
+ (JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
+ * jit/GPRInfo.h:
+ * runtime/PtrTag.h:
+ * wasm/WasmBinding.cpp:
+ (JSC::Wasm::wasmToWasm):
+
2018-03-29 JF Bastien <jfbast...@apple.com>
Use Forward.h instead of forward-declaring WTF::String
Modified: trunk/Source/_javascript_Core/b3/B3LowerMacros.cpp (230097 => 230098)
--- trunk/Source/_javascript_Core/b3/B3LowerMacros.cpp 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/b3/B3LowerMacros.cpp 2018-03-30 05:13:32 UTC (rev 230098)
@@ -128,7 +128,7 @@
break;
}
- double (*fmodDouble)(double, double) = fmod;
+ auto* fmodDouble = tagCFunctionPtr<double (*)(double, double)>(fmod, B3CCallPtrTag);
if (m_value->type() == Double) {
Value* functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, fmodDouble);
Value* result = m_insertionSet.insert<CCallValue>(m_index, Double, m_origin,
@@ -506,12 +506,13 @@
GPRReg index = params[0].gpr();
GPRReg scratch = params.gpScratch(0);
GPRReg poisonScratch = params.gpScratch(1);
+ PtrTag tag = ptrTag(SwitchTablePtrTag, nextPtrTagID());
jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), poisonScratch);
jit.move(CCallHelpers::TrustedImmPtr(jumpTable), scratch);
jit.load64(CCallHelpers::BaseIndex(scratch, index, CCallHelpers::timesPtr()), scratch);
jit.xor64(poisonScratch, scratch);
- jit.jump(scratch, NoPtrTag);
+ jit.jump(scratch, tag);
// These labels are guaranteed to be populated before either late paths or
// link tasks run.
@@ -520,17 +521,14 @@
jit.addLinkTask(
[=] (LinkBuffer& linkBuffer) {
if (hasUnhandledIndex) {
- MacroAssemblerCodePtr fallThrough =
- linkBuffer.locationOf(*labels.last());
+ MacroAssemblerCodePtr fallThrough = linkBuffer.locationOf(*labels.last(), tag);
for (unsigned i = tableSize; i--;)
jumpTable[i] = fallThrough;
}
unsigned labelIndex = 0;
- for (unsigned tableIndex : handledIndices) {
- jumpTable[tableIndex] =
- linkBuffer.locationOf(*labels[labelIndex++]);
- }
+ for (unsigned tableIndex : handledIndices)
+ jumpTable[tableIndex] = linkBuffer.locationOf(*labels[labelIndex++], tag);
});
});
return;
Modified: trunk/Source/_javascript_Core/b3/B3LowerMacrosAfterOptimizations.cpp (230097 => 230098)
--- trunk/Source/_javascript_Core/b3/B3LowerMacrosAfterOptimizations.cpp 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/b3/B3LowerMacrosAfterOptimizations.cpp 2018-03-30 05:13:32 UTC (rev 230098)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -99,9 +99,9 @@
Value* functionAddress = nullptr;
if (m_value->type() == Double) {
double (*ceilDouble)(double) = ceil;
- functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, ceilDouble);
+ functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunctionPtr(ceilDouble, B3CCallPtrTag));
} else if (m_value->type() == Float)
- functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, ceilf);
+ functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunctionPtr(ceilf, B3CCallPtrTag));
else
RELEASE_ASSERT_NOT_REACHED();
@@ -121,9 +121,9 @@
Value* functionAddress = nullptr;
if (m_value->type() == Double) {
double (*floorDouble)(double) = floor;
- functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, floorDouble);
+ functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunctionPtr(floorDouble, B3CCallPtrTag));
} else if (m_value->type() == Float)
- functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, floorf);
+ functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunctionPtr(floorf, B3CCallPtrTag));
else
RELEASE_ASSERT_NOT_REACHED();
Modified: trunk/Source/_javascript_Core/b3/B3MathExtras.cpp (230097 => 230098)
--- trunk/Source/_javascript_Core/b3/B3MathExtras.cpp 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/b3/B3MathExtras.cpp 2018-03-30 05:13:32 UTC (rev 230098)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -36,6 +36,7 @@
#include "B3UpsilonValue.h"
#include "B3ValueInlines.h"
#include "MathCommon.h"
+#include "PtrTag.h"
namespace JSC { namespace B3 {
@@ -56,7 +57,7 @@
// Function call.
Value* yAsDouble = functionCallCase->appendNew<Value>(procedure, IToD, origin, y);
- double (*powDouble)(double, double) = pow;
+ auto* powDouble = tagCFunctionPtr<double (*)(double, double)>(pow, B3CCallPtrTag);
Value* powResult = functionCallCase->appendNew<CCallValue>(
procedure, Double, origin,
functionCallCase->appendNew<ConstPtrValue>(procedure, origin, bitwise_cast<void*>(powDouble)),
Modified: trunk/Source/_javascript_Core/b3/B3ReduceStrength.cpp (230097 => 230098)
--- trunk/Source/_javascript_Core/b3/B3ReduceStrength.cpp 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/b3/B3ReduceStrength.cpp 2018-03-30 05:13:32 UTC (rev 230098)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1599,7 +1599,7 @@
case CCall: {
// Turn this: Call(fmod, constant1, constant2)
// Into this: fcall-constant(constant1, constant2)
- double(*fmodDouble)(double, double) = fmod;
+ auto* fmodDouble = tagCFunctionPtr<double (*)(double, double)>(fmod, B3CCallPtrTag);
if (m_value->type() == Double
&& m_value->numChildren() == 3
&& m_value->child(0)->isIntPtr(reinterpret_cast<intptr_t>(fmodDouble))
Modified: trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.cpp (230097 => 230098)
--- trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.cpp 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.cpp 2018-03-30 05:13:32 UTC (rev 230098)
@@ -134,14 +134,29 @@
case Arg::Imm:
case Arg::BigImm:
jit.move(inst.args[calleeArgOffset].asTrustedImmPtr(), scratchRegister);
+#if USE(POINTER_PROFILING)
+ jit.move(CCallHelpers::TrustedImmPtr(B3CCallPtrTag), ptrTagRegister);
+ jit.call(scratchRegister, ptrTagRegister);
+#else
jit.call(scratchRegister, NoPtrTag);
+#endif
break;
case Arg::Tmp:
+#if USE(POINTER_PROFILING)
+ jit.move(CCallHelpers::TrustedImmPtr(B3CCallPtrTag), ptrTagRegister);
+ jit.call(inst.args[calleeArgOffset].gpr(), ptrTagRegister);
+#else
jit.call(inst.args[calleeArgOffset].gpr(), NoPtrTag);
+#endif
break;
case Arg::Addr:
case Arg::ExtendedOffsetAddr:
+#if USE(POINTER_PROFILING)
+ jit.move(CCallHelpers::TrustedImmPtr(B3CCallPtrTag), ptrTagRegister);
+ jit.call(inst.args[calleeArgOffset].asAddress(), ptrTagRegister);
+#else
jit.call(inst.args[calleeArgOffset].asAddress(), NoPtrTag);
+#endif
break;
default:
RELEASE_ASSERT_NOT_REACHED();
Modified: trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.h (230097 => 230098)
--- trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.h 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.h 2018-03-30 05:13:32 UTC (rev 230098)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -49,7 +49,10 @@
// You cannot use this register to pass arguments. It just so happens that this register is not
// used for arguments in the C calling convention. By the way, this is the only thing that causes
// this special to be specific to C calls.
- static const GPRReg scratchRegister = GPRInfo::nonArgGPR0;
+ static const GPRReg scratchRegister = GPRInfo::nonPreservedNonArgumentGPR0;
+#if USE(POINTER_PROFILING)
+ static const GPRReg ptrTagRegister = GPRInfo::nonPreservedNonArgumentGPR1;
+#endif
protected:
void forEachArg(Inst&, const ScopedLambda<Inst::EachArgCallback>&) final;
Modified: trunk/Source/_javascript_Core/b3/testb3.cpp (230097 => 230098)
--- trunk/Source/_javascript_Core/b3/testb3.cpp 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/b3/testb3.cpp 2018-03-30 05:13:32 UTC (rev 230098)
@@ -10233,7 +10233,7 @@
proc, Return, Origin(),
root->appendNew<CCallValue>(
proc, Int32, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunction)),
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(simpleFunction, B3CCallPtrTag)),
root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1)));
@@ -10260,7 +10260,7 @@
proc, Return, Origin(),
rare->appendNew<CCallValue>(
proc, Int32, Origin(),
- rare->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunction)),
+ rare->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(simpleFunction, B3CCallPtrTag)),
rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1),
rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR2)));
@@ -10289,7 +10289,7 @@
proc, Add, Origin(),
rare->appendNew<CCallValue>(
proc, Int32, Origin(),
- rare->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunction)),
+ rare->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(simpleFunction, B3CCallPtrTag)),
rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1),
rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR2)),
rare->appendNew<Value>(
@@ -10307,7 +10307,7 @@
proc, Return, Origin(),
root->appendNew<CCallValue>(
proc, Int32, Origin(), Effects::none(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunction)),
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(simpleFunction, B3CCallPtrTag)),
root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1)));
@@ -10330,7 +10330,7 @@
CCallValue* call = root->appendNew<CCallValue>(
proc, Int32, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(functionWithHellaArguments)));
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(functionWithHellaArguments, B3CCallPtrTag)));
call->children().appendVector(args);
root->appendNewControlValue(proc, Return, Origin(), call);
@@ -10356,7 +10356,7 @@
CCallValue* call = root->appendNew<CCallValue>(
proc, Int64, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(functionWithHellaArguments2)));
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(functionWithHellaArguments2, B3CCallPtrTag)));
call->children().appendVector(args);
root->appendNewControlValue(proc, Return, Origin(), call);
@@ -10378,7 +10378,7 @@
CCallValue* call = root->appendNew<CCallValue>(
proc, Int32, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(functionWithHellaArguments3)));
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(functionWithHellaArguments3, B3CCallPtrTag)));
call->children().appendVector(args);
root->appendNewControlValue(proc, Return, Origin(), call);
@@ -10429,7 +10429,7 @@
proc, Return, Origin(),
root->appendNew<CCallValue>(
proc, Double, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunctionDouble)),
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(simpleFunctionDouble, B3CCallPtrTag)),
root->appendNew<ArgumentRegValue>(proc, Origin(), FPRInfo::argumentFPR0),
root->appendNew<ArgumentRegValue>(proc, Origin(), FPRInfo::argumentFPR1)));
@@ -10455,7 +10455,7 @@
proc, Return, Origin(),
root->appendNew<CCallValue>(
proc, Float, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunctionFloat)),
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(simpleFunctionFloat, B3CCallPtrTag)),
floatValue1,
floatValue2));
@@ -10478,7 +10478,7 @@
CCallValue* call = root->appendNew<CCallValue>(
proc, Double, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(functionWithHellaDoubleArguments)));
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(functionWithHellaDoubleArguments, B3CCallPtrTag)));
call->children().appendVector(args);
root->appendNewControlValue(proc, Return, Origin(), call);
@@ -10502,7 +10502,7 @@
CCallValue* call = root->appendNew<CCallValue>(
proc, Float, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(functionWithHellaFloatArguments)));
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(functionWithHellaFloatArguments, B3CCallPtrTag)));
call->children().appendVector(args);
root->appendNewControlValue(proc, Return, Origin(), call);
@@ -10525,7 +10525,7 @@
proc, Return, Origin(),
root->appendNew<CCallValue>(
proc, Int32, Origin(),
- root->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunction)),
+ root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(simpleFunction, B3CCallPtrTag)),
root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1)));
@@ -13043,12 +13043,13 @@
jit.move(CCallHelpers::TrustedImm64(JITCodePoison::key()), poisonScratch);
jit.load64(CCallHelpers::BaseIndex(scratch, params[0].gpr(), CCallHelpers::timesPtr()), scratch);
jit.xor64(poisonScratch, scratch);
- jit.jump(scratch, NoPtrTag);
+ PtrTag tag = ptrTag(SwitchTablePtrTag, nextPtrTagID());
+ jit.jump(scratch, tag);
jit.addLinkTask(
[&, jumpTable, labels] (LinkBuffer& linkBuffer) {
for (unsigned i = labels.size(); i--;)
- jumpTable[i] = linkBuffer.locationOf(*labels[i], NoPtrTag);
+ jumpTable[i] = linkBuffer.locationOf(*labels[i], tag);
});
});
@@ -13131,7 +13132,7 @@
print->appendNew<CCallValue>(
proc, Void, Origin(),
print->appendNew<ConstPtrValue>(
- proc, Origin(), bitwise_cast<void*>(interpreterPrint)),
+ proc, Origin(), tagCFunctionPtr<void*>(interpreterPrint, B3CCallPtrTag)),
context,
print->appendNew<MemoryValue>(proc, Load, pointerType(), Origin(), dataPointerValue));
print->appendNew<VariableValue>(
@@ -14717,7 +14718,7 @@
[&] (BasicBlock* loop, Value*) -> Value* {
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), Effects::none(),
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14736,11 +14737,11 @@
effects.exitsSideways = true;
loop->appendNew<CCallValue>(
proc, Void, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(noOpFunction)));
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(noOpFunction, B3CCallPtrTag)));
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), Effects::none(),
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14759,11 +14760,11 @@
effects.writesPinned = true;
loop->appendNew<CCallValue>(
proc, Void, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(noOpFunction)));
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(noOpFunction, B3CCallPtrTag)));
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), Effects::none(),
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14782,11 +14783,11 @@
effects.writes = HeapRange(63479);
loop->appendNew<CCallValue>(
proc, Void, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(noOpFunction)));
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(noOpFunction, B3CCallPtrTag)));
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), Effects::none(),
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14805,7 +14806,7 @@
effects.readsLocalState = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14824,7 +14825,7 @@
effects.readsPinned = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14843,7 +14844,7 @@
effects.reads = HeapRange::top();
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14861,7 +14862,7 @@
[&] (BasicBlock* loop, Value*) -> Value* {
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), Effects::none(),
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14878,7 +14879,7 @@
[&] (BasicBlock* loop, Value* index) -> Value* {
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), Effects::none(),
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
index);
});
@@ -14897,7 +14898,7 @@
[&] (BasicBlock* loop, Value* index) -> Value* {
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), Effects::none(),
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
index);
});
@@ -14917,7 +14918,7 @@
effects.exitsSideways = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14936,7 +14937,7 @@
effects.writesLocalState = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14955,7 +14956,7 @@
effects.writes = HeapRange(666);
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14974,7 +14975,7 @@
effects.fence = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -14993,7 +14994,7 @@
effects.writesPinned = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -15012,7 +15013,7 @@
effects.controlDependent = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -15032,7 +15033,7 @@
effects.controlDependent = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -15051,13 +15052,13 @@
effects.exitsSideways = true;
loop->appendNew<CCallValue>(
proc, Void, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(noOpFunction)));
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(noOpFunction, B3CCallPtrTag)));
effects = Effects::none();
effects.controlDependent = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -15076,13 +15077,13 @@
effects.writesPinned = true;
loop->appendNew<CCallValue>(
proc, Void, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(noOpFunction)));
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(noOpFunction, B3CCallPtrTag)));
effects = Effects::none();
effects.readsPinned = true;
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -15101,13 +15102,13 @@
effects.writes = HeapRange(6436);
loop->appendNew<CCallValue>(
proc, Void, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(noOpFunction)));
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(noOpFunction, B3CCallPtrTag)));
effects = Effects::none();
effects.reads = HeapRange(4886);
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -15126,13 +15127,13 @@
effects.writes = HeapRange(6436, 74458);
loop->appendNew<CCallValue>(
proc, Void, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(noOpFunction)));
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(noOpFunction, B3CCallPtrTag)));
effects = Effects::none();
effects.reads = HeapRange(48864, 78239);
return loop->appendNew<CCallValue>(
proc, Int32, Origin(), effects,
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -15149,7 +15150,7 @@
[&] (BasicBlock* loop, Value*) -> Value* {
return loop->appendNew<CCallValue>(
proc, Int32, Origin(),
- loop->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(oneFunction)),
+ loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(oneFunction, B3CCallPtrTag)),
loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0));
});
@@ -16194,7 +16195,7 @@
unlikely->appendNew<CCallValue>(
proc, Void, Origin(),
- unlikely->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(functionNineArgs)),
+ unlikely->appendNew<ConstPtrValue>(proc, Origin(), tagCFunctionPtr<void*>(functionNineArgs, B3CCallPtrTag)),
constNumber, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
PatchpointValue* voidPatch = unlikely->appendNew<PatchpointValue>(proc, Void, Origin());
Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (230097 => 230098)
--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp 2018-03-30 05:13:32 UTC (rev 230098)
@@ -7660,8 +7660,8 @@
};
auto callWithExceptionCheck = [&] (void* callee) {
- jit.move(CCallHelpers::TrustedImmPtr(callee), GPRInfo::nonPreservedNonArgumentGPR);
- jit.call(GPRInfo::nonPreservedNonArgumentGPR, NoPtrTag);
+ jit.move(CCallHelpers::TrustedImmPtr(callee), GPRInfo::nonPreservedNonArgumentGPR0);
+ jit.call(GPRInfo::nonPreservedNonArgumentGPR0, NoPtrTag);
exceptions->append(jit.emitExceptionCheck(*vm, AssemblyHelpers::NormalExceptionCheck, AssemblyHelpers::FarJumpWidth));
};
@@ -7999,8 +7999,8 @@
RELEASE_ASSERT(!allocator.numberOfReusedRegisters());
auto callWithExceptionCheck = [&] (void* callee) {
- jit.move(CCallHelpers::TrustedImmPtr(callee), GPRInfo::nonPreservedNonArgumentGPR);
- jit.call(GPRInfo::nonPreservedNonArgumentGPR, NoPtrTag);
+ jit.move(CCallHelpers::TrustedImmPtr(callee), GPRInfo::nonPreservedNonArgumentGPR0);
+ jit.call(GPRInfo::nonPreservedNonArgumentGPR0, NoPtrTag);
exceptions->append(jit.emitExceptionCheck(*vm, AssemblyHelpers::NormalExceptionCheck, AssemblyHelpers::FarJumpWidth));
};
@@ -8187,8 +8187,8 @@
requiredBytes = WTF::roundUpToMultipleOf(stackAlignmentBytes(), requiredBytes);
jit.subPtr(CCallHelpers::TrustedImm32(requiredBytes), CCallHelpers::stackPointerRegister);
jit.setupArguments<decltype(operationCallEval)>(GPRInfo::regT1);
- jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(operationCallEval)), GPRInfo::nonPreservedNonArgumentGPR);
- jit.call(GPRInfo::nonPreservedNonArgumentGPR, NoPtrTag);
+ jit.move(CCallHelpers::TrustedImmPtr(bitwise_cast<void*>(operationCallEval)), GPRInfo::nonPreservedNonArgumentGPR0);
+ jit.call(GPRInfo::nonPreservedNonArgumentGPR0, NoPtrTag);
exceptions->append(jit.emitExceptionCheck(state->vm(), AssemblyHelpers::NormalExceptionCheck, AssemblyHelpers::FarJumpWidth));
CCallHelpers::Jump done = jit.branchTest64(CCallHelpers::NonZero, GPRInfo::returnValueGPR);
Modified: trunk/Source/_javascript_Core/jit/GPRInfo.h (230097 => 230098)
--- trunk/Source/_javascript_Core/jit/GPRInfo.h 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/jit/GPRInfo.h 2018-03-30 05:13:32 UTC (rev 230098)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -464,7 +464,8 @@
static const GPRReg returnValueGPR = X86Registers::eax; // regT0
static const GPRReg returnValueGPR2 = X86Registers::edx; // regT1 or regT2
static const GPRReg nonPreservedNonReturnGPR = X86Registers::r10; // regT5 (regT4 on Windows)
- static const GPRReg nonPreservedNonArgumentGPR = X86Registers::r10; // regT5 (regT4 on Windows)
+ static const GPRReg nonPreservedNonArgumentGPR0 = X86Registers::r10; // regT5 (regT4 on Windows)
+ static const GPRReg nonPreservedNonArgumentGPR1 = X86Registers::eax;
// FIXME: I believe that all uses of this are dead in the sense that it just causes the scratch
// register allocator to select a different register and potentially spill things. It would be better
@@ -660,7 +661,8 @@
static const GPRReg returnValueGPR = ARM64Registers::x0; // regT0
static const GPRReg returnValueGPR2 = ARM64Registers::x1; // regT1
static const GPRReg nonPreservedNonReturnGPR = ARM64Registers::x2;
- static const GPRReg nonPreservedNonArgumentGPR = ARM64Registers::x8;
+ static const GPRReg nonPreservedNonArgumentGPR0 = ARM64Registers::x8;
+ static const GPRReg nonPreservedNonArgumentGPR1 = ARM64Registers::x9;
static const GPRReg patchpointScratchRegister;
// GPRReg mapping is direct, the machine register numbers can
Modified: trunk/Source/_javascript_Core/runtime/PtrTag.h (230097 => 230098)
--- trunk/Source/_javascript_Core/runtime/PtrTag.h 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/runtime/PtrTag.h 2018-03-30 05:13:32 UTC (rev 230098)
@@ -35,6 +35,7 @@
v(NearJumpPtrTag) \
v(CFunctionPtrTag) \
\
+ v(B3CCallPtrTag) \
v(BytecodePtrTag) \
v(BytecodeHelperPtrTag) \
v(CodeEntryPtrTag) \
@@ -45,6 +46,7 @@
v(JITThunkPtrTag) \
v(NativeCodePtrTag) \
v(SlowPathPtrTag) \
+ v(SwitchTablePtrTag) \
\
v(Yarr8BitPtrTag) \
v(Yarr16BitPtrTag) \
Modified: trunk/Source/_javascript_Core/wasm/WasmBinding.cpp (230097 => 230098)
--- trunk/Source/_javascript_Core/wasm/WasmBinding.cpp 2018-03-30 05:05:15 UTC (rev 230097)
+++ trunk/Source/_javascript_Core/wasm/WasmBinding.cpp 2018-03-30 05:13:32 UTC (rev 230098)
@@ -42,7 +42,7 @@
const PinnedRegisterInfo& pinnedRegs = PinnedRegisterInfo::get();
JIT jit;
- GPRReg scratch = GPRInfo::nonPreservedNonArgumentGPR;
+ GPRReg scratch = GPRInfo::nonPreservedNonArgumentGPR0;
GPRReg baseMemory = pinnedRegs.baseMemoryPointer;
ASSERT(baseMemory != scratch);
const auto& sizeRegs = pinnedRegs.sizeRegisters;
_______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes