Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

[RyuJIT/ARM32] Support for CFI unwind info#14447

Merged
BruceForstall merged 2 commits intodotnet:masterfrom
sergign60:arm_build
Oct 19, 2017
Merged

[RyuJIT/ARM32] Support for CFI unwind info#14447
BruceForstall merged 2 commits intodotnet:masterfrom
sergign60:arm_build

Conversation

@sergign60
Copy link

No description provided.

@sergign60 sergign60 changed the title [RyuJIT/ARM32] Support for CFI unwind info [RyuJIT/ARM32][WIP][DO NOT MERGE] Support for CFI unwind info Oct 12, 2017
@sergign60 sergign60 force-pushed the arm_build branch 8 times, most recently from d1fb8da to 031662e Compare October 16, 2017 14:42
@sergign60 sergign60 changed the title [RyuJIT/ARM32][WIP][DO NOT MERGE] Support for CFI unwind info [RyuJIT/ARM32] Support for CFI unwind info Oct 16, 2017
@sergign60
Copy link
Author

@jkotas @BruceForstall @dotnet/jit-contrib
CC: @Dmitri-Botcharnikov @BredPet @alpencolt
please review

@sergign60
Copy link
Author

dotnet/llilc#1011

@sergign60
Copy link
Author

#2868

@sergign60
Copy link
Author

dotnet/corert#752

@sergign60
Copy link
Author

dotnet/corert#4755

@sergign60
Copy link
Author

dotnet/corert#4626

@BruceForstall BruceForstall self-requested a review October 19, 2017 01:03

#endif // _TARGET_ARMARCH_

#if defined(UNIX_AMD64_ABI) || defined(_TARGET_UNIX_)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's sufficient to just use:

#if defined(_TARGET_UNIX_)

since if UNIX_AMD64_ABI is defined, then _TARGET_UNIX_ will also be defined.

This comment applies to other locations as well.

#endif // _TARGET_ARM_

#if defined(UNIX_AMD64_ABI) || defined(_TARGET_UNIX_)
int Compiler::mapRegNumToDwarfReg(regNumber reg);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the Compiler:: here, do you?

void unwindBegPrologCFI();
void unwindAllocStackCFI(unsigned size);
void unwindSetFrameRegCFI(regNumber reg, unsigned offset);
#if DEBUG

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be #ifdef DEBUG

{
int dwarfReg = DWARF_REG_ILLEGAL;

return dwarfReg;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this unimplemented? Should it be:

NYI("CFI codes");

?

{
int dwarfReg = DWARF_REG_ILLEGAL;

return dwarfReg;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this unimplemented? Should it be:

NYI("CFI codes");

?


#if defined(_TARGET_UNIX_)

#if defined(_TARGET_ARM_)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about reducing the two #if to one line?

{
unwindPushCFI(regNum);
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop looks the same as the one for unwindPushMaskInt(). How about creating a function (unwindPushCFIMask()?)

Note that you could optimize the float case by starting at the first float register; currently it's iterating through all the integer registers just to get to the first float reg.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(You could also use the BitScanForward/BitScanForward64 intrinsics, if you're really worried about perf)

Copy link
Author

@sergign60 sergign60 Oct 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


#if defined(_TARGET_UNIX_)
if (generateCFIUnwindCodes())
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you extract this out to a unwindEmitFuncCFI?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergign60
Copy link
Author

@BruceForstall Thanks for your notes. I think that I've satisfied all of them

@BruceForstall
Copy link

Ignoring CentOS; it's failing all jobs.

@BruceForstall BruceForstall merged commit 3544094 into dotnet:master Oct 19, 2017
eeAllocUnwindInfo((BYTE*)pHotCode, nullptr /* pColdCode */, startOffset, endOffset, unwindCodeBytes, pUnwindBlock,
(CorJitFuncKind)func->funKind);

if (pColdCode != NULL)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This NULL needs to be changed to nullptr for clang-tidy to pass

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added PR #14602

Copy link
Author

@sergign60 sergign60 Oct 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benaadams benaadams mentioned this pull request Oct 20, 2017
@sergign60 sergign60 deleted the arm_build branch October 20, 2017 09:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants