Title: [256003] trunk/Source/_javascript_Core
Revision
256003
Author
rmoris...@apple.com
Date
2020-02-06 19:12:32 -0800 (Thu, 06 Feb 2020)

Log Message

Most of B3 and Air does not need to include CCallHelpers.h
https://bugs.webkit.org/show_bug.cgi?id=206975

Reviewed by Mark Lam.

They only do to use CCallHelpers::Jump or CCallHelpers::Label.
But CCallHelpers inherit those from MacroAssembler. And MacroAssembler.h is dramatically cheaper to include (since CCallHelpers includes AssemblyHelpers which includes CodeBlock.h which includes roughly the entire runtime).

* b3/B3CheckSpecial.cpp:
* b3/B3CheckSpecial.h:
* b3/B3LowerMacros.cpp:
* b3/B3PatchpointSpecial.cpp:
(JSC::B3::PatchpointSpecial::generate):
* b3/B3PatchpointSpecial.h:
* b3/B3StackmapGenerationParams.cpp:
(JSC::B3::StackmapGenerationParams::successorLabels const):
* b3/B3StackmapGenerationParams.h:
* b3/air/AirAllocateRegistersAndStackAndGenerateCode.h:
* b3/air/AirCCallSpecial.cpp:
* b3/air/AirCCallSpecial.h:
* b3/air/AirCode.cpp:
* b3/air/AirCode.h:
(JSC::B3::Air::Code::entrypointLabel const):
* b3/air/AirCustom.cpp:
(JSC::B3::Air::CCallCustom::generate):
(JSC::B3::Air::ShuffleCustom::generate):
(JSC::B3::Air::WasmBoundsCheckCustom::generate):
* b3/air/AirCustom.h:
(JSC::B3::Air::PatchCustom::generate):
(JSC::B3::Air::EntrySwitchCustom::generate):
* b3/air/AirDisassembler.cpp:
(JSC::B3::Air::Disassembler::addInst):
* b3/air/AirDisassembler.h:
* b3/air/AirGenerationContext.h:
* b3/air/AirInst.h:
* b3/air/AirPrintSpecial.cpp:
(JSC::B3::Air::PrintSpecial::generate):
* b3/air/AirPrintSpecial.h:
* b3/air/AirSpecial.h:
* b3/air/AirValidate.cpp:
* b3/air/opcode_generator.rb:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (256002 => 256003)


--- trunk/Source/_javascript_Core/ChangeLog	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-02-07 03:12:32 UTC (rev 256003)
@@ -1,3 +1,47 @@
+2020-02-06  Robin Morisset  <rmoris...@apple.com>
+
+        Most of B3 and Air does not need to include CCallHelpers.h
+        https://bugs.webkit.org/show_bug.cgi?id=206975
+
+        Reviewed by Mark Lam.
+
+        They only do to use CCallHelpers::Jump or CCallHelpers::Label.
+        But CCallHelpers inherit those from MacroAssembler. And MacroAssembler.h is dramatically cheaper to include (since CCallHelpers includes AssemblyHelpers which includes CodeBlock.h which includes roughly the entire runtime).
+
+        * b3/B3CheckSpecial.cpp:
+        * b3/B3CheckSpecial.h:
+        * b3/B3LowerMacros.cpp:
+        * b3/B3PatchpointSpecial.cpp:
+        (JSC::B3::PatchpointSpecial::generate):
+        * b3/B3PatchpointSpecial.h:
+        * b3/B3StackmapGenerationParams.cpp:
+        (JSC::B3::StackmapGenerationParams::successorLabels const):
+        * b3/B3StackmapGenerationParams.h:
+        * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h:
+        * b3/air/AirCCallSpecial.cpp:
+        * b3/air/AirCCallSpecial.h:
+        * b3/air/AirCode.cpp:
+        * b3/air/AirCode.h:
+        (JSC::B3::Air::Code::entrypointLabel const):
+        * b3/air/AirCustom.cpp:
+        (JSC::B3::Air::CCallCustom::generate):
+        (JSC::B3::Air::ShuffleCustom::generate):
+        (JSC::B3::Air::WasmBoundsCheckCustom::generate):
+        * b3/air/AirCustom.h:
+        (JSC::B3::Air::PatchCustom::generate):
+        (JSC::B3::Air::EntrySwitchCustom::generate):
+        * b3/air/AirDisassembler.cpp:
+        (JSC::B3::Air::Disassembler::addInst):
+        * b3/air/AirDisassembler.h:
+        * b3/air/AirGenerationContext.h:
+        * b3/air/AirInst.h:
+        * b3/air/AirPrintSpecial.cpp:
+        (JSC::B3::Air::PrintSpecial::generate):
+        * b3/air/AirPrintSpecial.h:
+        * b3/air/AirSpecial.h:
+        * b3/air/AirValidate.cpp:
+        * b3/air/opcode_generator.rb:
+
 2020-02-06  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r255987.

Modified: trunk/Source/_javascript_Core/b3/B3CheckSpecial.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3CheckSpecial.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3CheckSpecial.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -33,6 +33,7 @@
 #include "AirInstInlines.h"
 #include "B3StackmapGenerationParams.h"
 #include "B3ValueInlines.h"
+#include "CCallHelpers.h"
 
 namespace JSC { namespace B3 {
 

Modified: trunk/Source/_javascript_Core/b3/B3CheckSpecial.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3CheckSpecial.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3CheckSpecial.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -27,7 +27,6 @@
 
 #if ENABLE(B3_JIT)
 
-#include "AirArg.h"
 #include "AirKind.h"
 #include "B3StackmapSpecial.h"
 #include <wtf/HashMap.h>
@@ -129,7 +128,7 @@
     // NOTE: the generate method will generate the hidden branch and then register a LatePath that
     // generates the stackmap. Super crazy dude!
 
-    CCallHelpers::Jump generate(Air::Inst&, CCallHelpers&, Air::GenerationContext&) final;
+    MacroAssembler::Jump generate(Air::Inst&, CCallHelpers&, Air::GenerationContext&) final;
 
     void dumpImpl(PrintStream&) const final;
     void deepDumpImpl(PrintStream&) const final;

Modified: trunk/Source/_javascript_Core/b3/B3EliminateCommonSubexpressions.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3EliminateCommonSubexpressions.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3EliminateCommonSubexpressions.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -43,7 +43,6 @@
 #include "B3ValueInlines.h"
 #include "B3Variable.h"
 #include "B3VariableValue.h"
-#include "DFGGraph.h"
 #include <wtf/CommaPrinter.h>
 #include <wtf/HashMap.h>
 #include <wtf/ListDump.h>

Modified: trunk/Source/_javascript_Core/b3/B3MemoryValue.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3MemoryValue.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3MemoryValue.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -27,7 +27,6 @@
 
 #if ENABLE(B3_JIT)
 
-#include "AirArg.h"
 #include "B3Bank.h"
 #include "B3HeapRange.h"
 #include "B3Value.h"

Modified: trunk/Source/_javascript_Core/b3/B3PatchpointSpecial.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3PatchpointSpecial.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3PatchpointSpecial.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -146,7 +146,7 @@
     return admitsStack(inst, argIndex);
 }
 
-CCallHelpers::Jump PatchpointSpecial::generate(Inst& inst, CCallHelpers& jit, Air::GenerationContext& context)
+MacroAssembler::Jump PatchpointSpecial::generate(Inst& inst, CCallHelpers& jit, Air::GenerationContext& context)
 {
     const Procedure& procedure = code().proc();
     PatchpointValue* value = inst.origin->as<PatchpointValue>();
@@ -170,7 +170,7 @@
     
     value->m_generator->run(jit, params);
 
-    return CCallHelpers::Jump();
+    return MacroAssembler::Jump();
 }
 
 bool PatchpointSpecial::isTerminal(Inst& inst)

Modified: trunk/Source/_javascript_Core/b3/B3PatchpointSpecial.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3PatchpointSpecial.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3PatchpointSpecial.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -55,7 +55,7 @@
     // NOTE: the generate method will generate the hidden branch and then register a LatePath that
     // generates the stackmap. Super crazy dude!
 
-    CCallHelpers::Jump generate(Air::Inst&, CCallHelpers&, Air::GenerationContext&) final;
+    MacroAssembler::Jump generate(Air::Inst&, CCallHelpers&, Air::GenerationContext&) final;
     
     bool isTerminal(Air::Inst&) final;
 

Modified: trunk/Source/_javascript_Core/b3/B3StackmapGenerationParams.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3StackmapGenerationParams.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3StackmapGenerationParams.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -59,12 +59,12 @@
     return result;
 }
 
-Vector<Box<CCallHelpers::Label>> StackmapGenerationParams::successorLabels() const
+Vector<Box<MacroAssembler::Label>> StackmapGenerationParams::successorLabels() const
 {
     RELEASE_ASSERT(m_context.indexInBlock == m_context.currentBlock->size() - 1);
     RELEASE_ASSERT(m_value->effects().terminal);
     
-    Vector<Box<CCallHelpers::Label>> result(m_context.currentBlock->numSuccessors());
+    Vector<Box<MacroAssembler::Label>> result(m_context.currentBlock->numSuccessors());
     for (unsigned i = m_context.currentBlock->numSuccessors(); i--;)
         result[i] = m_context.blockLabels[m_context.currentBlock->successorBlock(i)];
     return result;

Modified: trunk/Source/_javascript_Core/b3/B3StackmapGenerationParams.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3StackmapGenerationParams.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3StackmapGenerationParams.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -29,12 +29,16 @@
 
 #include "AirGenerationContext.h"
 #include "B3ValueRep.h"
-#include "CCallHelpers.h"
+#include "MacroAssembler.h"
 #include "RegisterSet.h"
 #include <wtf/Box.h>
 
-namespace JSC { namespace B3 {
+namespace JSC {
 
+class CCallHelpers;
+
+namespace B3 {
+
 class CheckSpecial;
 class PatchpointSpecial;
 class Procedure;
@@ -89,7 +93,7 @@
     
     // This is computed lazily, so it won't work if you capture StackmapGenerationParams by value.
     // These labels will get populated before any late paths or link tasks execute.
-    JS_EXPORT_PRIVATE Vector<Box<CCallHelpers::Label>> successorLabels() const;
+    JS_EXPORT_PRIVATE Vector<Box<MacroAssembler::Label>> successorLabels() const;
     
     // This is computed lazily, so it won't work if you capture StackmapGenerationParams by value.
     // Returns true if the successor at the given index is going to be emitted right after the

Modified: trunk/Source/_javascript_Core/b3/B3StackmapValue.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/B3StackmapValue.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/B3StackmapValue.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -30,12 +30,15 @@
 #include "B3ConstrainedValue.h"
 #include "B3Value.h"
 #include "B3ValueRep.h"
-#include "CCallHelpers.h"
 #include "RegisterSet.h"
 #include <wtf/SharedTask.h>
 
-namespace JSC { namespace B3 {
+namespace JSC {
 
+class CCallHelpers;
+
+namespace B3 {
+
 class StackmapGenerationParams;
 
 typedef void StackmapGeneratorFunction(CCallHelpers&, const StackmapGenerationParams&);

Modified: trunk/Source/_javascript_Core/b3/air/AirAllocateRegistersAndStackAndGenerateCode.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirAllocateRegistersAndStackAndGenerateCode.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirAllocateRegistersAndStackAndGenerateCode.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -29,6 +29,7 @@
 
 #include "AirLiveness.h"
 #include "AirTmpMap.h"
+#include <wtf/Nonmovable.h>
 
 namespace JSC { 
 
@@ -87,8 +88,8 @@
     std::unique_ptr<UnifiedTmpLiveness> m_liveness;
 
     struct PatchSpillData {
-        CCallHelpers::Jump jump;
-        CCallHelpers::Label continueLabel;
+        MacroAssembler::Jump jump;
+        MacroAssembler::Label continueLabel;
         HashMap<Tmp, Arg*> defdTmps;
     };
 

Modified: trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -28,6 +28,8 @@
 
 #if ENABLE(B3_JIT)
 
+#include "CCallHelpers.h"
+
 namespace JSC { namespace B3 { namespace Air {
 
 CCallSpecial::CCallSpecial()

Modified: trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirCCallSpecial.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -28,6 +28,7 @@
 #if ENABLE(B3_JIT)
 
 #include "AirSpecial.h"
+#include "RegisterSet.h"
 
 namespace JSC { namespace B3 { namespace Air {
 
@@ -57,7 +58,7 @@
     bool admitsStack(Inst&, unsigned argIndex) final;
     bool admitsExtendedOffsetAddr(Inst&, unsigned) final;
     void reportUsedRegisters(Inst&, const RegisterSet&) final;
-    CCallHelpers::Jump generate(Inst&, CCallHelpers&, GenerationContext&) final;
+    MacroAssembler::Jump generate(Inst&, CCallHelpers&, GenerationContext&) final;
     RegisterSet extraEarlyClobberedRegs(Inst&) final;
     RegisterSet extraClobberedRegs(Inst&) final;
 

Modified: trunk/Source/_javascript_Core/b3/air/AirCode.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirCode.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirCode.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -35,6 +35,7 @@
 #include "B3BasicBlockUtils.h"
 #include "B3Procedure.h"
 #include "B3StackSlot.h"
+#include "CCallHelpers.h"
 #include <wtf/ListDump.h>
 #include <wtf/MathExtras.h>
 

Modified: trunk/Source/_javascript_Core/b3/air/AirCode.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirCode.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirCode.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -34,14 +34,20 @@
 #include "AirStackSlot.h"
 #include "AirTmp.h"
 #include "B3SparseCollection.h"
-#include "CCallHelpers.h"
+#include "GPRInfo.h"
+#include "MacroAssembler.h"
 #include "RegisterAtOffsetList.h"
 #include "StackAlignment.h"
+#include <wtf/HashSet.h>
 #include <wtf/IndexMap.h>
 #include <wtf/WeakRandom.h>
 
-namespace JSC { namespace B3 {
+namespace JSC {
 
+class CCallHelpers;
+
+namespace B3 {
+
 class Procedure;
 
 #if !ASSERT_ENABLED
@@ -196,7 +202,7 @@
         RELEASE_ASSERT(m_entrypoints.size() == m_prologueGenerators.size());
     }
     
-    CCallHelpers::Label entrypointLabel(unsigned index) const
+    MacroAssembler::Label entrypointLabel(unsigned index) const
     {
         return m_entrypointLabels[index];
     }
@@ -383,7 +389,7 @@
     RegisterSet m_calleeSaveRegisters;
     StackSlot* m_calleeSaveStackSlot { nullptr };
     Vector<FrequentedBlock> m_entrypoints; // This is empty until after lowerEntrySwitch().
-    Vector<CCallHelpers::Label> m_entrypointLabels; // This is empty until code generation.
+    Vector<MacroAssembler::Label> m_entrypointLabels; // This is empty until code generation.
     Vector<Ref<PrologueGenerator>, 1> m_prologueGenerators;
     RefPtr<WasmBoundsCheckGenerator> m_wasmBoundsCheckGenerator;
     const char* m_lastPhaseName;

Modified: trunk/Source/_javascript_Core/b3/air/AirCustom.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirCustom.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirCustom.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -31,6 +31,7 @@
 #include "AirInstInlines.h"
 #include "B3CCallValue.h"
 #include "B3ValueInlines.h"
+#include "CCallHelpers.h"
 
 namespace JSC { namespace B3 { namespace Air {
 
@@ -96,11 +97,11 @@
     return true;
 }
 
-CCallHelpers::Jump CCallCustom::generate(Inst& inst, CCallHelpers&, GenerationContext&)
+MacroAssembler::Jump CCallCustom::generate(Inst& inst, CCallHelpers&, GenerationContext&)
 {
     dataLog("FATAL: Unlowered C call: ", inst, "\n");
     UNREACHABLE_FOR_PLATFORM();
-    return CCallHelpers::Jump();
+    return MacroAssembler::Jump();
 }
 
 bool ShuffleCustom::isValidForm(Inst& inst)
@@ -171,11 +172,11 @@
     return true;
 }
 
-CCallHelpers::Jump ShuffleCustom::generate(Inst& inst, CCallHelpers&, GenerationContext&)
+MacroAssembler::Jump ShuffleCustom::generate(Inst& inst, CCallHelpers&, GenerationContext&)
 {
     dataLog("FATAL: Unlowered shuffle: ", inst, "\n");
     UNREACHABLE_FOR_PLATFORM();
-    return CCallHelpers::Jump();
+    return MacroAssembler::Jump();
 }
 
 bool WasmBoundsCheckCustom::isValidForm(Inst& inst)
@@ -188,7 +189,29 @@
     return inst.args[1].isReg() || inst.args[1].isTmp() || inst.args[1].isSomeImm();
 }
 
+MacroAssembler::Jump WasmBoundsCheckCustom::generate(Inst& inst, CCallHelpers& jit, GenerationContext& context)
+{
+    WasmBoundsCheckValue* value = inst.origin->as<WasmBoundsCheckValue>();
+    MacroAssembler::Jump outOfBounds = Inst(Air::Branch64, value, Arg::relCond(MacroAssembler::AboveOrEqual), inst.args[0], inst.args[1]).generate(jit, context);
 
+    context.latePaths.append(createSharedTask<GenerationContext::LatePathFunction>(
+        [outOfBounds, value] (CCallHelpers& jit, Air::GenerationContext& context) {
+            outOfBounds.link(&jit);
+            switch (value->boundsType()) {
+            case WasmBoundsCheckValue::Type::Pinned:
+                context.code->wasmBoundsCheckGenerator()->run(jit, value->bounds().pinnedSize);
+                break;
+
+            case WasmBoundsCheckValue::Type::Maximum:
+                context.code->wasmBoundsCheckGenerator()->run(jit, InvalidGPRReg);
+                break;
+            }
+        }));
+
+    // We said we were not a terminal.
+    return MacroAssembler::Jump();
+}
+
 } } } // namespace JSC::B3::Air
 
 #endif // ENABLE(B3_JIT)

Modified: trunk/Source/_javascript_Core/b3/air/AirCustom.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirCustom.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirCustom.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -33,6 +33,7 @@
 #include "AirSpecial.h"
 #include "B3ValueInlines.h"
 #include "B3WasmBoundsCheckValue.h"
+#include "MacroAssembler.h"
 
 namespace JSC { namespace B3 { namespace Air {
 
@@ -108,7 +109,7 @@
         return inst.args[0].special()->hasNonArgNonControlEffects(inst);
     }
 
-    static CCallHelpers::Jump generate(
+    static MacroAssembler::Jump generate(
         Inst& inst, CCallHelpers& jit, GenerationContext& context)
     {
         return inst.args[0].special()->generate(inst, jit, context);
@@ -181,7 +182,7 @@
     }
 
     // This just crashes, since we expect C calls to be lowered before generation.
-    static CCallHelpers::Jump generate(Inst&, CCallHelpers&, GenerationContext&);
+    static MacroAssembler::Jump generate(Inst&, CCallHelpers&, GenerationContext&);
 };
 
 struct ColdCCallCustom : CCallCustom {
@@ -248,7 +249,7 @@
         return false;
     }
 
-    static CCallHelpers::Jump generate(Inst&, CCallHelpers&, GenerationContext&);
+    static MacroAssembler::Jump generate(Inst&, CCallHelpers&, GenerationContext&);
 };
 
 struct EntrySwitchCustom : public CommonCustomBase<EntrySwitchCustom> {
@@ -288,12 +289,12 @@
         return false;
     }
 
-    static CCallHelpers::Jump generate(Inst&, CCallHelpers&, GenerationContext&)
+    static MacroAssembler::Jump generate(Inst&, CCallHelpers&, GenerationContext&)
     {
         // This should never be reached because we should have lowered EntrySwitch before
         // generation.
         UNREACHABLE_FOR_PLATFORM();
-        return CCallHelpers::Jump();
+        return MacroAssembler::Jump();
     }
 };
 
@@ -333,28 +334,7 @@
         return true;
     }
 
-    static CCallHelpers::Jump generate(Inst& inst, CCallHelpers& jit, GenerationContext& context)
-    {
-        WasmBoundsCheckValue* value = inst.origin->as<WasmBoundsCheckValue>();
-        CCallHelpers::Jump outOfBounds = Inst(Air::Branch64, value, Arg::relCond(CCallHelpers::AboveOrEqual), inst.args[0], inst.args[1]).generate(jit, context);
-
-        context.latePaths.append(createSharedTask<GenerationContext::LatePathFunction>(
-            [outOfBounds, value] (CCallHelpers& jit, Air::GenerationContext& context) {
-                outOfBounds.link(&jit);
-                switch (value->boundsType()) {
-                case WasmBoundsCheckValue::Type::Pinned:
-                    context.code->wasmBoundsCheckGenerator()->run(jit, value->bounds().pinnedSize);
-                    break;
-
-                case WasmBoundsCheckValue::Type::Maximum:
-                    context.code->wasmBoundsCheckGenerator()->run(jit, InvalidGPRReg);
-                    break;
-                }
-            }));
-
-        // We said we were not a terminal.
-        return CCallHelpers::Jump();
-    }
+    static MacroAssembler::Jump generate(Inst&, CCallHelpers&, GenerationContext&);
 };
 
 } } } // namespace JSC::B3::Air

Modified: trunk/Source/_javascript_Core/b3/air/AirDisassembler.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirDisassembler.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirDisassembler.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -32,6 +32,7 @@
 #include "AirCode.h"
 #include "AirInst.h"
 #include "B3Value.h"
+#include "CCallHelpers.h"
 #include "Disassembler.h"
 #include "LinkBuffer.h"
 
@@ -63,7 +64,7 @@
     m_blocks.append(block);
 }
 
-void Disassembler::addInst(Inst* inst, CCallHelpers::Label start, CCallHelpers::Label end)
+void Disassembler::addInst(Inst* inst, MacroAssembler::Label start, MacroAssembler::Label end)
 {
     auto addResult = m_instToRange.add(inst, std::make_pair(start, end));
     RELEASE_ASSERT(addResult.isNewEntry);

Modified: trunk/Source/_javascript_Core/b3/air/AirDisassembler.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirDisassembler.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirDisassembler.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -27,10 +27,11 @@
 
 #if ENABLE(B3_JIT)
 
-#include "CCallHelpers.h"
+#include "MacroAssembler.h"
 
 namespace JSC { 
 
+class CCallHelpers;
 class LinkBuffer;
 
 namespace B3 { namespace Air {
@@ -49,17 +50,17 @@
     void startLatePath(CCallHelpers&);
     void endLatePath(CCallHelpers&);
     void startBlock(BasicBlock*, CCallHelpers&);
-    void addInst(Inst*, CCallHelpers::Label, CCallHelpers::Label);
+    void addInst(Inst*, MacroAssembler::Label, MacroAssembler::Label);
 
-    void dump(Code&, PrintStream&, LinkBuffer&, const char* airPrefix, const char* asmPrefix, const ScopedLambda<void(Inst&)>& doToEachInst);
+    void dump(Code&, PrintStream&, LinkBuffer&, const char* airPrefix, const char* asmPrefix, const WTF::ScopedLambda<void(Inst&)>& doToEachInst);
 
 private:
-    HashMap<Inst*, std::pair<CCallHelpers::Label, CCallHelpers::Label>> m_instToRange;
+    HashMap<Inst*, std::pair<MacroAssembler::Label, MacroAssembler::Label>> m_instToRange;
     Vector<BasicBlock*> m_blocks;
-    CCallHelpers::Label m_entrypointStart;
-    CCallHelpers::Label m_entrypointEnd;
-    CCallHelpers::Label m_latePathStart;
-    CCallHelpers::Label m_latePathEnd;
+    MacroAssembler::Label m_entrypointStart;
+    MacroAssembler::Label m_entrypointEnd;
+    MacroAssembler::Label m_latePathStart;
+    MacroAssembler::Label m_latePathEnd;
 };
 
 } } } // namespace JSC::B3::Air

Modified: trunk/Source/_javascript_Core/b3/air/AirGenerationContext.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirGenerationContext.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirGenerationContext.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -28,7 +28,7 @@
 #if ENABLE(B3_JIT)
 
 #include "AirBasicBlock.h"
-#include "CCallHelpers.h"
+#include "MacroAssembler.h"
 #include <wtf/Box.h>
 #include <wtf/IndexMap.h>
 #include <wtf/SharedTask.h>
@@ -48,7 +48,7 @@
     typedef SharedTask<LatePathFunction> LatePath;
 
     Vector<RefPtr<LatePath>> latePaths;
-    IndexMap<BasicBlock*, Box<CCallHelpers::Label>> blockLabels;
+    IndexMap<BasicBlock*, Box<MacroAssembler::Label>> blockLabels;
     BasicBlock* currentBlock { nullptr };
     unsigned indexInBlock { UINT_MAX };
     Code* code { nullptr };

Modified: trunk/Source/_javascript_Core/b3/air/AirInst.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirInst.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirInst.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -29,7 +29,8 @@
 
 #include "AirArg.h"
 #include "AirKind.h"
-#include "CCallHelpers.h"
+#include "MacroAssembler.h"
+#include <wtf/ScopedLambda.h>
 
 namespace JSC {
 
@@ -191,7 +192,7 @@
     // Generate some code for this instruction. This is, like, literally our backend. If this is the
     // terminal, it returns the jump that needs to be linked for the "then" case, with the "else"
     // case being fall-through. This function is auto-generated by opcode_generator.rb.
-    CCallHelpers::Jump generate(CCallHelpers&, GenerationContext&);
+    MacroAssembler::Jump generate(CCallHelpers&, GenerationContext&);
 
     // If source arguments benefits from being aliased to a destination argument,
     // this return the index of the destination argument.

Modified: trunk/Source/_javascript_Core/b3/air/AirPhaseScope.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirPhaseScope.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirPhaseScope.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -31,6 +31,7 @@
 #include "AirCode.h"
 #include "AirValidate.h"
 #include "B3Common.h"
+#include <wtf/StringPrintStream.h>
 
 namespace JSC { namespace B3 { namespace Air {
 

Modified: trunk/Source/_javascript_Core/b3/air/AirPrintSpecial.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirPrintSpecial.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirPrintSpecial.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -29,6 +29,7 @@
 #if ENABLE(B3_JIT)
 #if ENABLE(MASM_PROBE)
 
+#include "CCallHelpers.h"
 #include "MacroAssemblerPrinter.h"
 
 namespace JSC { namespace B3 { namespace Air {
@@ -65,7 +66,7 @@
 {
 }
 
-CCallHelpers::Jump PrintSpecial::generate(Inst& inst, CCallHelpers& jit, GenerationContext&)
+MacroAssembler::Jump PrintSpecial::generate(Inst& inst, CCallHelpers& jit, GenerationContext&)
 {
     size_t currentArg = 1; // Skip the PrintSpecial arg.
     for (auto& term : *m_printRecordList) {

Modified: trunk/Source/_javascript_Core/b3/air/AirPrintSpecial.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirPrintSpecial.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirPrintSpecial.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -33,6 +33,9 @@
 #include "MacroAssemblerPrinter.h"
 
 namespace JSC {
+
+class CCallHelpers;
+
 namespace Printer {
 
 typedef Vector<B3::Air::Arg> ArgList;
@@ -105,7 +108,7 @@
     bool admitsStack(Inst&, unsigned argIndex) final;
     bool admitsExtendedOffsetAddr(Inst&, unsigned) final;
     void reportUsedRegisters(Inst&, const RegisterSet&) final;
-    CCallHelpers::Jump generate(Inst&, CCallHelpers&, GenerationContext&) final;
+    MacroAssembler::Jump generate(Inst&, CCallHelpers&, GenerationContext&) final;
     RegisterSet extraEarlyClobberedRegs(Inst&) final;
     RegisterSet extraClobberedRegs(Inst&) final;
     

Modified: trunk/Source/_javascript_Core/b3/air/AirSpecial.h (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirSpecial.h	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirSpecial.h	2020-02-07 03:12:32 UTC (rev 256003)
@@ -83,7 +83,7 @@
     // Currently, we do (1) for B3 stackmaps.
     virtual void reportUsedRegisters(Inst&, const RegisterSet&) = 0;
     
-    virtual CCallHelpers::Jump generate(Inst&, CCallHelpers&, GenerationContext&) = 0;
+    virtual MacroAssembler::Jump generate(Inst&, CCallHelpers&, GenerationContext&) = 0;
 
     virtual RegisterSet extraEarlyClobberedRegs(Inst&) = 0;
     virtual RegisterSet extraClobberedRegs(Inst&) = 0;

Modified: trunk/Source/_javascript_Core/b3/air/AirValidate.cpp (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/AirValidate.cpp	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/AirValidate.cpp	2020-02-07 03:12:32 UTC (rev 256003)
@@ -31,6 +31,7 @@
 #include "AirCode.h"
 #include "AirInstInlines.h"
 #include "B3Procedure.h"
+#include <wtf/StringPrintStream.h>
 
 namespace JSC { namespace B3 { namespace Air {
 

Modified: trunk/Source/_javascript_Core/b3/air/opcode_generator.rb (256002 => 256003)


--- trunk/Source/_javascript_Core/b3/air/opcode_generator.rb	2020-02-07 03:08:39 UTC (rev 256002)
+++ trunk/Source/_javascript_Core/b3/air/opcode_generator.rb	2020-02-07 03:12:32 UTC (rev 256003)
@@ -804,6 +804,7 @@
 writeH("OpcodeGenerated") {
     | outp |
     outp.puts "#include \"AirInstInlines.h\""
+    outp.puts "#include \"CCallHelpers.h\""
     outp.puts "#include \"wtf/PrintStream.h\""
     outp.puts "namespace WTF {"
     outp.puts "using namespace JSC::B3::Air;"
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to