[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] Debug information in ST compiler
From: |
Holger Hans Peter Freyther |
Subject: |
Re: [Help-smalltalk] Debug information in ST compiler |
Date: |
Sun, 23 Jun 2013 19:52:19 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Tue, Jun 11, 2013 at 10:57:05AM +0200, Gwenaël Casaccio wrote:
> Debug informations were added in the VM compiler, now they are
> added in the STCompiler with a test case in the file
> DebugInformationTests.st
"now the generation of them is added..."?
> <category: 'accessing'>
> + self methodClass == class ifTrue: [ ^ self ].
> ^self methodClass isNil
> ifTrue:
> [self
how often is >>#withNewMetodClass: called? Is this extra code
making a performance difference? Do you have a number?
> +
> +Object subclass: Foo [
> +]
maybe you want to re-use the setUp/tearDown as done in the other
testcase?
> +TestCase subclass: TestDebugInformation [
setUp [
self assert: Behavior compilerClass == STInST.STCompiler?
(or as part of the testcase?)
]
> + testDebugInformation [
> + <category: 'testing'>
> +
> + | mth |
> + Foo compile: 'a_1: i_1 a_2: i_2 [
mth := Foo compile: ...?
> + | i j k |
> +
> + ^ [ :a :b :c | | d e f | ]
> +]'.
> +
> + mth := Foo>>#'a_1:a_2:'.
> + self assert: (mth arguments = #(#'i_1' #'i_2')).
> + self assert: (mth temporaries = #(#'i' #'j' #'k')).
> + self assert: ((mth blockAt: 1) arguments = #(#'a' #'b' #'c')).
> + self assert: ((mth blockAt: 1) temporaries = #(#'d' #'e' #'f')).
nice.
> +
> +
> + createDebugInformationFor: aCompiledCode from: aNode [
> + <category: 'debug informations'>
> +
> + debugInfo at: aCompiledCode put: (DebugInformation variables:
> ((aNode argumentNames collect: [ :each | each asSymbol]), (aNode body
> temporaryNames collect: [ :each | each asSymbol])) asArray).
okay.