Skip to content

Commit

Permalink
The debugger shows inlined blocks correctly now.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSpitz committed Jul 16, 2009
1 parent 5597818 commit 2dc8b04
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
16 changes: 0 additions & 16 deletions doc/Adam - working notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ Fix the compilerTester. Right, right - I broke it, made it require the compilati

----

Inlining plan:

- Fix the bug where the source-level UI crashes when inlined blocks are involved. (I've got a klein mirrors blockMethodActivation that gives me an error when I call lexicalParent on it.)
- Flesh out the list of stuff that needs to be pre-inlined to make the system ramp up quickly enough.

----

Fix the copyright notices!!!

----
Expand Down Expand Up @@ -83,12 +76,3 @@ Submodules I could maybe split off from mirror:

Not sure what to do. There's a bug where it fails to find a klein locations constant in a dictionary, even though it's actually there. It looks to me like it's in the wrong place - I think the identity hash comes out to 1 (mod 16), but it's actually in position 5 (and there are a couple of emptyMarkers at position 1).

----

On the debugger bug:

Hey, I get it. The first labelNode is always unresolved. Can I just make sure to resolve it?

Hmm, but for some reason the labelNode at index 0 in irNodesByBCI is NOT part of the nodes to be generated. Maybe it's never branched to? Hmm, it has a controlFlowPred, but that seems to be left over, because the pred points to someone different as his destination.

Maybe it's getting eliminated because the BB is empty or something.
32 changes: 20 additions & 12 deletions objects/applications/klein/kleinActivations.self
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,16 @@ SlotsToOmit: parent.
bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'klein' -> 'mirrors' -> 'copyDownParentForActivationPrototypes' -> 'kleinSpecificParent' -> () From: ( | {
'Category: accessing\x7fCategory: machine-level info\x7fCategory: sender\x7fModuleInfo: Module: kleinActivations InitialContents: FollowSlot\x7fVisibility: public'

ancestorSenderWithSP: desiredSP IfAbsent: fb = ( |
ancestorSenderWithSP: desiredSP AndScopeMirror: desiredSM IfAbsent: fb = ( |
failBlock.
rl.
senderRL.
|
failBlock: [|:e| ^ fb value: e].
rl: myRegisterLocator.
[senderRL: registerLocator senderOf: rl IfAbsent: [|:e| ^ fb value: e].
senderRL sp = desiredSP ifTrue: [^ senderRL createActivationMirror].
rl: senderRL] loop).
[desiredSP = rl sp] whileFalse: [
rl: registerLocator senderOf: rl IfAbsent: failBlock.
].
rl createActivationMirrorForScope: desiredSM).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'klein' -> 'mirrors' -> 'copyDownParentForActivationPrototypes' -> 'kleinSpecificParent' -> () From: ( | {
Expand Down Expand Up @@ -725,9 +727,11 @@ SlotsToOmit: parent.
lexicalParentSPIfFail: fb = ( |
|
myVM setTheVMAndDo: [
klein layouts block
homeFramePointerOf: (receiverOopIfFail: [|:e| ^ fb value: e])
IfFail: fb
ifScopeIsInlined: [sp] IfNotInlined: [
klein layouts block
homeFramePointerOf: (receiverOopIfFail: [|:e| ^ fb value: e])
IfFail: fb
] IfFail: fb
]).
} | )

Expand Down Expand Up @@ -1500,11 +1504,15 @@ SlotsToOmit: parent.
'Category: different kinds of objects\x7fCategory: activations\x7fModuleInfo: Module: kleinActivations InitialContents: FollowSlot\x7fVisibility: public'

forActivationMirror: m LexicalParentIfFail: fb = ( |
lpsm.
lpsp.
sm.
|
[aaaaa]. "This isn't gonna work with inlining."
m isReflecteeBlockMethodActivation ifFalse: [^ fb value: 'noParentError'].
m ancestorSenderWithSP: (m lexicalParentSPIfFail: [|:e| ^ fb value: e])
IfAbsent: fb).
m isReflecteeBlockMethodActivation ifFalse: [ ^ fb value: 'noParentError'].
sm: m scopeMirrorIfFail: [|:e| ^ fb value: e].
lpsm: sm primitiveContentsAt: 'lexicalParentScope' IfFail: [|:e| ^ fb value: e].
lpsp: m lexicalParentSPIfFail: [|:e| ^ fb value: e].
m ancestorSenderWithSP: lpsp AndScopeMirror: lpsm IfAbsent: fb).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'klein' -> 'reflectionPrimitives' -> 'parent' -> () From: ( | {
Expand Down
9 changes: 9 additions & 0 deletions objects/applications/klein/kleinTestVM.self
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ SlotsToOmit: parent prototype safety.
|
simpleMethod2a.
simpleMethod2b.
simpleMethod2c.
self).
} | )

Expand All @@ -890,6 +891,14 @@ SlotsToOmit: parent prototype safety.
self).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'klein' -> 'virtualMachines' -> 'miniVM' -> 'parent' -> 'inliningTester' -> () From: ( | {
'Category: simple tests\x7fModuleInfo: Module: kleinTestVM InitialContents: FollowSlot'

simpleMethod2c = ( |
|
[self] value).
} | )

bootstrap addSlotsTo: bootstrap stub -> 'globals' -> 'klein' -> 'virtualMachines' -> 'miniVM' -> 'parent' -> 'inliningTester' -> () From: ( | {
'Category: nonlocal returns\x7fModuleInfo: Module: kleinTestVM InitialContents: FollowSlot\x7fVisibility: private'

Expand Down

0 comments on commit 2dc8b04

Please sign in to comment.