From 7a9983fe0187256ff18fcf72a82928978a388f3a Mon Sep 17 00:00:00 2001 From: KONNO Kazuhiro Date: Wed, 31 Jul 2024 14:19:32 +0900 Subject: [PATCH] Remove evaluators for String.compress() and some other methods This commit removes the evaluators for the following methods for p and x platforms. They are no longer used. - String.compress([C[BII)I - String.compressNoCheck([C[BII)V - String.andOR([CII)I Signed-off-by: KONNO Kazuhiro --- runtime/compiler/build/files/host/amd64.mk | 1 - runtime/compiler/build/files/host/i386.mk | 1 - runtime/compiler/build/files/host/p.mk | 1 - .../codegen/J9RecognizedMethodsEnum.hpp | 3 - runtime/compiler/env/j9method.cpp | 3 - .../compiler/p/codegen/J9TreeEvaluator.cpp | 203 ------ runtime/compiler/p/runtime/CMakeLists.txt | 1 - .../p/runtime/J9PPCCompressString.spp | 78 --- .../compiler/p/runtime/PPCCompressString.inc | 608 ------------------ runtime/compiler/runtime/Runtime.cpp | 34 - runtime/compiler/x/amd64/runtime/.gitignore | 1 - .../x/amd64/runtime/AMD64CompressString.inc | 225 ------- .../x/amd64/runtime/AMD64CompressString.nasm | 35 - .../compiler/x/amd64/runtime/CMakeLists.txt | 1 - .../compiler/x/codegen/J9TreeEvaluator.cpp | 177 ----- .../compiler/x/codegen/J9TreeEvaluator.hpp | 3 - runtime/compiler/x/i386/runtime/.gitignore | 1 - .../compiler/x/i386/runtime/CMakeLists.txt | 1 - .../x/i386/runtime/IA32CompressString.inc | 246 ------- .../x/i386/runtime/J9IA32CompressString.nasm | 34 - 20 files changed, 1657 deletions(-) delete mode 100644 runtime/compiler/p/runtime/J9PPCCompressString.spp delete mode 100644 runtime/compiler/p/runtime/PPCCompressString.inc delete mode 100644 runtime/compiler/x/amd64/runtime/AMD64CompressString.inc delete mode 100644 runtime/compiler/x/amd64/runtime/AMD64CompressString.nasm delete mode 100644 runtime/compiler/x/i386/runtime/IA32CompressString.inc delete mode 100644 runtime/compiler/x/i386/runtime/J9IA32CompressString.nasm diff --git a/runtime/compiler/build/files/host/amd64.mk b/runtime/compiler/build/files/host/amd64.mk index 1590959750e..6b10c73c5c6 100644 --- a/runtime/compiler/build/files/host/amd64.mk +++ b/runtime/compiler/build/files/host/amd64.mk @@ -19,5 +19,4 @@ # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 JIT_PRODUCT_SOURCE_FILES+=\ - compiler/x/amd64/runtime/AMD64CompressString.nasm \ compiler/x/amd64/runtime/AMD64Recompilation.nasm diff --git a/runtime/compiler/build/files/host/i386.mk b/runtime/compiler/build/files/host/i386.mk index 954bbd31621..879532f3dc0 100644 --- a/runtime/compiler/build/files/host/i386.mk +++ b/runtime/compiler/build/files/host/i386.mk @@ -20,6 +20,5 @@ JIT_PRODUCT_SOURCE_FILES+=\ compiler/x/i386/runtime/IA32Recompilation.nasm \ - compiler/x/i386/runtime/J9IA32CompressString.nasm \ compiler/x/i386/runtime/J9IA32Math64.nasm diff --git a/runtime/compiler/build/files/host/p.mk b/runtime/compiler/build/files/host/p.mk index bf7afc03fa6..49ada1f34f9 100644 --- a/runtime/compiler/build/files/host/p.mk +++ b/runtime/compiler/build/files/host/p.mk @@ -29,7 +29,6 @@ JIT_PRODUCT_SOURCE_FILES+=\ compiler/p/runtime/J9PPCArrayTranslate.spp \ compiler/p/runtime/J9PPCCRC32.spp \ compiler/p/runtime/J9PPCCRC32_wrapper.c \ - compiler/p/runtime/J9PPCCompressString.spp \ compiler/p/runtime/J9PPCEncodeUTF16.spp \ compiler/p/runtime/Math.spp \ compiler/p/runtime/PPCHWProfiler.cpp \ diff --git a/runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp b/runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp index e80575d85ef..46b902e553e 100644 --- a/runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp +++ b/runtime/compiler/codegen/J9RecognizedMethodsEnum.hpp @@ -218,9 +218,6 @@ java_lang_String_equalsIgnoreCase, java_lang_String_encodeASCII, java_lang_String_compareToIgnoreCase, - java_lang_String_compress, - java_lang_String_andOR, - java_lang_String_compressNoCheck, java_lang_String_unsafeCharAt, java_lang_String_split_str_int, java_lang_String_getChars_charArray, diff --git a/runtime/compiler/env/j9method.cpp b/runtime/compiler/env/j9method.cpp index d5b28f8f174..b02e1a80933 100644 --- a/runtime/compiler/env/j9method.cpp +++ b/runtime/compiler/env/j9method.cpp @@ -2781,9 +2781,6 @@ void TR_ResolvedJ9Method::construct() { TR::java_lang_String_regionMatchesInternal, 21, "regionMatchesInternal", (int16_t)-1, "*"}, {x(TR::java_lang_String_equalsIgnoreCase, "equalsIgnoreCase", "(Ljava/lang/String;)Z")}, {x(TR::java_lang_String_compareToIgnoreCase, "compareToIgnoreCase", "(Ljava/lang/String;)I")}, - {x(TR::java_lang_String_compress, "compress", "([C[BII)I")}, - {x(TR::java_lang_String_compressNoCheck, "compressNoCheck", "([C[BII)V")}, - {x(TR::java_lang_String_andOR, "andOR", "([CII)I")}, {x(TR::java_lang_String_unsafeCharAt, "unsafeCharAt", "(I)C")}, {x(TR::java_lang_String_split_str_int, "split", "(Ljava/lang/String;I)[Ljava/lang/String;")}, {x(TR::java_lang_String_getChars_charArray, "getChars", "(II[CI)V")}, diff --git a/runtime/compiler/p/codegen/J9TreeEvaluator.cpp b/runtime/compiler/p/codegen/J9TreeEvaluator.cpp index 5497a3edf1f..23298414fb9 100644 --- a/runtime/compiler/p/codegen/J9TreeEvaluator.cpp +++ b/runtime/compiler/p/codegen/J9TreeEvaluator.cpp @@ -9593,195 +9593,6 @@ static TR::Register *inlineAtomicOperation(TR::Node *node, TR::CodeGenerator *cg return resultReg; } -static TR::Register *compressStringEvaluator(TR::Node *node, TR::CodeGenerator *cg, bool japaneseMethod) - { - TR_J9VMBase *fej9 = (TR_J9VMBase *) (cg->comp()->fe()); - TR::Node *srcObjNode, *dstObjNode, *startNode, *lengthNode; - TR::Register *srcObjReg = NULL, *dstObjReg = NULL, *lengthReg = NULL, *startReg = NULL; - - srcObjNode = node->getChild(0); - dstObjNode = node->getChild(1); - startNode = node->getChild(2); - lengthNode = node->getChild(3); - - bool stopUsingCopyReg1, stopUsingCopyReg2, stopUsingCopyReg3, stopUsingCopyReg4; - - stopUsingCopyReg1 = TR::TreeEvaluator::stopUsingCopyReg(srcObjNode, srcObjReg, cg); - stopUsingCopyReg2 = TR::TreeEvaluator::stopUsingCopyReg(dstObjNode, dstObjReg, cg); - stopUsingCopyReg3 = TR::TreeEvaluator::stopUsingCopyReg(startNode, startReg, cg); - stopUsingCopyReg4 = TR::TreeEvaluator::stopUsingCopyReg(lengthNode, lengthReg, cg); - - uintptr_t hdrSize = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); - generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, srcObjReg, srcObjReg, hdrSize); - generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, dstObjReg, dstObjReg, hdrSize); - - TR::RegisterDependencyConditions *conditions = new (cg->trHeapMemory()) TR::RegisterDependencyConditions(12, 12, cg->trMemory()); - TR::Register *cndRegister = cg->allocateRegister(TR_CCR); - TR::Register *resultReg = cg->allocateRegister(TR_GPR); - TR::addDependency(conditions, cndRegister, TR::RealRegister::cr0, TR_CCR, cg); - TR::addDependency(conditions, lengthReg, TR::RealRegister::gr8, TR_GPR, cg); - TR::addDependency(conditions, startReg, TR::RealRegister::gr7, TR_GPR, cg); - TR::addDependency(conditions, srcObjReg, TR::RealRegister::gr9, TR_GPR, cg); - TR::addDependency(conditions, dstObjReg, TR::RealRegister::gr10, TR_GPR, cg); - - TR::addDependency(conditions, NULL, TR::RealRegister::gr0, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr11, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr6, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr4, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr5, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr12, TR_GPR, cg); - TR::addDependency(conditions, resultReg, TR::RealRegister::gr3, TR_GPR, cg); - - if (japaneseMethod) - TR::TreeEvaluator::generateHelperBranchAndLinkInstruction(TR_PPCcompressStringJ, node, conditions, cg); - else - TR::TreeEvaluator::generateHelperBranchAndLinkInstruction(TR_PPCcompressString, node, conditions, cg); - - TR::Register* regs[5] = - { - lengthReg, startReg, srcObjReg, dstObjReg, resultReg - }; - conditions->stopUsingDepRegs(cg, 5, regs); - for (uint16_t i = 0; i < node->getNumChildren(); i++) - cg->decReferenceCount(node->getChild(i)); - if (stopUsingCopyReg1) - cg->stopUsingRegister(srcObjReg); - if (stopUsingCopyReg2) - cg->stopUsingRegister(dstObjReg); - if (stopUsingCopyReg3) - cg->stopUsingRegister(startReg); - if (stopUsingCopyReg4) - cg->stopUsingRegister(lengthReg); - - node->setRegister(resultReg); - - cg->machine()->setLinkRegisterKilled(true); - cg->setHasCall(); - return (resultReg); - } - -static TR::Register *compressStringNoCheckEvaluator(TR::Node *node, TR::CodeGenerator *cg, bool japaneseMethod) - { - TR_J9VMBase *fej9 = (TR_J9VMBase *) (cg->comp()->fe()); - TR::Node *srcObjNode, *dstObjNode, *startNode, *lengthNode; - TR::Register *srcObjReg = NULL, *dstObjReg = NULL, *lengthReg = NULL, *startReg = NULL; - - srcObjNode = node->getChild(0); - dstObjNode = node->getChild(1); - startNode = node->getChild(2); - lengthNode = node->getChild(3); - - bool stopUsingCopyReg1, stopUsingCopyReg2, stopUsingCopyReg3, stopUsingCopyReg4; - - stopUsingCopyReg1 = TR::TreeEvaluator::stopUsingCopyReg(srcObjNode, srcObjReg, cg); - stopUsingCopyReg2 = TR::TreeEvaluator::stopUsingCopyReg(dstObjNode, dstObjReg, cg); - stopUsingCopyReg3 = TR::TreeEvaluator::stopUsingCopyReg(startNode, startReg, cg); - stopUsingCopyReg4 = TR::TreeEvaluator::stopUsingCopyReg(lengthNode, lengthReg, cg); - - uintptr_t hdrSize = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); - generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, srcObjReg, srcObjReg, hdrSize); - generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, dstObjReg, dstObjReg, hdrSize); - - int numOfRegs = japaneseMethod ? 11 : 12; - TR::RegisterDependencyConditions *conditions = new (cg->trHeapMemory()) TR::RegisterDependencyConditions(numOfRegs, numOfRegs, cg->trMemory()); - TR::Register *cndRegister = cg->allocateRegister(TR_CCR); - TR::addDependency(conditions, cndRegister, TR::RealRegister::cr0, TR_CCR, cg); - TR::addDependency(conditions, lengthReg, TR::RealRegister::gr8, TR_GPR, cg); - TR::addDependency(conditions, startReg, TR::RealRegister::gr7, TR_GPR, cg); - TR::addDependency(conditions, srcObjReg, TR::RealRegister::gr9, TR_GPR, cg); - TR::addDependency(conditions, dstObjReg, TR::RealRegister::gr10, TR_GPR, cg); - - TR::addDependency(conditions, NULL, TR::RealRegister::gr0, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr11, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr6, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr4, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr5, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr3, TR_GPR, cg); - if (!japaneseMethod) - TR::addDependency(conditions, NULL, TR::RealRegister::gr12, TR_GPR, cg); - - if (japaneseMethod) - TR::TreeEvaluator::generateHelperBranchAndLinkInstruction(TR_PPCcompressStringNoCheckJ, node, conditions, cg); - else - TR::TreeEvaluator::generateHelperBranchAndLinkInstruction(TR_PPCcompressStringNoCheck, node, conditions, cg); - - TR::Register* regs[4] = - { - lengthReg, startReg, srcObjReg, dstObjReg - }; - conditions->stopUsingDepRegs(cg, 4, regs); - for (uint16_t i = 0; i < node->getNumChildren(); i++) - cg->decReferenceCount(node->getChild(i)); - if (stopUsingCopyReg1) - cg->stopUsingRegister(srcObjReg); - if (stopUsingCopyReg2) - cg->stopUsingRegister(dstObjReg); - if (stopUsingCopyReg3) - cg->stopUsingRegister(startReg); - if (stopUsingCopyReg4) - cg->stopUsingRegister(lengthReg); - - cg->machine()->setLinkRegisterKilled(true); - cg->setHasCall(); - return NULL; - } - -static TR::Register *andORStringEvaluator(TR::Node *node, TR::CodeGenerator *cg) - { - TR_J9VMBase *fej9 = (TR_J9VMBase *) (cg->comp()->fe()); - TR::Node *srcObjNode, *startNode, *lengthNode; - TR::Register *srcObjReg = NULL, *lengthReg = NULL, *startReg = NULL; - - srcObjNode = node->getChild(0); - startNode = node->getChild(1); - lengthNode = node->getChild(2); - - bool stopUsingCopyReg1, stopUsingCopyReg2, stopUsingCopyReg3; - - stopUsingCopyReg1 = TR::TreeEvaluator::stopUsingCopyReg(srcObjNode, srcObjReg, cg); - stopUsingCopyReg2 = TR::TreeEvaluator::stopUsingCopyReg(startNode, startReg, cg); - stopUsingCopyReg3 = TR::TreeEvaluator::stopUsingCopyReg(lengthNode, lengthReg, cg); - - uintptr_t hdrSize = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); - generateTrg1Src1ImmInstruction(cg, TR::InstOpCode::addi, node, srcObjReg, srcObjReg, hdrSize); - - TR::RegisterDependencyConditions *conditions = new (cg->trHeapMemory()) TR::RegisterDependencyConditions(8, 8, cg->trMemory()); - TR::Register *cndRegister = cg->allocateRegister(TR_CCR); - TR::Register *resultReg = cg->allocateRegister(TR_GPR); - TR::addDependency(conditions, cndRegister, TR::RealRegister::cr0, TR_CCR, cg); - TR::addDependency(conditions, lengthReg, TR::RealRegister::gr8, TR_GPR, cg); - TR::addDependency(conditions, startReg, TR::RealRegister::gr7, TR_GPR, cg); - TR::addDependency(conditions, srcObjReg, TR::RealRegister::gr9, TR_GPR, cg); - - TR::addDependency(conditions, NULL, TR::RealRegister::gr0, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr4, TR_GPR, cg); - TR::addDependency(conditions, NULL, TR::RealRegister::gr5, TR_GPR, cg); - TR::addDependency(conditions, resultReg, TR::RealRegister::gr3, TR_GPR, cg); - - TR::TreeEvaluator::generateHelperBranchAndLinkInstruction(TR_PPCandORString, node, conditions, cg); - - TR::Register* regs[4] = - { - lengthReg, startReg, srcObjReg, resultReg - }; - conditions->stopUsingDepRegs(cg, 4, regs); - - for (uint16_t i = 0; i < node->getNumChildren(); i++) - cg->decReferenceCount(node->getChild(i)); - if (stopUsingCopyReg1) - cg->stopUsingRegister(srcObjReg); - if (stopUsingCopyReg2) - cg->stopUsingRegister(startReg); - if (stopUsingCopyReg3) - cg->stopUsingRegister(lengthReg); - - node->setRegister(resultReg); - - cg->machine()->setLinkRegisterKilled(true); - cg->setHasCall(); - return (resultReg); - } - static TR::Register *inlineConcurrentLinkedQueueTMOffer(TR::Node *node, TR::CodeGenerator *cg) { TR::Compilation *comp = cg->comp(); @@ -12047,20 +11858,6 @@ J9::Power::CodeGenerator::inlineDirectCall(TR::Node *node, TR::Register *&result } break; - case TR::java_lang_String_compress: - resultReg = compressStringEvaluator(node, cg, useJapaneseCompression); - return true; - break; - - case TR::java_lang_String_compressNoCheck: - resultReg = compressStringNoCheckEvaluator(node, cg, useJapaneseCompression); - return true; - - case TR::java_lang_String_andOR: - resultReg = andORStringEvaluator(node, cg); - return true; - break; - case TR::java_util_concurrent_atomic_AtomicBoolean_getAndSet: case TR::java_util_concurrent_atomic_AtomicInteger_getAndAdd: case TR::java_util_concurrent_atomic_AtomicInteger_getAndIncrement: diff --git a/runtime/compiler/p/runtime/CMakeLists.txt b/runtime/compiler/p/runtime/CMakeLists.txt index bf05865d079..4253cc430aa 100644 --- a/runtime/compiler/p/runtime/CMakeLists.txt +++ b/runtime/compiler/p/runtime/CMakeLists.txt @@ -41,7 +41,6 @@ j9jit_files( p/runtime/J9PPCArrayCopy.spp p/runtime/J9PPCArrayTranslate.spp p/runtime/J9PPCEncodeUTF16.spp - p/runtime/J9PPCCompressString.spp p/runtime/J9PPCCRC32.spp p/runtime/J9PPCCRC32_wrapper.c p/runtime/CodeSync.cpp diff --git a/runtime/compiler/p/runtime/J9PPCCompressString.spp b/runtime/compiler/p/runtime/J9PPCCompressString.spp deleted file mode 100644 index 3f3ffc076ac..00000000000 --- a/runtime/compiler/p/runtime/J9PPCCompressString.spp +++ /dev/null @@ -1,78 +0,0 @@ -!! Copyright IBM Corp. and others 2000 -!! -!! This program and the accompanying materials are made available under -!! the terms of the Eclipse Public License 2.0 which accompanies this -!! distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -!! or the Apache License, Version 2.0 which accompanies this distribution and -!! is available at https://www.apache.org/licenses/LICENSE-2.0. -!! -!! This Source Code may also be made available under the following -!! Secondary Licenses when the conditions for such availability set -!! forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -!! General Public License, version 2 with the GNU Classpath -!! Exception [1] and GNU General Public License, version 2 with the -!! OpenJDK Assembly Exception [2]. -!! -!! [1] https://www.gnu.org/software/classpath/license.html -!! [2] https://openjdk.org/legal/assembly-exception.html -!! -!! SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 - -! generalArrayCopy and referenceArrayCopy have: -! srcObj -- r5 -! dstObj -- r6 -! copyByteLength -- r7 -! srcByteAddr -- r8 -! dstByteAddr -- r9 -! -! -! Reference: -! kills: r0, r3, r4, r5, r6, r7, r8, r9, r10, r11, cr0 - -#include "j9cfg.h" -#include "jilconsts.inc" -#include "p/runtime/PPCCompressString.inc" - -.file "J9PPCCompressString.s" - -#ifdef AIXPPC - .globl .__compressString - .globl __compressString{DS} -#elif defined(LINUXPPC64) - .globl FUNC_LABEL(__compressString) - .type FUNC_LABEL(__compressString),@function -#else - .globl __compressString -#endif - - .extern jitWriteBarrierStore - .extern jitWriteBarrierBatchStore - .extern jitInstanceOf - .extern jitThrowArrayStoreExceptionWithIP - -! .data section -#ifdef AIXPPC - .toc -TOCjitWriteBarrierStore: - .tc jitWriteBarrierStore[TC],jitWriteBarrierStore -TOCjitWriteBarrierBatchStore: - .tc jitWriteBarrierBatchStore[TC],jitWriteBarrierBatchStore -TOCjitInstanceOf: - .tc jitInstanceOf[TC],jitInstanceOf -TOCjitThrowArrayStoreExceptionWithIP: - .tc jitThrowArrayStoreExceptionWithIP[TC],jitThrowArrayStoreExceptionWithIP - - - -#elif defined(LINUXPPC64) - .section ".toc" -TOCjitWriteBarrierStore: - .tc jitWriteBarrierStore[TC],jitWriteBarrierStore -TOCjitWriteBarrierBatchStore: - .tc jitWriteBarrierBatchStore[TC],jitWriteBarrierBatchStore -TOCjitInstanceOf: - .tc jitInstanceOf[TC],jitInstanceOf -TOCjitThrowArrayStoreExceptionWithIP: - .tc jitThrowArrayStoreExceptionWithIP[TC],jitThrowArrayStoreExceptionWithIP - -#endif diff --git a/runtime/compiler/p/runtime/PPCCompressString.inc b/runtime/compiler/p/runtime/PPCCompressString.inc deleted file mode 100644 index c14eeeaaac3..00000000000 --- a/runtime/compiler/p/runtime/PPCCompressString.inc +++ /dev/null @@ -1,608 +0,0 @@ -!! Copyright IBM Corp. and others 2000 -!! -!! This program and the accompanying materials are made available under -!! the terms of the Eclipse Public License 2.0 which accompanies this -!! distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -!! or the Apache License, Version 2.0 which accompanies this distribution and -!! is available at https://www.apache.org/licenses/LICENSE-2.0. -!! -!! This Source Code may also be made available under the following -!! Secondary Licenses when the conditions for such availability set -!! forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -!! General Public License, version 2 with the GNU Classpath -!! Exception [1] and GNU General Public License, version 2 with the -!! OpenJDK Assembly Exception [2]. -!! -!! [1] https://www.gnu.org/software/classpath/license.html -!! [2] https://openjdk.org/legal/assembly-exception.html -!! -!! SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 - -! arrayCopy*, wordArrayCopy*, halfWordArrayCopy*, forwardArrayCopy*, -! forwardWordArrayCopy*, forwardHalfWordArrayCopy*: -! copyByteLength -- r7 -! srcByteAddr -- r8 -! dstByteAddr -- r9 -! 64-bit kills: r0, r5, r6, r7, r8, r9, r11, cr0 -! 32-bit kills: r0, r3, r4, r5, r6, r7, r8, r9, r10, r11, cr0 -! 32-bit float additionally kills: fp8, fp9, fp10, fp11 -! float double pair additionally kills: fp8, fp9, fp10, fp11 - - -#include "p/runtime/ppcasmdefines.inc" - -#ifdef AIXPPC - .globl .__compressString - .globl .__compressStringJ - .globl .__compressStringNoCheck - .globl .__compressStringNoCheckJ - .globl .__andORString - .globl __compressString{DS} - .globl __compressStringJ{DS} - .globl __compressStringNoCheck{DS} - .globl __compressStringNoCheckJ{DS} - .globl __andORString{DS} -! .globl .__arrayCopy_dp -! .globl __arrayCopy_dp{DS} - -#elif defined(LINUXPPC64) - .globl FUNC_LABEL(__compressString) - .type FUNC_LABEL(__compressString),@function - .globl FUNC_LABEL(__compressStringJ) - .type FUNC_LABEL(__compressStringJ),@function - .globl FUNC_LABEL(__compressStringNoCheck) - .type FUNC_LABEL(__compressStringNoCheck),@function - .globl FUNC_LABEL(__compressStringNoCheckJ) - .type FUNC_LABEL(__compressStringNoCheckJ),@function - .globl FUNC_LABEL(__andORString) - .type FUNC_LABEL(__andOrString),@function - -#elif defined(LINUX) - .globl __compressString - .globl __compressStringJ - .globl __compressStringNocheck - .globl __compressStringNocheckJ - .globl __andORString -! .globl __arrayCopy_dp -#endif - - -#if defined(LINUXPPC64) - .section ".text" - .align 2 -#endif - -#ifdef AIXPPC - .csect __compressStringJ{PR} -.__compressStringJ: - .function .__compressStringJ,startproc.__compressStringJ,16,0,(endproc.__compressStringJ-startproc.__compressStringJ) -#elif defined(LINUXPPC64) -FUNC_LABEL(__compressStringJ): -#else -__compressStringJ: -#endif - startproc.__compressStringJ: -L.__compressStringJ: - add r11, r7, r7 - li r12, 0 !check - add r9, r9, r11 - srwi. r0, r8, 4 - bc BO_IF, CR0_EQ, L.__residueJ - mtctr r0 -L.__loopJ: - lwz r0, 0(r9) - lwz r11, 4(r9) - lwz r6, 8(r9) - lwz r3, 12(r9) - or r12, r12, r0 !method 2 check - rlwinm r4, r11, 8, 0xFFFFFFFF !method 2 - or r12, r12, r11 !method 2 check - rlwinm r5, r3, 8, 0xFFFFFFFF !method 2 - or r12, r12, r6 !method 2 check - or r4, r4, r0 !method 2 - or r12, r12, r3 !method 2 check - or r5, r5, r6 !method 2 - stw r4, 0(r10) - stw r5, 4(r10) - - lwz r0, 16(r9) - lwz r11,20(r9) - lwz r6, 24(r9) - lwz r3, 28(r9) - addi r9, r9, 32 - or r12, r12, r0 !method 2 check - rlwinm r4, r11, 8, 0xFFFFFFFF !method 2 - or r12, r12, r11 !method 2 check - rlwinm r5, r3, 8, 0xFFFFFFFF !method 2 - or r12, r12, r6 !method 2 check - or r4, r4, r0 !method 2 - or r12, r12, r3 !method 2 check - or r5, r5, r6 !method 2 - stw r4, 8(r10) - stw r5, 12(r10) - addi r10, r10, 16 - subi r8, r8, 16 - bdnz L.__loopJ -L.__residueJ: - srwi. r0, r8, 2 - bc BO_IF, CR0_EQ, L.__residue2J - mtctr r0 -L.__residueLoopJ: - lwz r0, 0(r9) - lwz r11, 4(r9) - addi r9, r9, 8 - or r12, r12, r0 - rlwinm r4, r11, 8, 0xFFFFFFFF !method 2 - or r12, r12, r11 - or r4, r4, r0 !method 2 - stw r4, 0(r10) - addi r10, r10, 4 - subi r8, r8, 4 - bdnz L.__residueLoopJ - -L.__residue2J: - srwi. r0, r8, 0 - bc BO_IF, CR0_EQ, L.__finishJ - mtctr r0 -L.__residueLoop2J: - lhz r0, 0(r9) - addi r9, r9, 2 - or r12, r12, r0 - stb r0, 0(r10) - addi r10, r10, 1 - bdnz L.__residueLoop2J - -L.__finishJ: - andi. r3, r12, 0xFF80 !check - andis. r4, r12, 0xFF80 !check - or r3, r3, r4 !check - bclr BO_IF, CR0_EQ - endproc.__compressStringJ: - - -#ifdef AIXPPC - .csect __compressString{PR} -.__compressString: - .function .__compressString,startproc.__compressString,16,0,(endproc.__compressString-startproc.__compressString) -#elif defined(LINUXPPC64) -FUNC_LABEL(__compressString): -#else -__compressString: -#endif - - startproc.__compressString: -L.__compressString: - add r11, r7, r7 - li r12, 0 !check - add r9, r9, r11 - srwi. r0, r8, 4 - bc BO_IF, CR0_EQ, L.__residue - mtctr r0 -L.__loop: - lwz r0, 0(r9) - lwz r11, 4(r9) - lwz r6, 8(r9) - lwz r3, 12(r9) - rlwinm r4, r0, 8, 0xFF000000 !method 1 - or r12, r12, r0 !method 1 check - rlwinm r7, r0, 16, 0xFF0000 !method 1 - or r12, r12, r11 !method 1 check - rlwinm r5, r6, 8, 0xFF000000 !method 1 - or r0, r12, r6 !method 1 check - rlwinm r12, r6, 16, 0xFF0000 !method 1 - rlwimi r4, r11, 24, 0xFF00 !method 1 - rlwimi r7, r11, 0, 0xFF !method 1 - rlwimi r5, r3, 24, 0xFF00 !method 1 - rlwimi r12, r3, 0, 0xFF !method 1 - or r4, r4, r7 !method 1 - or r5, r5, r12 !method 1 - stw r4, 0(r10) - stw r5, 4(r10) - or r12, r0, r3 - - lwz r0, 16(r9) - lwz r11,20(r9) - lwz r6, 24(r9) - lwz r3, 28(r9) - addi r9, r9, 32 - rlwinm r4, r0, 8, 0xFF000000 !method 1 - or r12, r12, r0 !method 1 check - rlwinm r7, r0, 16, 0xFF0000 !method 1 - or r12, r12, r11 !method 1 check - rlwinm r5, r6, 8, 0xFF000000 !method 1 - or r0, r12, r6 !method 1 check - rlwinm r12, r6, 16, 0xFF0000 !method 1 - rlwimi r4, r11, 24, 0xFF00 !method 1 - rlwimi r7, r11, 0, 0xFF !method 1 - rlwimi r5, r3, 24, 0xFF00 !method 1 - rlwimi r12, r3, 0, 0xFF !method 1 - or r4, r4, r7 !method 1 - or r5, r5, r12 !method 1 - stw r4, 8(r10) - stw r5, 12(r10) - addi r10, r10, 16 - or r12, r0, r3 - subi r8, r8, 16 - bdnz L.__loop - -L.__residue: - srwi. r0, r8, 2 - bc BO_IF, CR0_EQ, L.__residue2 - mtctr r0 -L.__residueLoop: - lwz r0, 0(r9) - lwz r11, 4(r9) - addi r9, r9, 8 - or r12, r12, r0 !method 1 check - rlwinm r4, r0, 8, 0xFF000000 - rlwinm r7, r0, 16, 0xFF0000 - rlwimi r4, r11, 24, 0xFF00 !method 1 - rlwimi r7, r11, 0, 0xFF !method 1 - or r12, r12, r11 !method 1 check - or r4, r4, r7 !method 1 - stw r4, 0(r10) - addi r10, r10, 4 - subi r8, r8, 4 - bdnz L.__residueLoop - -L.__residue2: - srwi. r0, r8, 0 - bc BO_IF, CR0_EQ, L.__finish - mtctr r0 -L.__residueLoop2: - lhz r0, 0(r9) - addi r9, r9, 2 - or r12, r12, r0 - stb r0, 0(r10) - addi r10, r10, 1 - bdnz L.__residueLoop2 - -L.__finish: - andi. r3, r12, 0xFF80 !check - andis. r4, r12, 0xFF80 !check - or r3, r3, r4 !check - bclr BO_IF, CR0_EQ - endproc.__compressString: - -#ifdef AIXPPC - .csect __compressStringNoCheck{PR} -.__compressStringNoCheck: - .function .__compressStringNoCheck,startproc.__compressStringNoCheck,16,0,(endproc.__compressStringNoCheck-startproc.__compressStringNoCheck) -#elif defined(LINUXPPC64) -FUNC_LABEL(__compressStringNoCheck): -#else -__compressStringNoCheck: -#endif - - startproc.__compressStringNoCheck: -L.__compressStringNoCheck: - add r11, r7, r7 - add r9, r9, r11 - srwi. r0, r8, 4 - bc BO_IF, CR0_EQ, L.__residueNoCheck - mtctr r0 -L.__loopNoCheck: - lwz r0, 0(r9) - lwz r11, 4(r9) - lwz r6, 8(r9) - lwz r3, 12(r9) - rlwinm r4, r0, 8, 0xFF000000 !method 1 - rlwinm r7, r0, 16, 0xFF0000 !method 1 - rlwinm r5, r6, 8, 0xFF000000 !method 1 - rlwinm r12, r6, 16, 0xFF0000 !method 1 - rlwimi r4, r11, 24, 0xFF00 !method 1 - rlwimi r7, r11, 0, 0xFF !method 1 - rlwimi r5, r3, 24, 0xFF00 !method 1 - rlwimi r12, r3, 0, 0xFF !method 1 - or r4, r4, r7 !method 1 - or r5, r5, r12 !method 1 - stw r4, 0(r10) - stw r5, 4(r10) - - lwz r0, 16(r9) - lwz r11,20(r9) - lwz r6, 24(r9) - lwz r3, 28(r9) - addi r9, r9, 32 - rlwinm r4, r0, 8, 0xFF000000 !method 1 - rlwinm r7, r0, 16, 0xFF0000 !method 1 - rlwinm r5, r6, 8, 0xFF000000 !method 1 - rlwinm r12, r6, 16, 0xFF0000 !method 1 - rlwimi r4, r11, 24, 0xFF00 !method 1 - rlwimi r7, r11, 0, 0xFF !method 1 - rlwimi r5, r3, 24, 0xFF00 !method 1 - rlwimi r12, r3, 0, 0xFF !method 1 - or r4, r4, r7 !method 1 - or r5, r5, r12 !method 1 - stw r4, 8(r10) - stw r5, 12(r10) - addi r10, r10, 16 - subi r8, r8, 16 - bdnz L.__loopNoCheck - -L.__residueNoCheck: - srwi. r0, r8, 2 - bc BO_IF, CR0_EQ, L.__residue2NoCheck - mtctr r0 -L.__residueLoopNoCheck: - lwz r0, 0(r9) - lwz r11, 4(r9) - addi r9, r9, 8 - rlwinm r4, r0, 8, 0xFF000000 - rlwinm r7, r0, 16, 0xFF0000 - rlwimi r4, r11, 24, 0xFF00 !method 1 - rlwimi r7, r11, 0, 0xFF !method 1 - or r4, r4, r7 !method 1 - stw r4, 0(r10) - addi r10, r10, 4 - subi r8, r8, 4 - bdnz L.__residueLoopNoCheck - -L.__residue2NoCheck: - srwi. r0, r8, 0 - bc BO_IF, CR0_EQ, L.__finishNoCheck - mtctr r0 -L.__residueLoop2NoCheck: - lhz r0, 0(r9) - addi r9, r9, 2 - stb r0, 0(r10) - addi r10, r10, 1 - bdnz L.__residueLoop2NoCheck - -L.__finishNoCheck: - bclr BO_IF, CR0_EQ - - endproc.__compressStringNoCheck: - -#ifdef AIXPPC - .csect __compressStringNoCheckJ{PR} -.__compressStringNoCheckJ: - .function .__compressStringNoCheckJ,startproc.__compressStringNoCheckJ,16,0,(endproc.__compressStringNoCheckJ-startproc.__compressStringNoCheckJ) -#elif defined(LINUXPPC64) -FUNC_LABEL(__compressStringNoCheckJ): -#else -__compressStringNoCheckJ: -#endif - startproc.__compressStringNoCheckJ: -L.__compressStringNoCheckJ: - add r11, r7, r7 - add r9, r9, r11 - srwi. r0, r8, 4 - bc BO_IF, CR0_EQ, L.__residueNoCheckJ - mtctr r0 -L.__loopNoCheckJ: - lwz r0, 0(r9) - lwz r11, 4(r9) - lwz r6, 8(r9) - lwz r3, 12(r9) - rlwinm r4, r11, 8, 0xFFFFFFFF !method 2 - rlwinm r5, r3, 8, 0xFFFFFFFF !method 2 - or r4, r4, r0 !method 2 - or r5, r5, r6 !method 2 - stw r4, 0(r10) - stw r5, 4(r10) - - lwz r0, 16(r9) - lwz r11,20(r9) - lwz r6, 24(r9) - lwz r3, 28(r9) - addi r9, r9, 32 - rlwinm r4, r11, 8, 0xFFFFFFFF !method 2 - rlwinm r5, r3, 8, 0xFFFFFFFF !method 2 - or r4, r4, r0 !method 2 - or r5, r5, r6 !method 2 - stw r4, 8(r10) - stw r5, 12(r10) - addi r10, r10, 16 - subi r8, r8, 16 - bdnz L.__loopNoCheckJ -L.__residueNoCheckJ: - srwi. r0, r8, 2 - bc BO_IF, CR0_EQ, L.__residue2NoCheckJ - mtctr r0 -L.__residueLoopNoCheckJ: - lwz r0, 0(r9) - lwz r11, 4(r9) - addi r9, r9, 8 - rlwinm r4, r11, 8, 0xFFFFFFFF !method 2 - or r4, r4, r0 !method 2 - stw r4, 0(r10) - addi r10, r10, 4 - subi r8, r8, 4 - bdnz L.__residueLoopNoCheckJ - -L.__residue2NoCheckJ: - srwi. r0, r8, 0 - bc BO_IF, CR0_EQ, L.__finishNoCheckJ - mtctr r0 -L.__residueLoop2NoCheckJ: - lhz r0, 0(r9) - addi r9, r9, 2 - stb r0, 0(r10) - addi r10, r10, 1 - bdnz L.__residueLoop2NoCheckJ - -L.__finishNoCheckJ: - bclr BO_IF, CR0_EQ - endproc.__compressStringNoCheckJ: - - -#ifdef AIXPPC - .csect __andORString{PR} -.__andORString: - .function .__andORString,startproc.__andORString,16,0,(endproc.__andORString-startproc.__andORString) -#elif defined(LINUXPPC64) -FUNC_LABEL(__andORString): -#else -__andORString: -#endif - startproc.__andORString: -L.__andORString: - add r9, r9, r7 - add r9, r9, r7 - li r4, 0 - li r5, 0 - subi r5, r5, 1 - srwi. r0, r8, 4 - bc BO_IF, CR0_EQ, L.__residueandOR - mtctr r0 -L.__loopandOR: - lwz r0, 0(r9) - lwz r3, 4(r9) - or r4, r4, r0 - and r5, r5, r0 - or r4, r4, r3 - and r5, r5, r3 - - lwz r0, 8(r9) - lwz r3, 12(r9) - or r4, r4, r0 - and r5, r5, r0 - or r4, r4, r3 - and r5, r5, r3 - - lwz r0, 16(r9) - lwz r3, 20(r9) - or r4, r4, r0 - and r5, r5, r0 - or r4, r4, r3 - and r5, r5, r3 - - lwz r0, 24(r9) - lwz r3, 28(r9) - or r4, r4, r0 - and r5, r5, r0 - or r4, r4, r3 - and r5, r5, r3 - - addi r9, r9, 32 - subi r8, r8, 16 - bdnz L.__loopandOR -L.__residueandOR: - srwi. r0, r8, 2 - bc BO_IF, CR0_EQ, L.__residue2andOR - mtctr r0 -L.__residueLoopandOR: - lwz r0, 0(r9) - lwz r3, 4(r9) - or r4, r4, r0 - and r5, r5, r0 - or r4, r4, r3 - and r5, r5, r3 - - addi r9, r9, 8 - subi r8, r8, 4 - bdnz L.__residueLoopandOR - -L.__residue2andOR: - srwi. r0, r8, 0 - bc BO_IF, CR0_EQ, L.__finishandOR - mtctr r0 -L.__residueLoop2andOR: - lhz r0, 0(r9) - or r4, r4, r0 - and r5, r5, r0 - bdnz L.__residueLoop2andOR - -L.__finishandOR: - slwi r3, r4, 16 - or r4, r3, r4 - srwi r4, r4, 16 - - slwi r3, r5, 16 - and r3, r3, r5 ! AND is in the high word and OR is in the low word. - - or r3, r3, r4 - bclr BO_IF, CR0_EQ - endproc.__andORString: - - - -! .data section -#ifdef AIXPPC -! .toc -!TOC__shortArrayCopyLabelTable: -! .tc __shortArrayCopyLabelTable[TC],__shortArrayCopyLabelTable - - .csect __compressString{DS} - ADDR .__compressString - ADDR TOC{TC0} - ADDR 0x00000000 -! End csect __compressString{DS} - - .csect __compressStringJ{DS} - ADDR .__compressStringJ - ADDR TOC{TC0} - ADDR 0x00000000 -! End csect __compressStringJ{DS} - - .csect __compressStringNoCheck{DS} - ADDR .__compressStringNoCheck - ADDR TOC{TC0} - ADDR 0x00000000 -! End csect __compressStringNoCheck{DS} - - .csect __compressStringNoCheckJ{DS} - ADDR .__compressStringNoCheckJ - ADDR TOC{TC0} - ADDR 0x00000000 -! End csect __compressStringNoCheckJ{DS} - - -! .csect __arrayCopy_dp{DS} -! ADDR .__arrayCopy_dp -! ADDR TOC{TC0} -! ADDR 0x00000000 -!! End csect __arrayCopy_dp{DS} - - - -#elif defined(LINUXPPC64) - -#if !defined(__LITTLE_ENDIAN__) - .section ".opd","aw" - .align 3 - .globl __compressString - .size __compressString,24 -__compressString: - .quad .__compressString - .quad .TOC.@tocbase - .long 0x00000000 - .long 0x00000000 - - .globl __compressStringJ - .size __compressStringJ,24 -__compressStringJ: - .quad .__compressStringJ - .quad .TOC.@tocbase - .long 0x00000000 - .long 0x00000000 - - .globl __compressStringNoCheck - .size __compressStringNoCheck,24 -__compressStringNoCheck: - .quad .__compressStringNoCheck - .quad .TOC.@tocbase - .long 0x00000000 - .long 0x00000000 - - .globl __compressStringNoCheckJ - .size __compressStringNoCheckJ,24 -__compressStringNoCheckJ: - .quad .__compressStringNoCheckJ - .quad .TOC.@tocbase - .long 0x00000000 - .long 0x00000000 - - .globl __andORString - .size __andORString,24 -__andORString: - .quad .__andORString - .quad .TOC.@tocbase - .long 0x00000000 - .long 0x00000000 -#endif - -#endif - - diff --git a/runtime/compiler/runtime/Runtime.cpp b/runtime/compiler/runtime/Runtime.cpp index c1fec1bd51f..00c2fc2a56c 100644 --- a/runtime/compiler/runtime/Runtime.cpp +++ b/runtime/compiler/runtime/Runtime.cpp @@ -342,11 +342,6 @@ JIT_HELPER(icallVMprJavaSendVirtualL); JIT_HELPER(icallVMprJavaSendVirtualF); JIT_HELPER(icallVMprJavaSendVirtualD); -JIT_HELPER(compressString); -JIT_HELPER(compressStringNoCheck); -JIT_HELPER(compressStringJ); -JIT_HELPER(compressStringNoCheckJ); -JIT_HELPER(andORString); JIT_HELPER(encodeUTF16Big); JIT_HELPER(encodeUTF16Little); @@ -374,11 +369,6 @@ JIT_HELPER(SSEfloatRemainderIA32Thunk); JIT_HELPER(SSEdoubleRemainderIA32Thunk); JIT_HELPER(SSEdouble2LongIA32); -JIT_HELPER(compressString); -JIT_HELPER(compressStringNoCheck); -JIT_HELPER(compressStringJ); -JIT_HELPER(compressStringNoCheckJ); -JIT_HELPER(andORString); JIT_HELPER(encodeUTF16Big); JIT_HELPER(encodeUTF16Little); @@ -475,13 +465,6 @@ JIT_HELPER(ECP256subNoMod_PPC_compressed); #endif /* defined(OMR_GC_COMPRESSED_POINTERS) */ #endif -#ifndef LINUX -JIT_HELPER(__compressString); -JIT_HELPER(__compressStringNoCheck); -JIT_HELPER(__compressStringJ); -JIT_HELPER(__compressStringNoCheckJ); -JIT_HELPER(__andORString); -#endif JIT_HELPER(__arrayTranslateTRTO); JIT_HELPER(__arrayTranslateTRTO255); JIT_HELPER(__arrayTranslateTROT255); @@ -1237,11 +1220,6 @@ void initializeCodeRuntimeHelperTable(J9JITConfig *jitConfig, char isSMP) SET(TR_AMD64icallVMprJavaSendVirtualD, (void *)icallVMprJavaSendVirtualD, TR_Helper); SET(TR_AMD64jitCollapseJNIReferenceFrame, (void *)jitCollapseJNIReferenceFrame, TR_Helper); - SET(TR_AMD64compressString, (void *)compressString, TR_Helper); - SET(TR_AMD64compressStringNoCheck, (void *)compressStringNoCheck, TR_Helper); - SET(TR_AMD64compressStringJ, (void *)compressStringJ, TR_Helper); - SET(TR_AMD64compressStringNoCheckJ, (void *)compressStringNoCheckJ, TR_Helper); - SET(TR_AMD64andORString, (void *)andORString, TR_Helper); SET(TR_AMD64arrayTranslateTRTO, (void *)arrayTranslateTRTO, TR_Helper); SET(TR_AMD64arrayTranslateTROTNoBreak, (void *)arrayTranslateTROTNoBreak, TR_Helper); SET(TR_AMD64arrayTranslateTROT, (void *)arrayTranslateTROT, TR_Helper); @@ -1290,11 +1268,6 @@ void initializeCodeRuntimeHelperTable(J9JITConfig *jitConfig, char isSMP) SET(TR_IA32floatToLong, (void *)floatToLong, TR_Helper); SET(TR_IA32floatToInt, (void *)floatToInt, TR_Helper); - SET(TR_IA32compressString, (void *)compressString, TR_Helper); - SET(TR_IA32compressStringNoCheck, (void *)compressStringNoCheck, TR_Helper); - SET(TR_IA32compressStringJ, (void *)compressStringJ, TR_Helper); - SET(TR_IA32compressStringNoCheckJ, (void *)compressStringNoCheckJ, TR_Helper); - SET(TR_IA32andORString, (void *)andORString, TR_Helper); SET(TR_IA32arrayTranslateTRTO, (void *)arrayTranslateTRTO, TR_Helper); SET(TR_IA32arrayTranslateTROTNoBreak, (void *)arrayTranslateTROTNoBreak, TR_Helper); SET(TR_IA32arrayTranslateTROT, (void *)arrayTranslateTROT, TR_Helper); @@ -1409,13 +1382,6 @@ void initializeCodeRuntimeHelperTable(J9JITConfig *jitConfig, char isSMP) } #endif -#ifndef LINUX - SET(TR_PPCcompressString, (void *) __compressString, TR_Helper); - SET(TR_PPCcompressStringNoCheck, (void *) __compressStringNoCheck, TR_Helper); - SET(TR_PPCcompressStringJ, (void *) __compressStringJ, TR_Helper); - SET(TR_PPCcompressStringNoCheckJ, (void *) __compressStringNoCheckJ, TR_Helper); - SET(TR_PPCandORString, (void *) __andORString, TR_Helper); -#endif SET(TR_PPCreferenceArrayCopy, (void *) __referenceArrayCopy, TR_Helper); SET(TR_PPCgeneralArrayCopy, (void *) __generalArrayCopy, TR_Helper); SET(TR_PPCarrayTranslateTRTO, (void *) __arrayTranslateTRTO, TR_Helper); diff --git a/runtime/compiler/x/amd64/runtime/.gitignore b/runtime/compiler/x/amd64/runtime/.gitignore index 5ef9891d9b5..ba05e97a6c4 100644 --- a/runtime/compiler/x/amd64/runtime/.gitignore +++ b/runtime/compiler/x/amd64/runtime/.gitignore @@ -18,5 +18,4 @@ # # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 -/AMD64CompressString.s /AMD64Recompilation.s diff --git a/runtime/compiler/x/amd64/runtime/AMD64CompressString.inc b/runtime/compiler/x/amd64/runtime/AMD64CompressString.inc deleted file mode 100644 index 95155a14b7b..00000000000 --- a/runtime/compiler/x/amd64/runtime/AMD64CompressString.inc +++ /dev/null @@ -1,225 +0,0 @@ -; Copyright IBM Corp. and others 2000 -; -; This program and the accompanying materials are made available under -; the terms of the Eclipse Public License 2.0 which accompanies this -; distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -; or the Apache License, Version 2.0 which accompanies this distribution and -; is available at https://www.apache.org/licenses/LICENSE-2.0. -; -; This Source Code may also be made available under the following -; Secondary Licenses when the conditions for such availability set -; forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -; General Public License, version 2 with the GNU Classpath -; Exception [1] and GNU General Public License, version 2 with the -; OpenJDK Assembly Exception [2]. -; -; [1] https://www.gnu.org/software/classpath/license.html -; [2] https://openjdk.org/legal/assembly-exception.html -; -; SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 - -segment .text - - DECLARE_GLOBAL compressString - DECLARE_GLOBAL compressStringJ - DECLARE_GLOBAL compressStringNoCheck - DECLARE_GLOBAL compressStringNoCheckJ - DECLARE_GLOBAL andORString - - align 16 - - -compressString: - shr rcx, 4 - add rsi, rax - add rsi, rax - mov rdx, 0 -eightchars: - mov rax, QWORD [rsi] ; load 4 bytes from the source array into EAX (2 chars) - or rdx, rax ; - mov rbx, rax ; copy the loaded value - shr rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov WORD [rdi], ax ; write the low 2 bytes of the 4 byte value in the destination - shr rax, 32 - mov WORD [rdi+2], ax ; write the low 2 bytes of the 4 byte value in the destination - - mov rax, QWORD [rsi+8] ; load 4 bytes from the source array into EAX (2 chars) - or rdx, rax ; - mov rbx, rax ; copy the loaded value - shr rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov WORD [rdi+4], ax ; write the low 2 bytes of the 4 byte value in the destination - shr rax, 32 - mov WORD [rdi+6], ax ; write the low 2 bytes of the 4 byte value in the destination - - mov rax, QWORD [rsi+16] ; load 4 bytes from the source array into EAX (2 chars) - or rdx, rax ; - mov rbx, rax ; copy the loaded value - shr rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov WORD [rdi+8], ax ; write the low 2 bytes of the 4 byte value in the destination - shr rax, 32 - mov WORD [rdi+10], ax ; write the low 2 bytes of the 4 byte value in the destination - - - mov rax, QWORD [rsi+24] ; load 4 bytes from the source array into EAX (2 chars) - or rdx, rax ; - mov rbx, rax ; copy the loaded value - shr rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov WORD [rdi+12], ax ; write the low 2 bytes of the 4 byte value in the destination - shr rax, 32 - mov WORD [rdi+14], ax ; write the low 2 bytes of the 4 byte value in the destination - - add rdi, 16 - add rsi, 32 - loop eightchars - mov rax, rdx - shl rdx, 32 - or rax, rdx - ;loop eightchars - shr rax, 32 -ret - - - -; A c-style memmove with no assumptions on the element size -; or copy direction required. -; ecx has length of copy in bytes -; esi has source address -; edi has destination address -compressStringJ: - shr rcx, 4 - add rsi, rax - add rsi, rax - mov rdx, 0 -eightcharsJ: - mov rax, QWORD [rsi] ; load 4 bytes from the source array into EAX (2 chars) - mov rbx, QWORD [rsi+8] ; load 4 bytes from the source array into EAX (2 chars) - or rdx, rax ; - or rdx, rbx - shl rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov QWORD [rdi], rax ; write the low 2 bytes of the 4 byte value in the destination - - mov rax, QWORD [rsi+16] ; load 4 bytes from the source array into EAX (2 chars) - mov rbx, QWORD [rsi+24] ; load 4 bytes from the source array into EAX (2 chars) - or rdx, rax ; - or rdx, rbx - shl rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov QWORD [rdi+8], rax ; write the low 2 bytes of the 4 byte value in the destination - - add rdi, 16 - add rsi, 32 - loop eightcharsJ - mov rax, rdx - shl rdx, 32 - or rax, rdx - shr rax, 32 -ret - -andORString: - shr rcx, 4 - add rsi, rax - add rsi, rax - mov rbx, 0 - mov rdx, 0ffffffffffffffffh -eightchars2: - mov rax, QWORD [rsi] ; load 4 bytes from the source array into EAX (2 chars) - or rbx, rax - and rdx, rax - mov rax, QWORD [rsi+8] ; load 4 bytes from the source array into EAX (2 chars) - or rbx, rax - and rdx, rax - mov rax, QWORD [rsi+16] ; load 4 bytes from the source array into EAX (2 chars) - or rbx, rax - and rdx, rax - mov rax, QWORD [rsi+24] ; load 4 bytes from the source array into EAX (2 chars) - or rbx, rax - and rdx, rax - add rsi, 32 - loop eightchars2 - - mov rax, rbx ; building the or - mov rcx, rdx ; building the and - shr rbx, 32 ; building the or - shr rdx, 32 ; building the and - or ebx, eax ; building the or - and edx, ecx ; building the and - mov eax, ebx ; building the or - mov ecx, edx ; building the and - shr ebx, 16 ; building the or - shl edx, 16 ; building the and - or bx, ax ; building the or - and edx, ecx ; building the and - - mov dx, bx -ret - - -compressStringNoCheckJ: - shr rcx, 4 - add rsi, rax - add rsi, rax -eightcharsNoCheckJ: - mov rax, QWORD [rsi] ; load 4 bytes from the source array into EAX (2 chars) - mov rbx, QWORD [rsi+8] ; load 4 bytes from the source array into EAX (2 chars) - shl rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov QWORD [rdi], rax ; write the low 2 bytes of the 4 byte value in the destination - - mov rax, QWORD [rsi+16] ; load 4 bytes from the source array into EAX (2 chars) - mov rbx, QWORD [rsi+24] ; load 4 bytes from the source array into EAX (2 chars) - shl rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov QWORD [rdi+8], rax ; write the low 2 bytes of the 4 byte value in the destination - - add rdi, 16 - add rsi, 32 - loop eightcharsNoCheckJ -ret - -compressStringNoCheck: - shr rcx, 4 - add rsi, rax - add rsi, rax -eightcharsNoCheck: - mov rax, QWORD [rsi] ; load 4 bytes from the source array into EAX (2 chars) - mov rbx, rax ; copy the loaded value - shr rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov WORD [rdi], ax ; write the low 2 bytes of the 4 byte value in the destination - shr rax, 32 - mov WORD [rdi+2], ax ; write the low 2 bytes of the 4 byte value in the destination - - mov rax, QWORD [rsi+8] ; load 4 bytes from the source array into EAX (2 chars) - mov rbx, rax ; copy the loaded value - shr rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov WORD [rdi+4], ax ; write the low 2 bytes of the 4 byte value in the destination - shr rax, 32 - mov WORD [rdi+6], ax ; write the low 2 bytes of the 4 byte value in the destination - - mov rax, QWORD [rsi+16] ; load 4 bytes from the source array into EAX (2 chars) - mov rbx, rax ; copy the loaded value - shr rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov WORD [rdi+8], ax ; write the low 2 bytes of the 4 byte value in the destination - shr rax, 32 - mov WORD [rdi+10], ax ; write the low 2 bytes of the 4 byte value in the destination - - - mov rax, QWORD [rsi+24] ; load 4 bytes from the source array into EAX (2 chars) - mov rbx, rax ; copy the loaded value - shr rbx, 8 ; shift right by 8 - or rax, rbx ; or the 2 values - mov WORD [rdi+12], ax ; write the low 2 bytes of the 4 byte value in the destination - shr rax, 32 - mov WORD [rdi+14], ax ; write the low 2 bytes of the 4 byte value in the destination - - add rdi, 16 - add rsi, 32 - loop eightcharsNoCheck -ret diff --git a/runtime/compiler/x/amd64/runtime/AMD64CompressString.nasm b/runtime/compiler/x/amd64/runtime/AMD64CompressString.nasm deleted file mode 100644 index 87ac61c0e16..00000000000 --- a/runtime/compiler/x/amd64/runtime/AMD64CompressString.nasm +++ /dev/null @@ -1,35 +0,0 @@ -; Copyright IBM Corp. and others 2000 -; -; This program and the accompanying materials are made available under -; the terms of the Eclipse Public License 2.0 which accompanies this -; distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -; or the Apache License, Version 2.0 which accompanies this distribution and -; is available at https://www.apache.org/licenses/LICENSE-2.0. -; -; This Source Code may also be made available under the following -; Secondary Licenses when the conditions for such availability set -; forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -; General Public License, version 2 with the GNU Classpath -; Exception [1] and GNU General Public License, version 2 with the -; OpenJDK Assembly Exception [2]. -; -; [1] https://www.gnu.org/software/classpath/license.html -; [2] https://openjdk.org/legal/assembly-exception.html -; -; SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 - -%ifdef TR_HOST_64BIT -%include "jilconsts.inc" -%include "AMD64CompressString.inc" - -J9TR_ObjectColorBlack equ 03h - - segment .text - -%else ; TR_HOST_64BIT - -segment .data -IA32ArrayCopy: - db 00h - -%endif ; TR_HOST_64BIT \ No newline at end of file diff --git a/runtime/compiler/x/amd64/runtime/CMakeLists.txt b/runtime/compiler/x/amd64/runtime/CMakeLists.txt index 3c2080cf726..f33edafa56e 100644 --- a/runtime/compiler/x/amd64/runtime/CMakeLists.txt +++ b/runtime/compiler/x/amd64/runtime/CMakeLists.txt @@ -21,6 +21,5 @@ ################################################################################ j9jit_files( - x/amd64/runtime/AMD64CompressString.nasm x/amd64/runtime/AMD64Recompilation.nasm ) diff --git a/runtime/compiler/x/codegen/J9TreeEvaluator.cpp b/runtime/compiler/x/codegen/J9TreeEvaluator.cpp index 842894fa24a..f08285132c5 100644 --- a/runtime/compiler/x/codegen/J9TreeEvaluator.cpp +++ b/runtime/compiler/x/codegen/J9TreeEvaluator.cpp @@ -11672,15 +11672,6 @@ J9::X86::TreeEvaluator::directCallEvaluator(TR::Node *node, TR::CodeGenerator *c callInlined = true; break; - case TR::java_lang_String_compress: - return TR::TreeEvaluator::compressStringEvaluator(node, cg, useJapaneseCompression); - - case TR::java_lang_String_compressNoCheck: - return TR::TreeEvaluator::compressStringNoCheckEvaluator(node, cg, useJapaneseCompression); - - case TR::java_lang_String_andOR: - return TR::TreeEvaluator::andORStringEvaluator(node, cg); - default: break; } @@ -11951,67 +11942,6 @@ J9::X86::TreeEvaluator::encodeUTF16Evaluator(TR::Node *node, TR::CodeGenerator * } -TR::Register * -J9::X86::TreeEvaluator::compressStringEvaluator( - TR::Node *node, - TR::CodeGenerator *cg, - bool japaneseMethod) - { - TR::Node *srcObjNode, *dstObjNode, *startNode, *lengthNode; - TR::Register *srcObjReg, *dstObjReg, *lengthReg, *startReg; - bool stopUsingCopyReg1, stopUsingCopyReg2, stopUsingCopyReg3, stopUsingCopyReg4; - - srcObjNode = node->getChild(0); - dstObjNode = node->getChild(1); - startNode = node->getChild(2); - lengthNode = node->getChild(3); - - stopUsingCopyReg1 = TR::TreeEvaluator::stopUsingCopyRegAddr(srcObjNode, srcObjReg, cg); - stopUsingCopyReg2 = TR::TreeEvaluator::stopUsingCopyRegAddr(dstObjNode, dstObjReg, cg); - stopUsingCopyReg3 = TR::TreeEvaluator::stopUsingCopyRegInteger(startNode, startReg, cg); - stopUsingCopyReg4 = TR::TreeEvaluator::stopUsingCopyRegInteger(lengthNode, lengthReg, cg); - - uintptr_t hdrSize = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); - generateRegImmInstruction(TR::InstOpCode::ADDRegImms(), node, srcObjReg, hdrSize, cg); - generateRegImmInstruction(TR::InstOpCode::ADDRegImms(), node, dstObjReg, hdrSize, cg); - - - // Now that we have all the registers, set up the dependencies - TR::RegisterDependencyConditions *dependencies = - generateRegisterDependencyConditions((uint8_t)0, 6, cg); - TR::Register *resultReg = cg->allocateRegister(); - TR::Register *dummy = cg->allocateRegister(); - dependencies->addPostCondition(srcObjReg, TR::RealRegister::esi, cg); - dependencies->addPostCondition(dstObjReg, TR::RealRegister::edi, cg); - dependencies->addPostCondition(lengthReg, TR::RealRegister::ecx, cg); - dependencies->addPostCondition(startReg, TR::RealRegister::eax, cg); - dependencies->addPostCondition(resultReg, TR::RealRegister::edx, cg); - dependencies->addPostCondition(dummy, TR::RealRegister::ebx, cg); - dependencies->stopAddingConditions(); - - TR_RuntimeHelper helper; - if (cg->comp()->target().is64Bit()) - helper = japaneseMethod ? TR_AMD64compressStringJ : TR_AMD64compressString; - else - helper = japaneseMethod ? TR_IA32compressStringJ : TR_IA32compressString; - generateHelperCallInstruction(node, helper, dependencies, cg); - cg->stopUsingRegister(dummy); - - for (uint16_t i = 0; i < node->getNumChildren(); i++) - cg->decReferenceCount(node->getChild(i)); - - if (stopUsingCopyReg1) - cg->getLiveRegisters(TR_GPR)->registerIsDead(srcObjReg); - if (stopUsingCopyReg2) - cg->getLiveRegisters(TR_GPR)->registerIsDead(dstObjReg); - if (stopUsingCopyReg3) - cg->getLiveRegisters(TR_GPR)->registerIsDead(startReg); - if (stopUsingCopyReg4) - cg->getLiveRegisters(TR_GPR)->registerIsDead(lengthReg); - node->setRegister(resultReg); - return resultReg; - } - /* * The CaseConversionManager is used to store info about the conversion. It defines the lower bound and upper bound value depending on * whether it's a toLower or toUpper case conversion. It also chooses byte or word data type depending on whether it's compressed string or not. @@ -12397,113 +12327,6 @@ J9::X86::TreeEvaluator::stringCaseConversionHelper(TR::Node *node, TR::CodeGener return result; } -TR::Register * -J9::X86::TreeEvaluator::compressStringNoCheckEvaluator( - TR::Node *node, - TR::CodeGenerator *cg, - bool japaneseMethod) - { - TR::Node *srcObjNode, *dstObjNode, *startNode, *lengthNode; - TR::Register *srcObjReg, *dstObjReg, *lengthReg, *startReg; - bool stopUsingCopyReg1, stopUsingCopyReg2, stopUsingCopyReg3, stopUsingCopyReg4; - - srcObjNode = node->getChild(0); - dstObjNode = node->getChild(1); - startNode = node->getChild(2); - lengthNode = node->getChild(3); - - stopUsingCopyReg1 = TR::TreeEvaluator::stopUsingCopyRegAddr(srcObjNode, srcObjReg, cg); - stopUsingCopyReg2 = TR::TreeEvaluator::stopUsingCopyRegAddr(dstObjNode, dstObjReg, cg); - stopUsingCopyReg3 = TR::TreeEvaluator::stopUsingCopyRegInteger(startNode, startReg, cg); - stopUsingCopyReg4 = TR::TreeEvaluator::stopUsingCopyRegInteger(lengthNode, lengthReg, cg); - - uintptr_t hdrSize = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); - generateRegImmInstruction(TR::InstOpCode::ADDRegImms(), node, srcObjReg, hdrSize, cg); - generateRegImmInstruction(TR::InstOpCode::ADDRegImms(), node, dstObjReg, hdrSize, cg); - - - // Now that we have all the registers, set up the dependencies - TR::RegisterDependencyConditions *dependencies = - generateRegisterDependencyConditions((uint8_t)0, 5, cg); - dependencies->addPostCondition(srcObjReg, TR::RealRegister::esi, cg); - dependencies->addPostCondition(dstObjReg, TR::RealRegister::edi, cg); - dependencies->addPostCondition(lengthReg, TR::RealRegister::ecx, cg); - dependencies->addPostCondition(startReg, TR::RealRegister::eax, cg); - TR::Register *dummy = cg->allocateRegister(); - dependencies->addPostCondition(dummy, TR::RealRegister::ebx, cg); - dependencies->stopAddingConditions(); - - TR_RuntimeHelper helper; - if (cg->comp()->target().is64Bit()) - helper = japaneseMethod ? TR_AMD64compressStringNoCheckJ : TR_AMD64compressStringNoCheck; - else - helper = japaneseMethod ? TR_IA32compressStringNoCheckJ : TR_IA32compressStringNoCheck; - - generateHelperCallInstruction(node, helper, dependencies, cg); - cg->stopUsingRegister(dummy); - - for (uint16_t i = 0; i < node->getNumChildren(); i++) - cg->decReferenceCount(node->getChild(i)); - - if (stopUsingCopyReg1) - cg->getLiveRegisters(TR_GPR)->registerIsDead(srcObjReg); - if (stopUsingCopyReg2) - cg->getLiveRegisters(TR_GPR)->registerIsDead(dstObjReg); - if (stopUsingCopyReg3) - cg->getLiveRegisters(TR_GPR)->registerIsDead(startReg); - if (stopUsingCopyReg4) - cg->getLiveRegisters(TR_GPR)->registerIsDead(lengthReg); - return NULL; - } - - -TR::Register * -J9::X86::TreeEvaluator::andORStringEvaluator(TR::Node *node, TR::CodeGenerator *cg) - { - TR::Node *srcObjNode, *startNode, *lengthNode; - TR::Register *srcObjReg, *lengthReg, *startReg; - bool stopUsingCopyReg1, stopUsingCopyReg2, stopUsingCopyReg3; - - srcObjNode = node->getChild(0); - startNode = node->getChild(1); - lengthNode = node->getChild(2); - - stopUsingCopyReg1 = TR::TreeEvaluator::stopUsingCopyRegAddr(srcObjNode, srcObjReg, cg); - stopUsingCopyReg2 = TR::TreeEvaluator::stopUsingCopyRegInteger(startNode, startReg, cg); - stopUsingCopyReg3 = TR::TreeEvaluator::stopUsingCopyRegInteger(lengthNode, lengthReg, cg); - - uintptr_t hdrSize = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); - generateRegImmInstruction(TR::InstOpCode::ADDRegImms(), node, srcObjReg, hdrSize, cg); - - // Now that we have all the registers, set up the dependencies - TR::RegisterDependencyConditions *dependencies = - generateRegisterDependencyConditions((uint8_t)0, 5, cg); - TR::Register *resultReg = cg->allocateRegister(); - dependencies->addPostCondition(srcObjReg, TR::RealRegister::esi, cg); - dependencies->addPostCondition(lengthReg, TR::RealRegister::ecx, cg); - dependencies->addPostCondition(startReg, TR::RealRegister::eax, cg); - dependencies->addPostCondition(resultReg, TR::RealRegister::edx, cg); - TR::Register *dummy = cg->allocateRegister(); - dependencies->addPostCondition(dummy, TR::RealRegister::ebx, cg); - dependencies->stopAddingConditions(); - - TR_RuntimeHelper helper = - cg->comp()->target().is64Bit() ? TR_AMD64andORString : TR_IA32andORString; - generateHelperCallInstruction(node, helper, dependencies, cg); - cg->stopUsingRegister(dummy); - - for (uint16_t i = 0; i < node->getNumChildren(); i++) - cg->decReferenceCount(node->getChild(i)); - - if (stopUsingCopyReg1) - cg->getLiveRegisters(TR_GPR)->registerIsDead(srcObjReg); - if (stopUsingCopyReg2) - cg->getLiveRegisters(TR_GPR)->registerIsDead(startReg); - if (stopUsingCopyReg3) - cg->getLiveRegisters(TR_GPR)->registerIsDead(lengthReg); - node->setRegister(resultReg); - return resultReg; - } /* * diff --git a/runtime/compiler/x/codegen/J9TreeEvaluator.hpp b/runtime/compiler/x/codegen/J9TreeEvaluator.hpp index 4796c8506f0..9a34a6bbeae 100644 --- a/runtime/compiler/x/codegen/J9TreeEvaluator.hpp +++ b/runtime/compiler/x/codegen/J9TreeEvaluator.hpp @@ -133,9 +133,6 @@ class OMR_EXTENSIBLE TreeEvaluator: public J9::TreeEvaluator static void generateFillInDataBlockSequenceForUnresolvedField (TR::CodeGenerator *cg, TR::Node *node, TR::Snippet *dataSnippet, bool isWrite, TR::Register *sideEffectRegister, TR::Register *dataSnippetRegister); static TR::Register *directCallEvaluator(TR::Node *node, TR::CodeGenerator *cg); static TR::Register *encodeUTF16Evaluator(TR::Node *node, TR::CodeGenerator *cg); - static TR::Register *compressStringEvaluator(TR::Node *node, TR::CodeGenerator *cg, bool japaneseMethod); - static TR::Register *compressStringNoCheckEvaluator(TR::Node *node, TR::CodeGenerator *cg, bool japaneseMethod); - static TR::Register *andORStringEvaluator(TR::Node *node, TR::CodeGenerator *cg); static TR::Register *toUpperIntrinsicUTF16Evaluator(TR::Node *node, TR::CodeGenerator *cg); static TR::Register *toLowerIntrinsicUTF16Evaluator(TR::Node *node, TR::CodeGenerator *cg); static TR::Register *toUpperIntrinsicLatin1Evaluator(TR::Node *node, TR::CodeGenerator *cg); diff --git a/runtime/compiler/x/i386/runtime/.gitignore b/runtime/compiler/x/i386/runtime/.gitignore index 09402e1636a..d78701e4d97 100644 --- a/runtime/compiler/x/i386/runtime/.gitignore +++ b/runtime/compiler/x/i386/runtime/.gitignore @@ -18,6 +18,5 @@ # # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 -/J9IA32CompressString.s /J9IA32Math64.s /IA32Recompilation.s diff --git a/runtime/compiler/x/i386/runtime/CMakeLists.txt b/runtime/compiler/x/i386/runtime/CMakeLists.txt index 1e247c44f34..bdbfc0c24a4 100644 --- a/runtime/compiler/x/i386/runtime/CMakeLists.txt +++ b/runtime/compiler/x/i386/runtime/CMakeLists.txt @@ -22,6 +22,5 @@ j9jit_files( x/i386/runtime/IA32Recompilation.nasm - x/i386/runtime/J9IA32CompressString.nasm x/i386/runtime/J9IA32Math64.nasm ) diff --git a/runtime/compiler/x/i386/runtime/IA32CompressString.inc b/runtime/compiler/x/i386/runtime/IA32CompressString.inc deleted file mode 100644 index c193ab90a85..00000000000 --- a/runtime/compiler/x/i386/runtime/IA32CompressString.inc +++ /dev/null @@ -1,246 +0,0 @@ -; Copyright IBM Corp. and others 2000 -; -; This program and the accompanying materials are made available under -; the terms of the Eclipse Public License 2.0 which accompanies this -; distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -; or the Apache License, Version 2.0 which accompanies this distribution and -; is available at https://www.apache.org/licenses/LICENSE-2.0. -; -; This Source Code may also be made available under the following -; Secondary Licenses when the conditions for such availability set -; forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -; General Public License, version 2 with the GNU Classpath -; Exception [1] and GNU General Public License, version 2 with the -; OpenJDK Assembly Exception [2]. -; -; [1] https://www.gnu.org/software/classpath/license.html -; [2] https://openjdk.org/legal/assembly-exception.html -; -; SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 - -segment .text - - DECLARE_GLOBAL compressString - DECLARE_GLOBAL compressStringJ - DECLARE_GLOBAL compressStringNoCheck - DECLARE_GLOBAL compressStringNoCheckJ - DECLARE_GLOBAL andORString - align 16 -; -; A c-style memmove with no assumptions on the element size -; or copy direction required. -; ecx has length of copy in bytes -; esi has source address -; edi has destination address -compressStringJ: - SHR ECX, 4 - ADD ESI, EAX - ADD ESI, EAX - MOV EDX, 0 -eightcharsJ: - MOV EAX, DWORD [ESI] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, DWORD [ESI+4] ; load 4 bytes from the source array into EAX (2 chars) - OR EDX, EAX ; - OR EDX, EBX - SHL EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV DWORD [EDI], EAX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+8] ; load 4 bytes from the source array into EAX (2 chars) - MOV EAX, DWORD [ESI+12] ; load 4 bytes from the source array into EAX (2 chars) - OR EDX, EAX ; - OR EDX, EBX - SHL EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV DWORD [EDI+4], EAX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+16] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, DWORD [ESI+20] ; load 4 bytes from the source array into EAX (2 chars) - OR EDX, EAX ; - OR EDX, EBX - SHL EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV DWORD [EDI+8], EAX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+24] ; load 4 bytes from the source array into EAX (2 chars) - MOV EAX, DWORD [ESI+28] ; load 4 bytes from the source array into EAX (2 chars) - OR EDX, EAX ; - OR EDX, EBX - SHL EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV DWORD [EDI+12], EAX ; write the low 2 bytes of the 4 byte value in the destination - - - ADD EDI, 16 - ADD ESI, 32 - LOOP eightcharsJ - AND EDX, 0ff80ff80h - MOV EAX, EDX - ret -; - -compressString: - SHR ECX, 3 - ADD ESI, EAX - ADD ESI, EAX - MOV EDX, 0 -eightchars: - MOV EAX, DWORD [ESI] ; load 4 bytes from the source array into EAX (2 chars) - OR EDX, EAX ; - MOV EBX, EAX ; copy the loaded value - SHR EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV WORD [EDI], AX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+4] ; load 4 bytes from the source array into EAX (2 chars) - OR EDX, EAX ; - MOV EBX, EAX ; copy the loaded value - SHR EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV WORD [EDI+2], AX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+8] ; load 4 bytes from the source array into EAX (2 chars) - OR EDX, EAX ; - MOV EBX, EAX ; copy the loaded value - SHR EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV WORD [EDI+4], AX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+12] ; load 4 bytes from the source array into EAX (2 chars) - OR EDX, EAX ; - MOV EBX, EAX ; copy the loaded value - SHR EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV WORD [EDI+6], AX ; write the low 2 bytes of the 4 byte value in the destination - - ADD EDI, 8 - ADD ESI, 16 - LOOP eightchars - AND EDX, 0ff80ff80h - MOV EAX, EDX - ret -; - - - -andORString: - SHR ECX, 4 - ADD ESI, EAX - ADD ESI, EAX - MOV EBX, 0 - MOV EDX, 0ffffffffh -eightchars2: - MOV EAX, DWORD [ESI] ; load 4 bytes from the source array into EAX (2 chars) - OR EBX, EAX - AND EDX, EAX - MOV EAX, DWORD [ESI+4] ; load 4 bytes from the source array into EAX (2 chars) - OR EBX, EAX - AND EDX, EAX - MOV EAX, DWORD [ESI+8] ; load 4 bytes from the source array into EAX (2 chars) - OR EBX, EAX - AND EDX, EAX - MOV EAX, DWORD [ESI+12] ; load 4 bytes from the source array into EAX (2 chars) - OR EBX, EAX - AND EDX, EAX - MOV EAX, DWORD [ESI+16] ; load 4 bytes from the source array into EAX (2 chars) - OR EBX, EAX - AND EDX, EAX - MOV EAX, DWORD [ESI+20] ; load 4 bytes from the source array into EAX (2 chars) - OR EBX, EAX - AND EDX, EAX - MOV EAX, DWORD [ESI+24] ; load 4 bytes from the source array into EAX (2 chars) - OR EBX, EAX - AND EDX, EAX - MOV EAX, DWORD [ESI+28] ; load 4 bytes from the source array into EAX (2 chars) - OR EBX, EAX - AND EDX, EAX - ADD ESI, 32 - LOOP eightchars2 - - MOV EAX, EBX - SHL EAX, 16 - OR EBX, EAX - SHR EBX, 16 - - MOV EAX, EDX - SHL EAX, 16 - AND EAX, EDX - - OR EAX, EBX ; AND is in the high word and OR is in the low word. - MOV EDX, EAX - ret -; - - -compressStringNoCheckJ: - SHR ECX, 4 - ADD ESI, EAX - ADD ESI, EAX -eightcharsNoCheckJ: - - MOV EAX, DWORD [ESI] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, DWORD [ESI+4] ; load 4 bytes from the source array into EAX (2 chars) - SHL EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV DWORD [EDI], EAX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+8] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, DWORD [ESI+12] ; load 4 bytes from the source array into EAX (2 chars) - SHL EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV DWORD [EDI+4], EAX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+16] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, DWORD [ESI+20] ; load 4 bytes from the source array into EAX (2 chars) - SHL EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV DWORD [EDI+8], EAX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+24] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, DWORD [ESI+28] ; load 4 bytes from the source array into EAX (2 chars) - SHL EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV DWORD [EDI+12], EAX ; write the low 2 bytes of the 4 byte value in the destination - - ADD EDI, 16 - ADD ESI, 32 - LOOP eightcharsNoCheckJ - ret -; - - -compressStringNoCheck: - SHR ECX, 3 - ADD ESI, EAX - ADD ESI, EAX -eightcharsNoCheck: - MOV EAX, DWORD [ESI] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, EAX ; copy the loaded value - SHR EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV WORD [EDI], AX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+4] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, EAX ; copy the loaded value - SHR EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV WORD [EDI+2], AX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+8] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, EAX ; copy the loaded value - SHR EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV WORD [EDI+4], AX ; write the low 2 bytes of the 4 byte value in the destination - - MOV EAX, DWORD [ESI+12] ; load 4 bytes from the source array into EAX (2 chars) - MOV EBX, EAX ; copy the loaded value - SHR EBX, 8 ; shift right by 8 - OR EAX, EBX ; or the 2 values - MOV WORD [EDI+6], AX ; write the low 2 bytes of the 4 byte value in the destination - - ADD EDI, 8 - ADD ESI, 16 - LOOP eightcharsNoCheck - ret -; - diff --git a/runtime/compiler/x/i386/runtime/J9IA32CompressString.nasm b/runtime/compiler/x/i386/runtime/J9IA32CompressString.nasm deleted file mode 100644 index a92a0cb209b..00000000000 --- a/runtime/compiler/x/i386/runtime/J9IA32CompressString.nasm +++ /dev/null @@ -1,34 +0,0 @@ -; Copyright IBM Corp. and others 2000 -; -; This program and the accompanying materials are made available under -; the terms of the Eclipse Public License 2.0 which accompanies this -; distribution and is available at https://www.eclipse.org/legal/epl-2.0/ -; or the Apache License, Version 2.0 which accompanies this distribution and -; is available at https://www.apache.org/licenses/LICENSE-2.0. -; -; This Source Code may also be made available under the following -; Secondary Licenses when the conditions for such availability set -; forth in the Eclipse Public License, v. 2.0 are satisfied: GNU -; General Public License, version 2 with the GNU Classpath -; Exception [1] and GNU General Public License, version 2 with the -; OpenJDK Assembly Exception [2]. -; -; [1] https://www.gnu.org/software/classpath/license.html -; [2] https://openjdk.org/legal/assembly-exception.html -; -; SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 - -%ifndef TR_HOST_64BIT - - %include "jilconsts.inc" - %include "IA32CompressString.inc" - -J9TR_ObjectColorBlack equ 03h - - -%else ; TR_HOST_64BIT -segment .data -IA32ArrayCopy: - db 00h - -%endif ; TR_HOST_64BIT