ghcjs/ghcjs — pull request #98 by lethalman (2013-09-08 12:57:16+00:00)
Title: do not delay initialization for non-recursive toplevel bindings

Fix issue https://github.com/ghcjs/ghcjs/issues/96 . Do not use h$sti when the binding is not recursive.

When running tests, I've encountered the following problem:
```
test/pkg/base/Numeric/num010.hs: [Failed]
test/pkg/base/Numeric/num010.hs: node, optimization: False
expected:
>>> exit: ExitSuccess
>>> stdout >>>
------------------------
0
0
0.0
0
0
------------------------
0
-10
0.0
0
0
------------------------
0
10
0.0
0
0
------------------------
1000
0
1000.0
8796093022208000
-43
------------------------
1000
-10
0.9765625
8796093022208000
-53
------------------------
1000
10
1024000.0
8796093022208000
-33
------------------------
1000000000000
0
1.0e12
8192000000000000
-13
------------------------
1000000000000
-10
9.765625e8
8192000000000000
-23
------------------------
1000000000000
10
1.024e15
8192000000000000
-3
------------------------
1000000000000000000000000
0
1.0e24
7450580596923828
27
------------------------
1000000000000000000000000
-10
9.765625e20
7450580596923828
17
------------------------
1000000000000000000000000
10
1.024e27
7450580596923828
37
------------------------
-1000
0
-1000.0
-8796093022208000
-43
------------------------
-1000
-10
-0.9765625
-8796093022208000
-53
------------------------
-1000
10
-1024000.0
-8796093022208000
-33
------------------------
-1000000000000
0
-1.0e12
-8192000000000000
-13
------------------------
-1000000000000
-10
-9.765625e8
-8192000000000000
-23
------------------------
-1000000000000
10
-1.024e15
-8192000000000000
-3
------------------------
-1000000000000000000000000
0
-1.0e24
-7450580596923828
27
------------------------
-1000000000000000000000000
-10
-9.765625e20
-7450580596923828
17
------------------------
-1000000000000000000000000
10
-1.024e27
-7450580596923828
37

<<< stderr >>>

<<<

but got:
>>> exit: ExitSuccess
>>> stdout >>>
------------------------
0
0
0.0
0
-0
------------------------
0
-10
0.0
0
-0
------------------------
0
10
0.0
0
-0
------------------------
1000
0
1000.0
8796093022208000
-43
------------------------
1000
-10
0.9765625
8796093022208000
-53
------------------------
1000
10
1024000.0
8796093022208000
-33
------------------------
1000000000000
0
1.0e12
8192000000000000
-13
------------------------
1000000000000
-10
9.765625e8
8192000000000000
-23
------------------------
1000000000000
10
1.024e15
8192000000000000
-3
------------------------
1000000000000000000000000
0
1.0e24
7450580596923828
27
------------------------
1000000000000000000000000
-10
9.765625e20
7450580596923828
17
------------------------
1000000000000000000000000
10
1.024e27
7450580596923828
37
------------------------
-1000
0
-1000.0
-8796093022208000
-43
------------------------
-1000
-10
-0.9765625
-8796093022208000
-53
------------------------
-1000
10
-1024000.0
-8796093022208000
-33
------------------------
-1000000000000
0
-1.0e12
-8192000000000000
-13
------------------------
-1000000000000
-10
-9.765625e8
-8192000000000000
-23
------------------------
-1000000000000
10
-1.024e15
-8192000000000000
-3
------------------------
-1000000000000000000000000
0
-1.0e24
-7450580596923828
27
------------------------
-1000000000000000000000000
-10
-9.765625e20
-7450580596923828
17
------------------------
-1000000000000000000000000
10
-1.024e27
-7450580596923828
37

<<< stderr >>>

<<<

test/pkg/base/Numeric/num001.hs: [OK]
test/pkg/base/Numeric/num007.hs: [OK]
test/pkg/base/reads001.hs: [OK]
test/pkg/base/assert.hs: [OK]
test/pkg/base/hTell001.hs: [OK]
test/pkg/base/exceptionsrun001.hs: [OK]
test/pkg/base/stableptr003.hs: [OK]
test/pkg/base/readLitChar.hs: [OK]
test/pkg/base/weak001.hs: [OK]
test/pkg/base/enum02.hs: [OK]
test/pkg/base/qsemn001.hs: [OK]
test/pkg/base/dynamic001.hs: [OK]
test/pkg/base/showDouble.hs: [OK]
test/pkg/base/readFixed001.hs: [OK]
test/pkg/base/cstring001.hs: [OK]
test/pkg/base/hGetBuf003.hs: [OK]
test/pkg/base/readInteger001.hs: [OK]
test/pkg/base/enumDouble.hs: [OK]
test/pkg/base/enum01.hs: [OK]
test/pkg/base/ioref001.hs: [OK]
test/pkg/base/fixed.hs: [OK]
test/pkg/base/Concurrent/chan001.hs: [Failed]
test/pkg/base/Concurrent/chan001.hs: node, optimization: False
expected:
>>> exit: ExitSuccess
>>> stdout >>>
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.

<<< stderr >>>

[output truncated]
<<<

but got:
>>> exit: ExitSuccess
>>> stdout >>>
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.
*** Failed! Exception: 'thread killed' (after 71 tests):
-118556990
[IsEmptyChan,IsEmptyChan,IsEmptyChan,IsEmptyChan,IsEmptyChan,IsEmptyChan,WriteChan (-36633034),WriteChan 93243127,ReadChan,ReadChan,WriteChan (-14201466),IsEmptyChan,IsEmptyChan,IsEmptyChan,ReadChan,WriteChan (-202951245),WriteChan (-57259714),WriteChan 26960343]

<<< stderr >>>

[output truncated]
<<<

test/pkg/base/Concurrent/mvar001.hs: [Failed]
test/pkg/base/Concurrent/mvar001.hs: node, optimization: False
expected:
>>> exit: ExitSuccess
>>> stdout >>>
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.

<<< stderr >>>

[output truncated]
<<<

but got:
>>> exit: ExitSuccess
>>> stdout >>>
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.
*** Failed! Exception: 'thread killed' (after 17 tests):
-28
[IsEmptyMVar]
+++ OK, passed 100 tests.
+++ OK, passed 100 tests.

<<< stderr >>>

[output truncated]
<<<

test/pkg/base/Concurrent/threadDelay001.hs: [OK]
test/pkg/base/Concurrent/chan003.hs: [OK]
test/pkg/base/Concurrent/chan002.hs: [OK]
```

Now I can't continue testing, I've anyway requested the pull for general review. Will update the request once I sort out the trouble.