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

Work towards objects stack allocation #6653

Merged
merged 1 commit into from Aug 9, 2016

Conversation

Projects
None yet
6 participants
@echesakovMSFT
Member

echesakovMSFT commented Aug 8, 2016

Work towards objects stack allocation: moved allocation part of newobj-lowering into separate phase

  1. Introduced GT_ALLOCOBJ node to mark places where object allocation happens
  2. In importer.cpp changed lowering of allocation part of newobj instruction from an allocation helper call to a GT_ALLOCOBJ node creation
  3. Created new phase ObjectAllocator (PHASE_ALLOCATE_OBJECTS) and put it right after dominator computing (we will need the information for escape analysis)
  4. Current implementation of ObjectAllocator walks over all basic blocks having flag BBF_HAS_NEWOBJ set and replaces GT_ALLOCOBJ with an allocation helper call

I did coreclr testing and throughput measurement. We have one assembly diff (an improvement) related to deleting unreachable basic blocks. Throughput remains the same.

@erozenfeld PTAL
cc @dotnet/jit-contrib

TYP_REF, 0,
gtNewArgList(op1));
op1 = gtNewAllocObjNode( info.compCompHnd->getNewHelper(&resolvedToken, info.compMethodHnd),
resolvedToken.hClass, TYP_REF, op1 );

This comment has been minimized.

@CarolEidt

CarolEidt Aug 8, 2016

Member

This code always assigns the newly allocated object to a temp. However, it's not entirely clear that this is a fundamental requirement. So, either here or above the call to impAssignTempGen, I would add a comment that the ObjectAllocator relies on this.

@CarolEidt

CarolEidt Aug 8, 2016

Member

This code always assigns the newly allocated object to a temp. However, it's not entirely clear that this is a fundamental requirement. So, either here or above the call to impAssignTempGen, I would add a comment that the ObjectAllocator relies on this.

@CarolEidt

This comment has been minimized.

Show comment
Hide comment
@CarolEidt

CarolEidt Aug 8, 2016

Member

LGTM, other than one suggestion for a comment.
I think it would be good to add a COMPlus_EnableObjectStackAllocation or similar.

Member

CarolEidt commented Aug 8, 2016

LGTM, other than one suggestion for a comment.
I think it would be good to add a COMPlus_EnableObjectStackAllocation or similar.

Show outdated Hide outdated src/jit/objectalloc.cpp
Show outdated Hide outdated src/jit/objectalloc.h
Show outdated Hide outdated src/jit/objectalloc.h
Show outdated Hide outdated src/jit/objectalloc.h
@pgavlin

This comment has been minimized.

Show comment
Hide comment
@pgavlin

pgavlin Aug 8, 2016

Contributor

LGTM aside from a few nits.

Contributor

pgavlin commented Aug 8, 2016

LGTM aside from a few nits.

@erozenfeld

This comment has been minimized.

Show comment
Hide comment
@erozenfeld

erozenfeld Aug 8, 2016

Member

@dotnet-bot test OSX x64 Checked Build and Test

Member

erozenfeld commented Aug 8, 2016

@dotnet-bot test OSX x64 Checked Build and Test

@erozenfeld

This comment has been minimized.

Show comment
Hide comment
@erozenfeld

erozenfeld Aug 8, 2016

Member

@dotnet-bot test Ubuntu x64 Checked Build and Test

Member

erozenfeld commented Aug 8, 2016

@dotnet-bot test Ubuntu x64 Checked Build and Test

@erozenfeld

This comment has been minimized.

Show comment
Hide comment
@erozenfeld

erozenfeld Aug 8, 2016

Member

@dotnet-bot test Ubuntu x64 Checked Build and Test

Member

erozenfeld commented Aug 8, 2016

@dotnet-bot test Ubuntu x64 Checked Build and Test

Show outdated Hide outdated src/jit/gentree.h
Show outdated Hide outdated src/jit/compphases.h
Show outdated Hide outdated src/jit/gentree.cpp
Show outdated Hide outdated src/jit/importer.cpp
Egor Chesakov
Work towards objects stack allocation: moved allocation part of newob…
…j-lowering into separate phase

1. Introduced `GT_ALLOCOBJ` node to mark places where object allocation happens
2. In `importer.cpp` changed lowering of allocation part of newobj instruction from an allocation helper call to a `GT_ALLOCOBJ` node creation
3. Created new phase `ObjectAllocator` (`PHASE_ALLOCATE_OBJECTS`) and put it right after dominator computing (we will need the information for escape analysis)
4. Current implementation of ObjectAllocator walks over all basic blocks having flag `BBF_HAS_NEWOBJ` set and replaces `GT_ALLOCOBJ` with  an allocation helper call
@echesakovMSFT

This comment has been minimized.

Show comment
Hide comment
@echesakovMSFT

echesakovMSFT Aug 9, 2016

Member

@dotnet-bot test Windows_NT x86 ryujit Checked Build and Test

Member

echesakovMSFT commented Aug 9, 2016

@dotnet-bot test Windows_NT x86 ryujit Checked Build and Test

@briansull

This comment has been minimized.

Show comment
Hide comment
@briansull

briansull Aug 9, 2016

Contributor

LGTM

Contributor

briansull commented Aug 9, 2016

LGTM

@erozenfeld

This comment has been minimized.

Show comment
Hide comment
@erozenfeld

erozenfeld Aug 9, 2016

Member

LGTM

Member

erozenfeld commented Aug 9, 2016

LGTM

@echesakovMSFT echesakovMSFT merged commit 3779842 into dotnet:master Aug 9, 2016

10 checks passed

CentOS7.1 x64 Debug Build and Test Build finished.
Details
FreeBSD x64 Checked Build Build finished.
Details
Linux ARM Emulator Cross Debug Build Build finished.
Details
Linux ARM Emulator Cross Release Build Build finished.
Details
OSX x64 Checked Build and Test Build finished.
Details
Ubuntu x64 Checked Build and Test Build finished.
Details
Windows_NT x64 Debug Build and Test Build finished.
Details
Windows_NT x64 Release Priority 1 Build and Test Build finished.
Details
Windows_NT x86 legacy_backend Checked Build and Test Build finished.
Details
Windows_NT x86 ryujit Checked Build and Test Build finished.
Details

@ufcpp ufcpp referenced this pull request Aug 31, 2016

Closed

参照型のStack Allocation #92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment