[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[E8] Reducing the image size

We want to obtain the minimal expression that expose the bug.

First attempt

S8 trace tool is used to get the methods activated during the evaluation of the offending expression.
The tracing is run in Chrome with U8 tools to ensure it runs until completion.
The tracer is installed droping the source file onto workspace window; and fileIn of all the source.

The tracer is set to call a javascript function that memorize the method tag (without duplicates).
The (javascript) code to set the capture function is evaluated in a workspace follows
cache = {}
capture = function(what){
	cache[what] = what
}

The code to evaluate (with showIt) to capture methods and report the result is
Exposer logName: #capture.
[  '1+2+3+4+5+6+7+8+9+0+1+2+3+4+5+6+7+8+9+0+1+2+3+4+5+6+7+8+9+0+1+2+3+4+5+6+7+8+9+0'
	doIt;doIt;doIt
] trace.
(JS @ #{cache}) propertyNames sorted asLiteral

The result obtained is here [E8] trace results
The size of the captured methods is 315.

To obtain the collection of activated methods
result collect: [:key| | stream cls selector |
	stream := key stream.
	cls := (stream upTo: #__) asArrayOfSubstringsSeparatedBy: $_.
	cls := cls size = 1
		ifTrue: [ Smalltalk at: cls first ]
		ifFalse: [ (Smalltalk at: cls first) perform: cls second ].
	selector := stream upToEnd asStSelector.
	cls >> selector
]
[E8] Activated methods list, [E8] Activated methods by class
[E8] Required classes (st/js)

To obtain the smalltalk sources in chunk format
result inject: '' into: [:total :mth|
  total , (Exporter new fileOutMethod: mth)
]
[E8] Activated Methods (chunk format)

To obtain the javascript code of activated methods
Exporter exportAll: result
[E8] Activated Methods (javascript)


Uploaded Image: alert.gifNote that this procedure has been cancelled because we have found a way to instantiate the bug with a simple expression. WITHOUT involving the Compiler!

See [E8] JavascriptCore parse issue