Skip to content

Commit

Permalink
Merge pull request eclipse-openj9#14435 from 0xdaryl/fixint3
Browse files Browse the repository at this point in the history
Fix JIT code breakpoints on x86
  • Loading branch information
dsouzai authored Feb 7, 2022
2 parents 6a44275 + 19db712 commit ecc33af
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions runtime/compiler/x/amd64/codegen/AMD64PrivateLinkage.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2021 IBM Corp. and others
* Copyright (c) 2000, 2022 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
Expand Down Expand Up @@ -1258,7 +1258,7 @@ void J9::X86::AMD64::PrivateLinkage::buildIPIC(TR::X86CallSite &site, TR::LabelS
// let's just lay it down. It's likely not worth the effort to get
// this exactly right in all cases.
//
generateInstruction(TR::InstOpCode::bad, site.getCallNode(), cg());
generateInstruction(TR::InstOpCode::INT3, site.getCallNode(), cg());
}
}

Expand Down
12 changes: 6 additions & 6 deletions runtime/compiler/x/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static TR_OutlinedInstructions *generateArrayletReference(
static char *forceArrayletInt = feGetEnv("TR_forceArrayletInt");
if (forceArrayletInt)
{
generateInstruction(TR::InstOpCode::bad, node, cg);
generateInstruction(TR::InstOpCode::INT3, node, cg);
}

// -----------------------------------------------------------------------------------
Expand Down Expand Up @@ -4418,7 +4418,7 @@ void J9::X86::TreeEvaluator::asyncGCMapCheckPatching(TR::Node *node, TR::CodeGen
//
static char *d = feGetEnv("TR_GCOnAsyncBREAK");
if (d)
generateInstruction(TR::InstOpCode::bad, node, cg);
generateInstruction(TR::InstOpCode::INT3, node, cg);

generateMemImmInstruction(TR::InstOpCode::S8MemImm4, node, generateX86MemoryReference(cg->getVMThreadRegister(), offsetof(J9VMThread, stackOverflowMark), cg), -1, cg);
generateRegImmInstruction(TR::InstOpCode::MOV8RegImm4, node, tempReg, 1 << comp->getPersistentInfo()->getGCMapCheckEventHandle(), cg);
Expand Down Expand Up @@ -4513,7 +4513,7 @@ void J9::X86::TreeEvaluator::asyncGCMapCheckPatching(TR::Node *node, TR::CodeGen

static char *d = feGetEnv("TR_GCOnAsyncBREAK");
if (d)
generateInstruction(TR::InstOpCode::bad, node, cg);
generateInstruction(TR::InstOpCode::INT3, node, cg);

//Populate the existing inline code
//
Expand Down Expand Up @@ -5933,7 +5933,7 @@ static void genHeapAlloc(
UDATA sizeClass = fej9->getObjectSizeClass(allocationSizeOrDataOffset);

if (comp->getOption(TR_BreakOnNew))
generateInstruction(TR::InstOpCode::bad, node, cg);
generateInstruction(TR::InstOpCode::INT3, node, cg);

// heap allocation, so proceed
if (sizeReg)
Expand Down Expand Up @@ -10511,7 +10511,7 @@ void J9::X86::TreeEvaluator::VMwrtbarRealTimeWithoutStoreEvaluator(

if (comp->getOption(TR_BreakOnWriteBarrier))
{
generateInstruction(TR::InstOpCode::bad, node, cg);
generateInstruction(TR::InstOpCode::INT3, node, cg);
}

TR::SymbolReference *wrtBarSymRef = NULL;
Expand Down Expand Up @@ -10842,7 +10842,7 @@ void J9::X86::TreeEvaluator::VMwrtbarWithoutStoreEvaluator(

if (comp->getOption(TR_BreakOnWriteBarrier))
{
generateInstruction(TR::InstOpCode::bad, node, cg);
generateInstruction(TR::InstOpCode::INT3, node, cg);
}

TR::MemoryReference *fragmentParentMR = generateX86MemoryReference(cg->getVMThreadRegister(), fej9->thisThreadRememberedSetFragmentOffset() + fej9->getFragmentParentOffset(), cg);
Expand Down
8 changes: 4 additions & 4 deletions runtime/compiler/x/codegen/X86PrivateLinkage.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2021 IBM Corp. and others
* Copyright (c) 2000, 2022 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
Expand Down Expand Up @@ -596,7 +596,7 @@ void J9::X86::PrivateLinkage::createPrologue(TR::Instruction *cursor)
//
cursor = new (trHeapMemory()) TR::X86PaddingInstruction(cursor, minInstructionSize, TR_AtomicNoOpPadding, cg());
}
cursor = new (trHeapMemory()) TR::Instruction(TR::InstOpCode::bad, cursor, cg());
cursor = new (trHeapMemory()) TR::Instruction(TR::InstOpCode::INT3, cursor, cg());
}

// Compute the nature of the preserved regs
Expand Down Expand Up @@ -1090,7 +1090,7 @@ J9::X86::PrivateLinkage::buildDirectDispatch(
{
if (TR::SimpleRegex::matchIgnoringLocale(r, name))
{
generateInstruction(TR::InstOpCode::bad, callNode, cg());
generateInstruction(TR::InstOpCode::INT3, callNode, cg());
}
}
}
Expand Down Expand Up @@ -2563,7 +2563,7 @@ void J9::X86::PrivateLinkage::buildInterfaceDispatchUsingLastITable (TR::X86Call
//
generateLabelInstruction(TR::InstOpCode::label, callNode, lastITableTestLabel, cg());
if (breakBeforeInterfaceDispatchUsingLastITable)
generateInstruction(TR::InstOpCode::bad, callNode, cg());
generateInstruction(TR::InstOpCode::INT3, callNode, cg());
generateRegMemInstruction(TR::InstOpCode::LRegMem(), callNode, scratchReg, generateX86MemoryReference(vftReg, (int32_t)fej9->getOffsetOfLastITableFromClassField(), cg()), cg());
bool use32BitInterfacePointers = comp()->target().is32Bit();
if (comp()->useCompressedPointers() /* actually compressed object headers */)
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/x/i386/codegen/IA32PrivateLinkage.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2021 IBM Corp. and others
* Copyright (c) 2000, 2022 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
Expand Down Expand Up @@ -606,7 +606,7 @@ void J9::X86::I386::PrivateLinkage::buildIPIC(
if (useLastITableCache)
{
if (breakBeforeIPICUsingLastITable)
generateInstruction(TR::InstOpCode::bad, site.getCallNode(), cg());
generateInstruction(TR::InstOpCode::INT3, site.getCallNode(), cg());
if (numIPicSlotsBeforeLastITable)
numIPicSlots = atoi(numIPicSlotsBeforeLastITable);
}
Expand Down

0 comments on commit ecc33af

Please sign in to comment.