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

Implement FixupPrecode for Arm64#7015

Merged
ramarag merged 1 commit into
dotnet:masterfrom
ramarag:fixup_precode
Sep 3, 2016
Merged

Implement FixupPrecode for Arm64#7015
ramarag merged 1 commit into
dotnet:masterfrom
ramarag:fixup_precode

Conversation

@ramarag

@ramarag ramarag commented Sep 1, 2016

Copy link
Copy Markdown
Member

No description provided.

@ramarag ramarag changed the title [NO Merge] Implement FixupPrecode for Arm64 Implement FixupPrecode for Arm64 Sep 1, 2016
@ramarag ramarag changed the title Implement FixupPrecode for Arm64 [No merge]Implement FixupPrecode for Arm64 Sep 1, 2016
@ramarag

ramarag commented Sep 1, 2016

Copy link
Copy Markdown
Member Author

@kyulee1

kyulee1 commented Sep 1, 2016

Copy link
Copy Markdown

Machines are offline and unreachable, which frequently occurred these days.
I took the affected machines out of the pool temporarily.

@ramarag ramarag force-pushed the fixup_precode branch 2 times, most recently from 3306f1e to ba07034 Compare September 2, 2016 20:20
@ramarag

ramarag commented Sep 2, 2016

Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT arm64 Release pri1r2r

@ramarag

ramarag commented Sep 2, 2016

Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT arm64 Checked

@ramarag ramarag changed the title [No merge]Implement FixupPrecode for Arm64 Implement FixupPrecode for Arm64 Sep 2, 2016
@ramarag

ramarag commented Sep 2, 2016

Copy link
Copy Markdown
Member Author

@dotnet/arm64-contrib @rahku PTAL

; ARM64TODO: Implement PrecodeFixupThunk when PreCode is Enabled
; The call in fixup precode initally points to this function.
; The pupose of this function is to load the MethodDesc and forward the call the prestub.
NESTED_ENTRY PrecodeFixupThunk

@rahku rahku Sep 3, 2016

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

in comment forward the call to prestub

@rahku

rahku commented Sep 3, 2016

Copy link
Copy Markdown

In precode.cpp in function Precode::SetTargetInterlocked
following code also applies for arm64. Can you make the change
#if !defined(TARGET_ARM)
if (ret) {
FlushInstructionCache(GetCurrentProcess(),this,SizeOf());
}
#endif

ramrag: done

; x12 = MethodDesc*
; x13, x14 Trashed
; Inline computation done by FixupPrecode::GetMethodDesc()
ldrb w13, [x12, #Offset_PrecodeChunkIndex] ; m_PrecodeChunkIndex

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is this the disassembly of FixupPrecode::GetMethodDesc()

@ramarag ramarag Sep 3, 2016

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

NO the assembly for FixupPrecode::GetMethodDesc() generated by C++ compiler is actually

39403c08 ldrb        w8,[x0,#0xF]
d280030a mov         x10,#0x18
11000508 add         w8,w8,#1
93407d09 sxtw        x9,w8
9b0a7d29 mul         x9,x9,x10
f860692a ldr         x10,[x9,x0]
b500006a cbnz        x10,coreclr!FixupPrecode::GetMethodDesc+0x24 (00000001`80145004)
d2800000 mov         x0,#0
14000004 b           coreclr!FixupPrecode::GetMethodDesc+0x30 (00000001`80145010)
39403808 ldrb        w8,[x0,#0xE]
531d7108 lsl         w8,w8,#3
8b28c140 add         x0,x10,w8 sxtw
d65f03c0 ret         lr

I replaced the mul with two add instructions. The assembly code here is similar to what is found in arm

@rahku

rahku commented Sep 3, 2016

Copy link
Copy Markdown

LGTM

@ramarag

ramarag commented Sep 3, 2016

Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT arm64 Release pri1r2r

@ramarag ramarag merged commit 1a1735f into dotnet:master Sep 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Implement FixupPrecode for Arm64

Commit migrated from dotnet/coreclr@1a1735f
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.

4 participants