Skip to content

Commit

Permalink
More refactoring in preparation for inlining.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSpitz committed Apr 24, 2009
1 parent 7fe9c27 commit 935d12f
Show file tree
Hide file tree
Showing 23 changed files with 3,346 additions and 3,638 deletions.
26 changes: 7 additions & 19 deletions doc/Adam - working notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ Remember to clean up the aaaaa things.

----

I guess I've gotta actually do some inlining now, huh? Except I'm worried about reusability. So I've gotta make it smarter - instead of "Is this nmethod reusable for all receiver maps?", I've got to ask, "Is this nmethod reusable for *this* receiver map?"

For now, I care most about inlining constant slot accesses. So I just need a reusabilityCondition that checks to make sure that the slot is a constant and contains the same object.

----

Stuff I want to do:

- In the allocator, maybe initialize it right away with a vector of all 32 precolored register values. Then use those in the locationAssigner. (I think that's what the textbook wants me to do; maybe it makes a difference?)
Expand All @@ -64,14 +58,6 @@ Stuff I want to do:

----

Oh, that's a good point about non-LIFO blocks - maybe I could convert them on-the-fly, since most blocks don't actually outlive their stack frame. So instead of zapping the home-frame pointer, convert it to a pointer to the heap-allocated thing.

----

OK, it frickin' works! Except for the test case that tries to compile a method, because I broke the stuff when I made compilers require a compilationRequester. So I've just gotta fix that and then my new compiler can be declared officially working!

----

http://selflanguage.org/_static/published/dynamic-deoptimization.pdf

So it looks like the deal is:
Expand All @@ -89,8 +75,10 @@ First step is just to create the scopeDesc info.

----

But I'd better finish cleaning up what I've done so far first:
- Fix the runtime compiler (the compilationRequester thing).
- Decide what to do about the aaaaa places.
- Maybe convert some primitives to IR nodes? I've got that stuff paged into my brain anyway, might as well take a look at it.
- Maybe go through the compiler and just clean it up a bit, make sure everything's really really clear.
So now I've split up the machine-level and source-level allocators. Good! What next?

OK, so when we inline a call to a method, what's different?

- Instead of moving stuff to the machine-level outgoing locations, we've gotta just move it to some new values that we create to hold the scope's incoming rcvr+args. (And those values have to be located in memory if the inlined scope has blocks.) And the scope has to have a valueForOutgoingResult too. Basically just the same as for primitives.
- The incoming args still need to be stored in memory for uplevel access, though, right?
- Just gotta call generateInitializationForLocals.
14 changes: 0 additions & 14 deletions objects/applications/asmKit/asmFrame/asmFrame.self
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,6 @@ See the LICENSE file for license information.
| ) .
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'assemblerSystems' -> 'framework' -> () From: ( | {
'Category: helpers\x7fCategory: iterating\x7fCategory: registers\x7fModuleInfo: Module: asmFrame InitialContents: FollowSlot\x7fVisibility: public'

allRegisterLocations = ( |
|
cachedAllRegisterLocations ifNil: [| regLocProto |
[todo cleanup]. "I don't like that this says klein instead of vmKit or something.
Maybe this cache should live elsewhere? -- Adam, Mar. 2009"
regLocProto: klein locations register.
cachedAllRegisterLocations: allRegisters copyMappedBy: [|:r| regLocProto copyForRegister: r].
cachedAllRegisterLocations
]).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'assemblerSystems' -> 'framework' -> () From: ( | {
'Category: helpers\x7fCategory: iterating\x7fCategory: registers\x7fModuleInfo: Module: asmFrame InitialContents: FollowSlot\x7fVisibility: public'

Expand Down
3 changes: 2 additions & 1 deletion objects/applications/asmKit/asmFrame/asmFrameRegs.self
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'$Revision: 30.14 $'
'
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
Copyright 1992-2006 Sun Microsystems, Inc. and Stanford University.
See the LICENSE file for license information.
'


Expand Down
6 changes: 0 additions & 6 deletions objects/applications/asmKit/asmPPC/asmPPC.self
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,6 @@ Used for testing.\x7fModuleInfo: Module: asmPPC InitialContents: FollowSlot\x7fV
bigEndianMixin* = bootstrap stub -> 'globals' -> 'assemblerSystems' -> 'framework' -> 'bigEndianMixin' -> ().
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'assemblerSystems' -> 'ppc' -> () From: ( | {
'Category: caches\x7fModuleInfo: Module: asmPPC InitialContents: InitializeToExpression: (nil)\x7fVisibility: private'

cachedAllRegisterLocations <- bootstrap stub -> 'globals' -> 'nil' -> ().
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'assemblerSystems' -> 'ppc' -> () From: ( | {
'Category: caches\x7fModuleInfo: Module: asmPPC InitialContents: InitializeToExpression: (nil)\x7fVisibility: private'

Expand Down
6 changes: 0 additions & 6 deletions objects/applications/asmKit/asmSPARC/asmSPARC.self
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,6 @@ SlotsToOmit: parent.
bigEndianMixin* = bootstrap stub -> 'globals' -> 'assemblerSystems' -> 'framework' -> 'bigEndianMixin' -> ().
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'assemblerSystems' -> 'sparc' -> () From: ( | {
'Category: caches\x7fModuleInfo: Module: asmSPARC InitialContents: InitializeToExpression: (nil)\x7fVisibility: private'

cachedAllRegisterLocations.
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'assemblerSystems' -> 'sparc' -> () From: ( | {
'Category: caches\x7fModuleInfo: Module: asmSPARC InitialContents: InitializeToExpression: (nil)\x7fVisibility: private'

Expand Down
Loading

0 comments on commit 935d12f

Please sign in to comment.