-
Notifications
You must be signed in to change notification settings - Fork 396
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
Add full support for calls on z/OS and enable corresponding tests #4907
Changes from all commits
c195267
7b3ecf2
cda9342
a971b3c
f20d681
bb4cbe8
e0fdba4
cbc0185
448f3f0
eaaa3c7
9278fbe
5545930
68fafb1
0bd553a
f5f00a4
fa96327
cf60a96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2000, 2019 IBM Corp. and others | ||
* Copyright (c) 2000, 2020 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 | ||
|
@@ -180,48 +180,44 @@ OMR::CodeGenPhase::performProcessRelocationsPhase(TR::CodeGenerator * cg, TR::Co | |
} | ||
|
||
if (cg->getAheadOfTimeCompile() && (comp->getOption(TR_TraceRelocatableDataCG) || comp->getOption(TR_TraceRelocatableDataDetailsCG) || comp->getOption(TR_TraceReloCG))) | ||
{ | ||
traceMsg(comp, "\n<relocatableDataCG>\n"); | ||
if (comp->getOption(TR_TraceRelocatableDataDetailsCG)) // verbose output | ||
{ | ||
uint8_t * relocatableMethodCodeStart = (uint8_t *)comp->getRelocatableMethodCodeStart(); | ||
traceMsg(comp, "Code start = %8x, Method start pc = %x, Method start pc offset = 0x%x\n", relocatableMethodCodeStart, cg->getCodeStart(), cg->getCodeStart() - relocatableMethodCodeStart); | ||
} | ||
cg->getAheadOfTimeCompile()->dumpRelocationData(); | ||
traceMsg(comp, "</relocatableDataCG>\n"); | ||
} | ||
{ | ||
traceMsg(comp, "\n<relocatableDataCG>\n"); | ||
if (comp->getOption(TR_TraceRelocatableDataDetailsCG)) // verbose output | ||
{ | ||
uint8_t * relocatableMethodCodeStart = (uint8_t *)comp->getRelocatableMethodCodeStart(); | ||
traceMsg(comp, "Code start = %8x, Method start pc = %x, Method start pc offset = 0x%x\n", relocatableMethodCodeStart, cg->getCodeStart(), cg->getCodeStart() - relocatableMethodCodeStart); | ||
} | ||
cg->getAheadOfTimeCompile()->dumpRelocationData(); | ||
traceMsg(comp, "</relocatableDataCG>\n"); | ||
} | ||
|
||
if (debug("dumpCodeSizes")) | ||
{ | ||
diagnostic("%08d %s\n", cg->getCodeLength(), comp->signature()); | ||
} | ||
if (debug("dumpCodeSizes")) | ||
{ | ||
diagnostic("%08d %s\n", cg->getCodeLength(), comp->signature()); | ||
} | ||
|
||
if (comp->getCurrentMethod() == NULL) | ||
{ | ||
comp->getMethodSymbol()->setMethodAddress(cg->getBinaryBufferStart()); | ||
} | ||
Comment on lines
-199
to
-202
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This piece of code was alarming to me. Does anyone know why this exists? And why is it guarded by a |
||
TR_ASSERT(cg->getCodeLength() <= cg->getEstimatedCodeLength(), | ||
"Method length estimate must be conservatively large\n" | ||
" codeLength = %d, estimatedCodeLength = %d \n", | ||
cg->getCodeLength(), cg->getEstimatedCodeLength() | ||
); | ||
|
||
TR_ASSERT(cg->getCodeLength() <= cg->getEstimatedCodeLength(), | ||
"Method length estimate must be conservatively large\n" | ||
" codeLength = %d, estimatedCodeLength = %d \n", | ||
cg->getCodeLength(), cg->getEstimatedCodeLength() | ||
); | ||
// also trace the interal stack atlas | ||
cg->getStackAtlas()->close(cg); | ||
|
||
// also trace the interal stack atlas | ||
cg->getStackAtlas()->close(cg); | ||
TR::SimpleRegex * regex = comp->getOptions()->getSlipTrap(); | ||
if (regex && TR::SimpleRegex::match(regex, comp->getCurrentMethod())) | ||
{ | ||
if (cg->comp()->target().is64Bit()) | ||
{ | ||
setDllSlip((char*)cg->getCodeStart(), (char*)cg->getCodeStart() + cg->getCodeLength(), "SLIPDLL64", comp); | ||
} | ||
else | ||
{ | ||
setDllSlip((char*)cg->getCodeStart(), (char*)cg->getCodeStart() + cg->getCodeLength(), "SLIPDLL31", comp); | ||
} | ||
} | ||
|
||
TR::SimpleRegex * regex = comp->getOptions()->getSlipTrap(); | ||
if (regex && TR::SimpleRegex::match(regex, comp->getCurrentMethod())) | ||
{ | ||
if (cg->comp()->target().is64Bit()) | ||
{ | ||
setDllSlip((char*)cg->getCodeStart(),(char*)cg->getCodeStart()+cg->getCodeLength(),"SLIPDLL64", comp); | ||
} | ||
else | ||
{ | ||
setDllSlip((char*)cg->getCodeStart(),(char*)cg->getCodeStart()+cg->getCodeLength(),"SLIPDLL31", comp); | ||
} | ||
} | ||
if (comp->getOption(TR_TraceCG) || comp->getOptions()->getTraceCGOption(TR_TraceCGPostBinaryEncoding)) | ||
{ | ||
const char * title = "Post Relocation Instructions"; | ||
|
@@ -304,6 +300,9 @@ OMR::CodeGenPhase::performBinaryEncodingPhase(TR::CodeGenerator * cg, TR::CodeGe | |
|
||
cg->doBinaryEncoding(); | ||
|
||
// Instructions have been emitted, and now we know what the entry point is, so update the compilation method symbol | ||
comp->getMethodSymbol()->setMethodAddress(cg->getCodeStart()); | ||
|
||
if (debug("verifyFinalNodeReferenceCounts")) | ||
{ | ||
if (cg->getDebug()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2000, 2019 IBM Corp. and others | ||
* Copyright (c) 2000, 2020 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 | ||
|
@@ -379,7 +379,7 @@ compileMethodFromDetails( | |
// not ready yet... | ||
//OMR::MethodMetaDataPOD *metaData = fe.createMethodMetaData(&compiler); | ||
|
||
startPC = compiler.cg()->getCodeStart(); | ||
startPC = (uint8_t*)compiler.getMethodSymbol()->getMethodAddress(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the main change in thinking here. See the commit body (ab6d6a4) for a full description of why we made this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be explicit this is a design decision which I'd like @mstoodle and @aviansie-ben to comment on, and perhaps @Leonardo2718 as well. It is unfortunate we don't have a public API, because in that case Do we agree with this approach? If not, any suggestions on an alternative? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This approach seems fine to me. I agree that having a single public API to extract the function pointer would be ideal. But I don't think that's a problem that needs to be solved here. The approach you've taken is reasonable given what we currently have, IMHO. |
||
uint64_t translationTime = TR::Compiler->vm.getUSecClock() - translationStartTime; | ||
|
||
if (TR::Options::isAnyVerboseOptionSet(TR_VerboseCompileEnd, TR_VerbosePerformance)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any chance you could split these changes into a separate commit? they interfere with appreciating the setup you've made here for a much better solution to the FD issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason this formatting change was made is because the indentation in it's current state is very confusing [1], and at first sight one may think the:
piece of code is guarded by the
if (cg->getAheadOfTimeCompile() &&
check, which is what I first thought, but upon a more careful inspection the indentation was hiding this is not the case.If you wish to view that commit without whitespace changes GitHub can help here:
ab6d6a4?w=1
[1] https://github.com/eclipse/omr/blob/31db81f3d84a431736ac7a9ff1b3980158fae258/compiler/codegen/OMRCodeGenPhase.cpp#L182-L202
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I think I agree. For history of commits it would be beneficial to split up formatting from actual changes.
I've split up the actual change into 6e902d5, where it belongs, and the formatting change into 27349e8. Hope that helps!