Title: [159261] trunk/Source/_javascript_Core
Revision
159261
Author
[email protected]
Date
2013-11-13 16:44:22 -0800 (Wed, 13 Nov 2013)

Log Message

Fix the ARM64 build after recent _javascript_Core changes
https://bugs.webkit.org/show_bug.cgi?id=124315

Reviewed by Michael Saboff.

Based on patches by myself, Filip Pizlo, Benjamin Poulain, and Michael Saboff.

* Configurations/_javascript_Core.xcconfig: Hid the symbol for
std::bad_function_call.
* _javascript_Core.xcodeproj/project.pbxproj: Marked
MacroAssemblerARM64.h and ARM64Assembler.h as Private headers.
* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::executableOffsetFor):
* assembler/MacroAssemblerARM64.h: Removed ARM64's executableCopy(),
which was removed from other assembler backends in r157690.
(JSC::MacroAssemblerARM64::shouldBlindForSpecificArch): Added.
(JSC::MacroAssemblerARM64::lshift64): Added.
(JSC::MacroAssemblerARM64::mul64): Added.
(JSC::MacroAssemblerARM64::rshift64): Added.
(JSC::MacroAssemblerARM64::convertInt64ToDouble): Added.
(JSC::MacroAssemblerARM64::branchMul64): Added.
(JSC::MacroAssemblerARM64::branchNeg64): Added.
(JSC::MacroAssemblerARM64::scratchRegisterForBlinding): Added.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithDiv): Changed
SpeculateIntegerOperand to SpeculateInt32Operand,
nodeCanIgnoreNegativeZero() to bytecodeCanIgnoreNegativeZero(), and
nodeUsedAsNumber() to bytecodeUsesAsNumber().
(JSC::DFG::SpeculativeJIT::compileArithMod): Changed
nodeCanIgnoreNegativeZero() to bytecodeCanIgnoreNegativeZero().

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (159260 => 159261)


--- trunk/Source/_javascript_Core/ChangeLog	2013-11-14 00:22:09 UTC (rev 159260)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-11-14 00:44:22 UTC (rev 159261)
@@ -1,3 +1,36 @@
+2013-11-13  Andy Estes  <[email protected]>
+
+        Fix the ARM64 build after recent _javascript_Core changes
+        https://bugs.webkit.org/show_bug.cgi?id=124315
+
+        Reviewed by Michael Saboff.
+
+        Based on patches by myself, Filip Pizlo, Benjamin Poulain, and Michael Saboff.
+
+        * Configurations/_javascript_Core.xcconfig: Hid the symbol for
+        std::bad_function_call.
+        * _javascript_Core.xcodeproj/project.pbxproj: Marked
+        MacroAssemblerARM64.h and ARM64Assembler.h as Private headers.
+        * assembler/ARM64Assembler.h:
+        (JSC::ARM64Assembler::executableOffsetFor):
+        * assembler/MacroAssemblerARM64.h: Removed ARM64's executableCopy(),
+        which was removed from other assembler backends in r157690.
+        (JSC::MacroAssemblerARM64::shouldBlindForSpecificArch): Added.
+        (JSC::MacroAssemblerARM64::lshift64): Added.
+        (JSC::MacroAssemblerARM64::mul64): Added.
+        (JSC::MacroAssemblerARM64::rshift64): Added.
+        (JSC::MacroAssemblerARM64::convertInt64ToDouble): Added.
+        (JSC::MacroAssemblerARM64::branchMul64): Added.
+        (JSC::MacroAssemblerARM64::branchNeg64): Added.
+        (JSC::MacroAssemblerARM64::scratchRegisterForBlinding): Added.
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::compileArithDiv): Changed
+        SpeculateIntegerOperand to SpeculateInt32Operand,
+        nodeCanIgnoreNegativeZero() to bytecodeCanIgnoreNegativeZero(), and
+        nodeUsedAsNumber() to bytecodeUsesAsNumber().
+        (JSC::DFG::SpeculativeJIT::compileArithMod): Changed
+        nodeCanIgnoreNegativeZero() to bytecodeCanIgnoreNegativeZero().
+
 2013-11-13  Oliver Hunt  <[email protected]>
 
         Fix debug build.

Modified: trunk/Source/_javascript_Core/Configurations/_javascript_Core.xcconfig (159260 => 159261)


--- trunk/Source/_javascript_Core/Configurations/_javascript_Core.xcconfig	2013-11-14 00:22:09 UTC (rev 159260)
+++ trunk/Source/_javascript_Core/Configurations/_javascript_Core.xcconfig	2013-11-14 00:44:22 UTC (rev 159261)
@@ -35,7 +35,7 @@
 JSVALUE_MODEL_x86_64 = 64;
 
 // Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols.
-OTHER_LDFLAGS_HIDE_SYMBOLS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv -Wl,-unexported_symbol -Wl,__ZNKSt3__18functionIFvvEEclEv -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvvEEC1EOS2_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvvEEC2EOS2_ -Wl,-unexported_symbol -Wl,__ZNKSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEEclES3_S5_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEED1Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEED2Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvvEED1Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvvEED2Ev -Wl,-all_load;
+OTHER_LDFLAGS_HIDE_SYMBOLS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv -Wl,-unexported_symbol -Wl,__ZNKSt3__18functionIFvvEEclEv -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvvEEC1EOS2_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvvEEC2EOS2_ -Wl,-unexported_symbol -Wl,__ZNKSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEEclES3_S5_ -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEED1Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvRN3JSC17BytecodeGeneratorEPNS1_10RegisterIDEEED2Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvvEED1Ev -Wl,-unexported_symbol -Wl,__ZNSt3__18functionIFvvEED2Ev -Wl,-unexported_symbol -Wl,__ZTVNSt3__117bad_function_callE -Wl,-all_load;
 
 OTHER_LDFLAGS_BASE = -lobjc -Wl,-Y,3 $(OTHER_LDFLAGS_HIDE_SYMBOLS);
 OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_$(PLATFORM_NAME));

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (159260 => 159261)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2013-11-14 00:22:09 UTC (rev 159260)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2013-11-14 00:44:22 UTC (rev 159261)
@@ -878,6 +878,8 @@
 		A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; };
 		A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		A1A009C01831A22D00CF8711 /* MacroAssemblerARM64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923C156EED3B00566CB2 /* MacroAssemblerARM64.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923B156EED3B00566CB2 /* ARM64Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873717CBE85300C3E643 /* MapConstructor.cpp */; };
 		A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; };
 		A700873D17CBE8D300C3E643 /* MapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873B17CBE8D300C3E643 /* MapPrototype.cpp */; };
@@ -4264,6 +4266,7 @@
 				A70B083317A0B79B00DAF14B /* DFGBinarySwitch.h in Headers */,
 				A7D89CF417A0B8CC00773AD8 /* DFGBlockInsertionSet.h in Headers */,
 				0F8364B7164B0C110053329A /* DFGBranchDirection.h in Headers */,
+				A1A009C01831A22D00CF8711 /* MacroAssemblerARM64.h in Headers */,
 				86EC9DC51328DF82002B2AD7 /* DFGByteCodeParser.h in Headers */,
 				0F256C361627B0AD007F2783 /* DFGCallArrayAllocatorSlowPathGenerator.h in Headers */,
 				0F7B294B14C3CD2F007C3DB1 /* DFGCapabilities.h in Headers */,
@@ -4679,6 +4682,7 @@
 				E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */,
 				969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */,
 				0F2BDC2C151FDE9100CD8910 /* Operands.h in Headers */,
+				A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */,
 				A70447EA17A0BD4600F5898E /* OperandsInlines.h in Headers */,
 				BC18C4480E16F5CD00B34460 /* Operations.h in Headers */,
 				0FE228ED1436AB2700196C48 /* Options.h in Headers */,

Modified: trunk/Source/_javascript_Core/assembler/ARM64Assembler.h (159260 => 159261)


--- trunk/Source/_javascript_Core/assembler/ARM64Assembler.h	2013-11-14 00:22:09 UTC (rev 159260)
+++ trunk/Source/_javascript_Core/assembler/ARM64Assembler.h	2013-11-14 00:44:22 UTC (rev 159261)
@@ -2495,11 +2495,6 @@
             return 0;
         return static_cast<int32_t*>(m_buffer.data())[location / sizeof(int32_t) - 1];
     }
-    
-    PassRefPtr<ExecutableMemoryHandle> executableCopy(VM& vm, void* ownerUID, JITCompilationEffort effort)
-    {
-        return m_buffer.executableCopy(vm, ownerUID, effort);
-    }
 
     void* unlinkedCode() { return m_buffer.data(); }
     size_t codeSize() const { return m_buffer.codeSize(); }

Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerARM64.h (159260 => 159261)


--- trunk/Source/_javascript_Core/assembler/MacroAssemblerARM64.h	2013-11-14 00:22:09 UTC (rev 159260)
+++ trunk/Source/_javascript_Core/assembler/MacroAssemblerARM64.h	2013-11-14 00:44:22 UTC (rev 159261)
@@ -127,6 +127,10 @@
     static const RegisterID framePointerRegister = ARM64Registers::fp;
     static const RegisterID linkRegister = ARM64Registers::lr;
 
+    // FIXME: Get reasonable implementations for these
+    static bool shouldBlindForSpecificArch(uint32_t value) { return value >= 0x00ffffff; }
+    static bool shouldBlindForSpecificArch(uint64_t value) { return value >= 0x00ffffff; }
+    static bool shouldBlindForSpecificArch(uintptr_t value) { return value >= 0x00ffffff; }
 
     // Integer operations:
 
@@ -373,10 +377,35 @@
         lshift32(dest, imm, dest);
     }
 
+    void lshift64(RegisterID src, RegisterID shiftAmount, RegisterID dest)
+    {
+        m_assembler.lsl<64>(dest, src, shiftAmount);
+    }
+
+    void lshift64(RegisterID src, TrustedImm32 imm, RegisterID dest)
+    {
+        m_assembler.lsl<64>(dest, src, imm.m_value & 0x3f);
+    }
+
+    void lshift64(RegisterID shiftAmount, RegisterID dest)
+    {
+        lshift64(dest, shiftAmount, dest);
+    }
+
+    void lshift64(TrustedImm32 imm, RegisterID dest)
+    {
+        lshift64(dest, imm, dest);
+    }
+    
     void mul32(RegisterID src, RegisterID dest)
     {
         m_assembler.mul<32>(dest, dest, src);
     }
+    
+    void mul64(RegisterID src, RegisterID dest)
+    {
+        m_assembler.mul<64>(dest, dest, src);
+    }
 
     void mul32(TrustedImm32 imm, RegisterID src, RegisterID dest)
     {
@@ -494,6 +523,26 @@
     {
         rshift32(dest, imm, dest);
     }
+    
+    void rshift64(RegisterID src, RegisterID shiftAmount, RegisterID dest)
+    {
+        m_assembler.lsr<64>(dest, src, shiftAmount);
+    }
+    
+    void rshift64(RegisterID src, TrustedImm32 imm, RegisterID dest)
+    {
+        m_assembler.lsr<64>(dest, src, imm.m_value & 0x3f);
+    }
+    
+    void rshift64(RegisterID shiftAmount, RegisterID dest)
+    {
+        rshift64(dest, shiftAmount, dest);
+    }
+    
+    void rshift64(TrustedImm32 imm, RegisterID dest)
+    {
+        rshift64(dest, imm, dest);
+    }
 
     void sub32(RegisterID src, RegisterID dest)
     {
@@ -1187,6 +1236,11 @@
         convertInt32ToDouble(dataTempRegister, dest);
     }
     
+    void convertInt64ToDouble(RegisterID src, FPRegisterID dest)
+    {
+        m_assembler.scvtf<64, 64>(dest, src);
+    }
+    
     void divDouble(FPRegisterID src, FPRegisterID dest)
     {
         divDouble(dest, src, dest);
@@ -1828,12 +1882,41 @@
         return branchMul32(cond, dataTempRegister, src, dest);
     }
 
+    Jump branchMul64(ResultCondition cond, RegisterID src1, RegisterID src2, RegisterID dest)
+    {
+        ASSERT(cond != Signed);
+
+        // This is a signed multiple of two 64-bit values, producing a 64-bit result.
+        m_assembler.mul<64>(dest, src1, src2);
+
+        if (cond != Overflow)
+            return branchTest64(cond, dest);
+
+        // Compute bits 127..64 of the result into dataTempRegister.
+        m_assembler.smulh(getCachedDataTempRegisterIDAndInvalidate(), src1, src2);
+        // Splat bit 63 of the result to bits 63..0 of memoryTempRegister.
+        m_assembler.asr<64>(getCachedMemoryTempRegisterIDAndInvalidate(), dest, 63);
+        // Check that bits 31..63 of the original result were all equal.
+        return branch64(NotEqual, memoryTempRegister, dataTempRegister);
+    }
+
+    Jump branchMul64(ResultCondition cond, RegisterID src, RegisterID dest)
+    {
+        return branchMul64(cond, dest, src, dest);
+    }
+
     Jump branchNeg32(ResultCondition cond, RegisterID dest)
     {
         m_assembler.neg<32, S>(dest, dest);
         return Jump(makeBranch(cond));
     }
 
+    Jump branchNeg64(ResultCondition cond, RegisterID srcDest)
+    {
+        m_assembler.neg<64, S>(srcDest, srcDest);
+        return Jump(makeBranch(cond));
+    }
+
     Jump branchSub32(ResultCondition cond, RegisterID dest)
     {
         m_assembler.neg<32, S>(dest, dest);
@@ -2190,6 +2273,8 @@
         return ARM64Assembler::maxJumpReplacementSize();
     }
 
+    RegisterID scratchRegisterForBlinding() { return getCachedDataTempRegisterIDAndInvalidate(); }
+
     static bool canJumpReplacePatchableBranchPtrWithPatch() { return false; }
     
     static CodeLocationLabel startOfBranchPtrWithPatchOnRegister(CodeLocationDataLabelPtr label)

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (159260 => 159261)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2013-11-14 00:22:09 UTC (rev 159260)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2013-11-14 00:44:22 UTC (rev 159261)
@@ -3479,8 +3479,8 @@
 
         int32Result(quotient.gpr(), node);
 #elif CPU(ARM64)
-        SpeculateIntegerOperand op1(this, node->child1());
-        SpeculateIntegerOperand op2(this, node->child2());
+        SpeculateInt32Operand op1(this, node->child1());
+        SpeculateInt32Operand op2(this, node->child2());
         GPRReg op1GPR = op1.gpr();
         GPRReg op2GPR = op2.gpr();
         GPRTemporary quotient(this);
@@ -3488,7 +3488,7 @@
 
         // If the user cares about negative zero, then speculate that we're not about
         // to produce negative zero.
-        if (!nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
+        if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
             MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR);
             speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0)));
             numeratorNonZero.link(&m_jit);
@@ -3498,7 +3498,7 @@
 
         // Check that there was no remainder. If there had been, then we'd be obligated to
         // produce a double result instead.
-        if (nodeUsedAsNumber(node->arithNodeFlags())) {
+        if (bytecodeUsesAsNumber(node->arithNodeFlags())) {
             speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotient.gpr(), op2GPR, multiplyAnswer.gpr()));
             speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branch32(JITCompiler::NotEqual, multiplyAnswer.gpr(), op1GPR));
         }
@@ -3770,7 +3770,7 @@
 
         // If the user cares about negative zero, then speculate that we're not about
         // to produce negative zero.
-        if (!nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
+        if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
             // Check that we're not about to create negative zero.
             JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0));
             speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, quotientThenRemainderGPR));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to