Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AArch64: Add support for ARM64 in Debug.cpp #3039

Merged
merged 1 commit into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/aarch64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ compiler_library(aarch64
${CMAKE_CURRENT_LIST_DIR}/codegen/OMRTreeEvaluator.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/OpBinary.cpp
${CMAKE_CURRENT_LIST_DIR}/codegen/UnaryEvaluator.cpp
${CMAKE_CURRENT_LIST_DIR}/env/OMRDebugEnv.cpp
)
30 changes: 30 additions & 0 deletions compiler/aarch64/env/OMRDebugEnv.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2018, 2018 IBM Corp. and others
*
* 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 http://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] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/

#include "env/DebugEnv.hpp"

OMR::ARM64::DebugEnv::DebugEnv() :
OMR::DebugEnv()
{
_hexAddressWidthInChars = 16;
_hexAddressFieldWidthInChars = 18;
_codeByteColumnWidth = 10;
}
4 changes: 4 additions & 0 deletions compiler/aarch64/env/OMRDebugEnv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ namespace ARM64

class OMR_EXTENSIBLE DebugEnv : public OMR::DebugEnv
{
public:

DebugEnv();

};

}
Expand Down
23 changes: 21 additions & 2 deletions compiler/ras/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,14 +751,14 @@ TR_Debug::printPrefix(TR::FILE *pOutFile, TR::Instruction *instr, uint8_t *curso
char *p0 = prefix;
char *p1 = prefix + strlen(prefix);

// Print machine code in bytes on X86, in words on PPC,ARM
// Print machine code in bytes on X86, in words on PPC,ARM,ARM64
// Stop if we try to run over the buffer.
if (TR::Compiler->target.cpu.isX86())
{
for (int i = 0; i < size && p1 - p0 + 3 < prefixWidth; i++, p1 += 3)
sprintf(p1, " %02x", *cursor++);
}
else if (TR::Compiler->target.cpu.isPower() || TR::Compiler->target.cpu.isARM())
else if (TR::Compiler->target.cpu.isPower() || TR::Compiler->target.cpu.isARM() || TR::Compiler->target.cpu.isARM64())
{
for (int i = 0; i < size && p1 - p0 + 9 < prefixWidth; i += 4, p1 += 9, cursor += 4)
sprintf(p1, " %08x", *((uint32_t *)cursor));
Expand Down Expand Up @@ -2870,6 +2870,14 @@ TR_Debug::print(TR::FILE *pOutFile, TR::GCRegisterMap * map)
}
#endif

#if defined(TR_TARGET_ARM64)
if (TR::Compiler->target.cpu.isARM64())
{
printARM64GCRegisterMap(pOutFile, map);
return;
}
#endif

}

void
Expand Down Expand Up @@ -2998,6 +3006,10 @@ TR_Debug::getName(TR::Register *reg, TR_RegisterSizes size)
#if defined(TR_TARGET_S390)
if (TR::Compiler->target.cpu.isZ())
return getName(toRealRegister(reg), size);
#endif
#if defined(TR_TARGET_ARM64)
if (TR::Compiler->target.cpu.isARM64())
return getName((TR::RealRegister *)reg, size);
#endif
TR_ASSERT(0, "TR_Debug::getName() ==> unknown target platform for given real register\n");
}
Expand Down Expand Up @@ -3173,6 +3185,13 @@ TR_Debug::print(TR::FILE *pOutFile, TR::Register * reg, TR_RegisterSizes size)
print(pOutFile, toRealRegister(reg), size);
return;
}
#endif
#if defined(TR_TARGET_ARM64)
if (TR::Compiler->target.cpu.isARM64())
{
print(pOutFile, (TR::RealRegister *)reg, size);
return;
}
#endif
}
else
Expand Down
5 changes: 3 additions & 2 deletions jitbuilder/build/files/target/aarch64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ JIT_PRODUCT_BACKEND_SOURCES+= \
$(JIT_OMR_DIRTY_DIR)/aarch64/codegen/UnaryEvaluator.cpp

#environement files
#JIT_PRODUCT_BACKEND_SOURCES+= \
# $(JIT_OMR_DIRTY_DIR)/aarch64/env/<file>.cpp

JIT_PRODUCT_BACKEND_SOURCES+= \
$(JIT_OMR_DIRTY_DIR)/aarch64/env/OMRDebugEnv.cpp