Title: [194363] trunk/Source/_javascript_Core
Revision
194363
Author
[email protected]
Date
2015-12-22 08:20:48 -0800 (Tue, 22 Dec 2015)

Log Message

Snippefy op_negate for the baseline JIT.
https://bugs.webkit.org/show_bug.cgi?id=152447

Reviewed by Benjamin Poulain.

* CMakeLists.txt:
* _javascript_Core.vcxproj/_javascript_Core.vcxproj:
* _javascript_Core.vcxproj/_javascript_Core.vcxproj.filters:
* _javascript_Core.xcodeproj/project.pbxproj:
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_unsigned):
(JSC::JIT::emit_op_negate):
(JSC::JIT::emitSlow_op_negate):
(JSC::JIT::emitBitBinaryOpFastPath):
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_op_negate): Deleted.
(JSC::JIT::emitSlow_op_negate): Deleted.
* jit/JITNegGenerator.cpp: Added.
(JSC::JITNegGenerator::generateFastPath):
* jit/JITNegGenerator.h: Added.
(JSC::JITNegGenerator::JITNegGenerator):
(JSC::JITNegGenerator::didEmitFastPath):
(JSC::JITNegGenerator::endJumpList):
(JSC::JITNegGenerator::slowPathJumpList):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (194362 => 194363)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2015-12-22 14:22:03 UTC (rev 194362)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2015-12-22 16:20:48 UTC (rev 194363)
@@ -473,6 +473,7 @@
     jit/JITInlineCacheGenerator.cpp
     jit/JITLeftShiftGenerator.cpp
     jit/JITMulGenerator.cpp
+    jit/JITNegGenerator.cpp
     jit/JITOpcodes.cpp
     jit/JITOpcodes32_64.cpp
     jit/JITOperations.cpp

Modified: trunk/Source/_javascript_Core/ChangeLog (194362 => 194363)


--- trunk/Source/_javascript_Core/ChangeLog	2015-12-22 14:22:03 UTC (rev 194362)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-12-22 16:20:48 UTC (rev 194363)
@@ -1,3 +1,31 @@
+2015-12-21  Mark Lam  <[email protected]>
+
+        Snippefy op_negate for the baseline JIT.
+        https://bugs.webkit.org/show_bug.cgi?id=152447
+
+        Reviewed by Benjamin Poulain.
+
+        * CMakeLists.txt:
+        * _javascript_Core.vcxproj/_javascript_Core.vcxproj:
+        * _javascript_Core.vcxproj/_javascript_Core.vcxproj.filters:
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        * jit/JITArithmetic.cpp:
+        (JSC::JIT::emit_op_unsigned):
+        (JSC::JIT::emit_op_negate):
+        (JSC::JIT::emitSlow_op_negate):
+        (JSC::JIT::emitBitBinaryOpFastPath):
+        * jit/JITArithmetic32_64.cpp:
+        (JSC::JIT::emit_compareAndJump):
+        (JSC::JIT::emit_op_negate): Deleted.
+        (JSC::JIT::emitSlow_op_negate): Deleted.
+        * jit/JITNegGenerator.cpp: Added.
+        (JSC::JITNegGenerator::generateFastPath):
+        * jit/JITNegGenerator.h: Added.
+        (JSC::JITNegGenerator::JITNegGenerator):
+        (JSC::JITNegGenerator::didEmitFastPath):
+        (JSC::JITNegGenerator::endJumpList):
+        (JSC::JITNegGenerator::slowPathJumpList):
+
 2015-12-21  Filip Pizlo  <[email protected]>
 
         Address review feedback from Saam.  I should have landed it in r194354.

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj (194362 => 194363)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj	2015-12-22 14:22:03 UTC (rev 194362)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj	2015-12-22 16:20:48 UTC (rev 194363)
@@ -657,6 +657,7 @@
     <ClCompile Include="..\jit\JITInlineCacheGenerator.cpp" />
     <ClCompile Include="..\jit\JITLeftShiftGenerator.cpp" />
     <ClCompile Include="..\jit\JITMulGenerator.cpp" />
+    <ClCompile Include="..\jit\JITNegGenerator.cpp" />
     <ClCompile Include="..\jit\JITOpcodes.cpp" />
     <ClCompile Include="..\jit\JITOpcodes32_64.cpp" />
     <ClCompile Include="..\jit\JITOperations.cpp" />
@@ -1490,6 +1491,7 @@
     <ClInclude Include="..\jit\JITInlines.h" />
     <ClInclude Include="..\jit\JITLeftShiftGenerator.h" />
     <ClInclude Include="..\jit\JITMulGenerator.h" />
+    <ClInclude Include="..\jit\JITNegGenerator.h" />
     <ClInclude Include="..\jit\JITOperations.h" />
     <ClInclude Include="..\jit\JITRightShiftGenerator.h" />
     <ClInclude Include="..\jit\JITStubRoutine.h" />

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters (194362 => 194363)


--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters	2015-12-22 14:22:03 UTC (rev 194362)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters	2015-12-22 16:20:48 UTC (rev 194363)
@@ -462,6 +462,9 @@
     <ClCompile Include="..\jit\JITMulGenerator.cpp">
       <Filter>jit</Filter>
     </ClCompile>
+    <ClCompile Include="..\jit\JITNegGenerator.cpp">
+      <Filter>jit</Filter>
+    </ClCompile>
     <ClCompile Include="..\jit\JITOpcodes.cpp">
       <Filter>jit</Filter>
     </ClCompile>
@@ -2582,6 +2585,9 @@
     <ClInclude Include="..\jit\JITMulGenerator.h">
       <Filter>jit</Filter>
     </ClInclude>
+    <ClInclude Include="..\jit\JITNegGenerator.h">
+      <Filter>jit</Filter>
+    </ClInclude>
     <ClInclude Include="..\jit\JITRightShiftGenerator.h">
       <Filter>jit</Filter>
     </ClInclude>

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (194362 => 194363)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2015-12-22 14:22:03 UTC (rev 194362)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2015-12-22 16:20:48 UTC (rev 194363)
@@ -2054,6 +2054,8 @@
 		FE7BA60F1A1A7CEC00F1F7B4 /* HeapVerifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE7BA60D1A1A7CEC00F1F7B4 /* HeapVerifier.cpp */; };
 		FE7BA6101A1A7CEC00F1F7B4 /* HeapVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = FE7BA60E1A1A7CEC00F1F7B4 /* HeapVerifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FE7C41961B97FC4B00F4D598 /* PingPongStackOverflowTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDA50D41B97F442009A3B4F /* PingPongStackOverflowTest.cpp */; };
+		FE99B2491C24C3D300C82159 /* JITNegGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE99B2481C24B6D300C82159 /* JITNegGenerator.h */; settings = {ASSET_TAGS = (); }; };
+		FE99B24A1C24C3D700C82159 /* JITNegGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE99B2471C24B6D300C82159 /* JITNegGenerator.cpp */; settings = {ASSET_TAGS = (); }; };
 		FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FEA08621182B7A0400F6D851 /* DebuggerPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FEA1E4391C213A2B00277A16 /* ValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEA1E4381C213A2600277A16 /* ValueProfile.cpp */; settings = {ASSET_TAGS = (); }; };
@@ -4261,6 +4263,8 @@
 		FE7BA60E1A1A7CEC00F1F7B4 /* HeapVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapVerifier.h; sourceTree = "<group>"; };
 		FE90BB3A1B7CF64E006B3F03 /* VMInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInlines.h; sourceTree = "<group>"; };
 		FE98B5B61BB9AE110073E7A6 /* JITSubGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITSubGenerator.h; sourceTree = "<group>"; };
+		FE99B2471C24B6D300C82159 /* JITNegGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITNegGenerator.cpp; sourceTree = "<group>"; };
+		FE99B2481C24B6D300C82159 /* JITNegGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITNegGenerator.h; sourceTree = "<group>"; };
 		FEA0861E182B7A0400F6D851 /* Breakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakpoint.h; sourceTree = "<group>"; };
 		FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebuggerPrimitives.h; sourceTree = "<group>"; };
 		FEA1E4381C213A2600277A16 /* ValueProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ValueProfile.cpp; sourceTree = "<group>"; };
@@ -4970,6 +4974,8 @@
 				FE3A06B71C1103D900390FDD /* JITLeftShiftGenerator.h */,
 				FE1879FF1BFBC73C0038BBCA /* JITMulGenerator.cpp */,
 				FE187A001BFBC73C0038BBCA /* JITMulGenerator.h */,
+				FE99B2471C24B6D300C82159 /* JITNegGenerator.cpp */,
+				FE99B2481C24B6D300C82159 /* JITNegGenerator.h */,
 				BCDD51E90FB8DF74004A8BDC /* JITOpcodes.cpp */,
 				A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */,
 				0F24E54517EE274900ABB217 /* JITOperations.cpp */,
@@ -7228,6 +7234,7 @@
 				0FC20CB61852E2C600C9E954 /* DFGStrengthReductionPhase.h in Headers */,
 				0F63947815DCE34B006A597C /* DFGStructureAbstractValue.h in Headers */,
 				0F50AF3C193E8B3900674EE8 /* DFGStructureClobberState.h in Headers */,
+				FE99B2491C24C3D300C82159 /* JITNegGenerator.h in Headers */,
 				0F79085619A290B200F6310C /* DFGStructureRegistrationPhase.h in Headers */,
 				0F2FCCFF18A60070001A27F8 /* DFGThreadData.h in Headers */,
 				70B791991C024A29002481E2 /* GeneratorPrototype.h in Headers */,
@@ -8964,6 +8971,7 @@
 				BCDD51EB0FB8DF74004A8BDC /* JITOpcodes.cpp in Sources */,
 				A71236E51195F33C00BD2174 /* JITOpcodes32_64.cpp in Sources */,
 				0F24E54C17EE274900ABB217 /* JITOperations.cpp in Sources */,
+				FE99B24A1C24C3D700C82159 /* JITNegGenerator.cpp in Sources */,
 				86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */,
 				A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */,
 				0F766D2815A8CC1E008F363E /* JITStubRoutine.cpp in Sources */,

Modified: trunk/Source/_javascript_Core/jit/JITArithmetic.cpp (194362 => 194363)


--- trunk/Source/_javascript_Core/jit/JITArithmetic.cpp	2015-12-22 14:22:03 UTC (rev 194362)
+++ trunk/Source/_javascript_Core/jit/JITArithmetic.cpp	2015-12-22 16:20:48 UTC (rev 194363)
@@ -37,6 +37,7 @@
 #include "JITInlines.h"
 #include "JITLeftShiftGenerator.h"
 #include "JITMulGenerator.h"
+#include "JITNegGenerator.h"
 #include "JITOperations.h"
 #include "JITRightShiftGenerator.h"
 #include "JITSubGenerator.h"
@@ -197,39 +198,6 @@
 
 #if USE(JSVALUE64)
 
-void JIT::emit_op_negate(Instruction* currentInstruction)
-{
-    int dst = currentInstruction[1].u.operand;
-    int src = ""
-
-    emitGetVirtualRegister(src, regT0);
-
-    Jump srcNotInt = emitJumpIfNotInt(regT0);
-    addSlowCase(branchTest32(Zero, regT0, TrustedImm32(0x7fffffff)));
-    neg32(regT0);
-    emitTagInt(regT0, regT0);
-
-    Jump end = jump();
-
-    srcNotInt.link(this);
-    emitJumpSlowCaseIfNotNumber(regT0);
-
-    move(TrustedImm64((int64_t)0x8000000000000000ull), regT1);
-    xor64(regT1, regT0);
-
-    end.link(this);
-    emitPutVirtualRegister(dst);
-}
-
-void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
-{
-    linkSlowCase(iter); // 0x7fffffff check
-    linkSlowCase(iter); // double check
-
-    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_negate);
-    slowPathCall.call();
-}
-
 void JIT::emit_op_unsigned(Instruction* currentInstruction)
 {
     int result = currentInstruction[1].u.operand;
@@ -498,6 +466,41 @@
 
 #endif // USE(JSVALUE64)
 
+void JIT::emit_op_negate(Instruction* currentInstruction)
+{
+    int result = currentInstruction[1].u.operand;
+    int src = ""
+
+#if USE(JSVALUE64)
+    JSValueRegs srcRegs = JSValueRegs(regT0);
+    JSValueRegs resultRegs = srcRegs;
+    GPRReg scratchGPR = regT2;
+#else
+    JSValueRegs srcRegs = JSValueRegs(regT1, regT0);
+    JSValueRegs resultRegs = srcRegs;
+    GPRReg scratchGPR = regT4;
+#endif
+
+    emitGetVirtualRegister(src, srcRegs);
+
+    JITNegGenerator gen(resultRegs, srcRegs, scratchGPR);
+    gen.generateFastPath(*this);
+
+    ASSERT(gen.didEmitFastPath());
+    gen.endJumpList().link(this);
+    emitPutVirtualRegister(result, resultRegs);
+
+    addSlowCase(gen.slowPathJumpList());
+}
+
+void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+    linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
+
+    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_negate);
+    slowPathCall.call();
+}
+
 template<typename SnippetGenerator>
 void JIT::emitBitBinaryOpFastPath(Instruction* currentInstruction)
 {

Modified: trunk/Source/_javascript_Core/jit/JITArithmetic32_64.cpp (194362 => 194363)


--- trunk/Source/_javascript_Core/jit/JITArithmetic32_64.cpp	2015-12-22 14:22:03 UTC (rev 194362)
+++ trunk/Source/_javascript_Core/jit/JITArithmetic32_64.cpp	2015-12-22 16:20:48 UTC (rev 194363)
@@ -42,40 +42,6 @@
 
 namespace JSC {
 
-void JIT::emit_op_negate(Instruction* currentInstruction)
-{
-    int dst = currentInstruction[1].u.operand;
-    int src = ""
-
-    emitLoad(src, regT1, regT0);
-
-    Jump srcNotInt = branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag));
-    addSlowCase(branchTest32(Zero, regT0, TrustedImm32(0x7fffffff)));
-    neg32(regT0);
-    emitStoreInt32(dst, regT0, (dst == src));
-
-    Jump end = jump();
-
-    srcNotInt.link(this);
-    addSlowCase(branch32(Above, regT1, TrustedImm32(JSValue::LowestTag)));
-
-    xor32(TrustedImm32(1 << 31), regT1);
-    store32(regT1, tagFor(dst));
-    if (dst != src)
-        store32(regT0, payloadFor(dst));
-
-    end.link(this);
-}
-
-void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
-{
-    linkSlowCase(iter); // 0x7fffffff check
-    linkSlowCase(iter); // double check
-
-    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_negate);
-    slowPathCall.call();
-}
-
 void JIT::emit_compareAndJump(OpcodeID opcode, int op1, int op2, unsigned target, RelationalCondition condition)
 {
     JumpList notInt32Op1;

Added: trunk/Source/_javascript_Core/jit/JITNegGenerator.cpp (0 => 194363)


--- trunk/Source/_javascript_Core/jit/JITNegGenerator.cpp	                        (rev 0)
+++ trunk/Source/_javascript_Core/jit/JITNegGenerator.cpp	2015-12-22 16:20:48 UTC (rev 194363)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JITNegGenerator.h"
+
+#if ENABLE(JIT)
+
+namespace JSC {
+
+void JITNegGenerator::generateFastPath(CCallHelpers& jit)
+{
+    ASSERT(m_scratchGPR != m_src.payloadGPR());
+    ASSERT(m_scratchGPR != m_result.payloadGPR());
+    ASSERT(m_scratchGPR != InvalidGPRReg);
+#if USE(JSVALUE32_64)
+    ASSERT(m_scratchGPR != m_src.tagGPR());
+    ASSERT(m_scratchGPR != m_result.tagGPR());
+#endif
+
+    m_didEmitFastPath = true;
+
+    jit.moveValueRegs(m_src, m_result);
+    CCallHelpers::Jump srcNotInt = jit.branchIfNotInt32(m_src);
+
+    // -0 should produce a double, and hence cannot be negated as an int.
+    // The negative int32 0x80000000 doesn't have a positive int32 representation, and hence cannot be negated as an int.
+    m_slowPathJumpList.append(jit.branchTest32(CCallHelpers::Zero, m_src.payloadGPR(), CCallHelpers::TrustedImm32(0x7fffffff)));
+
+    jit.neg32(m_result.payloadGPR());
+#if USE(JSVALUE64)
+    jit.boxInt32(m_result.payloadGPR(), m_result);
+#endif
+    m_endJumpList.append(jit.jump());
+
+    srcNotInt.link(&jit);
+    m_slowPathJumpList.append(jit.branchIfNotNumber(m_src, m_scratchGPR));
+
+    // For a double, all we need to do is to invert the sign bit.
+#if USE(JSVALUE64)
+    jit.move(CCallHelpers::TrustedImm64((int64_t)(1ull << 63)), m_scratchGPR);
+    jit.xor64(m_scratchGPR, m_result.payloadGPR());
+#else
+    jit.xor32(CCallHelpers::TrustedImm32(1 << 31), m_result.tagGPR());
+#endif
+}
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)

Added: trunk/Source/_javascript_Core/jit/JITNegGenerator.h (0 => 194363)


--- trunk/Source/_javascript_Core/jit/JITNegGenerator.h	                        (rev 0)
+++ trunk/Source/_javascript_Core/jit/JITNegGenerator.h	2015-12-22 16:20:48 UTC (rev 194363)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JITNegGenerator_h
+#define JITNegGenerator_h
+
+#if ENABLE(JIT)
+
+#include "CCallHelpers.h"
+#include "SnippetOperand.h"
+
+namespace JSC {
+
+class JITNegGenerator {
+public:
+    JITNegGenerator(JSValueRegs result, JSValueRegs src, GPRReg scratchGPR)
+        : m_result(result)
+        , m_src(src)
+        , m_scratchGPR(scratchGPR)
+    { }
+
+    void generateFastPath(CCallHelpers&);
+
+    bool didEmitFastPath() const { return m_didEmitFastPath; }
+    CCallHelpers::JumpList& endJumpList() { return m_endJumpList; }
+    CCallHelpers::JumpList& slowPathJumpList() { return m_slowPathJumpList; }
+
+private:
+    JSValueRegs m_result;
+    JSValueRegs m_src;
+    GPRReg m_scratchGPR;
+    bool m_didEmitFastPath { false };
+
+    CCallHelpers::JumpList m_endJumpList;
+    CCallHelpers::JumpList m_slowPathJumpList;
+};
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
+
+#endif // JITNegGenerator_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to