- Revision
- 161300
- Author
- [email protected]
- Date
- 2014-01-03 17:27:01 -0800 (Fri, 03 Jan 2014)
Log Message
cstack Branch: ARM64 LLInt fails to compile due to instructions limitations with sp
https://bugs.webkit.org/show_bug.cgi?id=126423
Reviewed by Filip Pizlo.
Disabled the checkStackPointerAlignment macro for ARM64 since it will fault on any
improper changes to the stack pointer that result in bad alignment.
Changed uses of sp to either move into a temp register for certain operations, or
changed the order of subtract operands. The operand ordering includes branch
compare pseudo ops. In the process discovered that sanitizeStackForVM was plain
wrong and never executed the clear loop, so I fixed that while changing the operand
ordering of the compares.
The ARM64 build also complains that we are doing a compare and branch to a
non-local label so I changed branchIfException to branch around a jmp to
a possible global label.
Tested on X86-64.
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
Modified Paths
Diff
Modified: branches/jsCStack/Source/_javascript_Core/ChangeLog (161299 => 161300)
--- branches/jsCStack/Source/_javascript_Core/ChangeLog 2014-01-04 01:20:12 UTC (rev 161299)
+++ branches/jsCStack/Source/_javascript_Core/ChangeLog 2014-01-04 01:27:01 UTC (rev 161300)
@@ -1,5 +1,30 @@
2014-01-03 Michael Saboff <[email protected]>
+ cstack Branch: ARM64 LLInt fails to compile due to instructions limitations with sp
+ https://bugs.webkit.org/show_bug.cgi?id=126423
+
+ Reviewed by Filip Pizlo.
+
+ Disabled the checkStackPointerAlignment macro for ARM64 since it will fault on any
+ improper changes to the stack pointer that result in bad alignment.
+
+ Changed uses of sp to either move into a temp register for certain operations, or
+ changed the order of subtract operands. The operand ordering includes branch
+ compare pseudo ops. In the process discovered that sanitizeStackForVM was plain
+ wrong and never executed the clear loop, so I fixed that while changing the operand
+ ordering of the compares.
+
+ The ARM64 build also complains that we are doing a compare and branch to a
+ non-local label so I changed branchIfException to branch around a jmp to
+ a possible global label.
+
+ Tested on X86-64.
+
+ * llint/LowLevelInterpreter.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2014-01-03 Michael Saboff <[email protected]>
+
CStack Branch: Make emitPutToCallFrameHeaderBeforePrologue and friends work for all platforms
https://bugs.webkit.org/show_bug.cgi?id=126421
Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm (161299 => 161300)
--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm 2014-01-04 01:20:12 UTC (rev 161299)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter.asm 2014-01-04 01:27:01 UTC (rev 161300)
@@ -217,11 +217,15 @@
end
macro checkStackPointerAlignment(tempReg, location)
- andp sp, 0xf, tempReg
- btpz tempReg, .stackPointerOkay
- move location, tempReg
- break
-.stackPointerOkay:
+ if ARM64
+ # ARM64 will check for us!
+ else
+ andp sp, 0xf, tempReg
+ btpz tempReg, .stackPointerOkay
+ move location, tempReg
+ break
+ .stackPointerOkay:
+ end
end
macro preserveCallerPCAndCFR()
@@ -433,7 +437,12 @@
cCall2(osrSlowPath, cfr, PC)
btpz t0, .recover
move cfr, sp # restore the previous sp
- pop cfr # pop the callerFrame since we will jump to a function that wants to save it
+ # pop the callerFrame since we will jump to a function that wants to save it
+ if ARM64
+ popLRAndFP
+ else
+ pop cfr
+ end
jmp t0
.recover:
codeBlockGetter(t1)
@@ -568,16 +577,17 @@
end
loadp VM::m_lastStackTop[vm], address
- bpaeq address, sp, .zeroFillDone
+ bpbeq sp, address, .zeroFillDone
move 0, zeroValue
.zeroFillLoop:
storep zeroValue, [address]
- subp PtrSize, address
- bpb address, sp, .zeroFillDone
+ addp PtrSize, address
+ bpa sp, address, .zeroFillLoop
.zeroFillDone:
- storep sp, VM::m_lastStackTop[vm]
+ move sp, address
+ storep address, VM::m_lastStackTop[vm]
ret
Modified: branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (161299 => 161300)
--- branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2014-01-04 01:20:12 UTC (rev 161299)
+++ branches/jsCStack/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2014-01-04 01:27:01 UTC (rev 161300)
@@ -125,10 +125,12 @@
# estimated stackPointerAtVMEntry value. Adjust the jsStackLimit by
# the delta between the actual stackPointerAtVMEntry and the estimate
# that we used previously.
- subp VM::stackPointerAtVMEntry[vm], sp, temp2
+ move sp, temp2
+ subp VM::stackPointerAtVMEntry[vm], temp2, temp2
subp VM::m_jsStackLimit[vm], temp2, temp2
storep temp2, VM::m_jsStackLimit[vm]
- storep sp, VM::stackPointerAtVMEntry[vm]
+ move sp, temp2
+ storep temp2, VM::stackPointerAtVMEntry[vm]
# The stack host zone ensures that we have adequate space for the
# VMEntrySentinelFrame. Proceed with allocating and initializing the
@@ -199,7 +201,8 @@
jmp .copyArgsLoop
.copyArgsDone:
- storep sp, VM::topCallFrame[vm]
+ move sp, temp2
+ storep temp2, VM::topCallFrame[vm]
move 0xffff000000000000, csr1
addp 2, csr1, csr2
@@ -433,7 +436,9 @@
loadp ScopeChain[cfr], t3
andp MarkedBlockMask, t3
loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3
- btqnz VM::m_exception[t3], label
+ btqz VM::m_exception[t3], .noException
+ jmp label
+.noException:
end