isValidForm for SimpleAddr should use ptr() instead of tmp()
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 May 2017 06:04:07 +0000 (06:04 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 May 2017 06:04:07 +0000 (06:04 +0000)
commit1f70ad8ea28d90eb8cc9a3c0af66df33894c7e1a
tree2fd58eaa6803573f5c2952568aca063303fb66da
parent948ce02c81f2109014d04ea3bbd6a07ec7b432f0
isValidForm for SimpleAddr should use ptr() instead of tmp()
https://bugs.webkit.org/show_bug.cgi?id=171992

Reviewed by Filip Pizlo.

Arg::tmp() asserts that its kind is Tmp. Inst::isValidForm for
SimpleAddr was using Arg::tmp() instead of ptr() to check
if the address Tmp isGP(). It should be using Arg::ptr() instead
of Arg::tmp() since Arg::ptr() is designed for SimpleAddr.

This patch also fixes an incorrect assertion in the ARM64
macro assembler. We were asserting various atomic ops were
only over 32/64 bit operations. However, the code was properly handling
8/16/32/64 bit ops. I changed the assertion to reflect what is
actually going on.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::ldar):
(JSC::ARM64Assembler::ldxr):
(JSC::ARM64Assembler::ldaxr):
(JSC::ARM64Assembler::stxr):
(JSC::ARM64Assembler::stlr):
(JSC::ARM64Assembler::stlxr):
* b3/air/opcode_generator.rb:
* b3/testb3.cpp:
(JSC::B3::testLoadAcq42):
(JSC::B3::testStoreRelAddLoadAcq32):
(JSC::B3::testStoreRelAddLoadAcq8):
(JSC::B3::testStoreRelAddFenceLoadAcq8):
(JSC::B3::testStoreRelAddLoadAcq16):
(JSC::B3::testStoreRelAddLoadAcq64):
(JSC::B3::testAtomicWeakCAS):
(JSC::B3::testAtomicStrongCAS):
(JSC::B3::testAtomicXchg):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/ARM64Assembler.h
Source/JavaScriptCore/b3/air/opcode_generator.rb
Source/JavaScriptCore/b3/testb3.cpp