Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006797 [Squeak] Compiler minor always 12-03-07 20:47 04-18-10 22:05
Reporter nicolas cellier View Status public  
Assigned To andreas
Priority normal Resolution fixed  
Status closed   Product Version 3.10
Summary 0006797: Compiler reduce ScaledDecimal with different scales to a single literal
Description I encountered this while testing 0004378.
Compiler try and reduce number of literals using equality test.
Unfortunately, this breaks some ScaledDecimal test:

  self assert: 0.5s1 scale = 1.
  self assert: 0.5s2 scale = 2.

Each assertion would work individually, but would break together.
Additional Information
Attached Files  Compiler-literal-M6797-nice-Test.1.cs [^] (1,270 bytes) 12-03-07 21:13
 Compiler-Literal-M6797-nice-Patch.1.cs [^] (725 bytes) 03-12-08 22:17
 NewCompiler-Literal-M6797-nice-Patch.1.cs [^] (958 bytes) 08-29-08 07:31
 Compiler-Literal-M6797-nice-Patch.2.cs [^] (1,812 bytes) 08-29-08 07:32

- Relationships

- Notes
(0011510 - 116 - 122 - 122 - 122 - 122 - 122)
nicolas cellier
12-03-07 21:14

Beware, Test.1.cs does define a CompilerTest TestCase.
If you have already one in your image, just load the method.
 
(0011917 - 183 - 249 - 249 - 249 - 249 - 249)
nicolas cellier
03-12-08 22:19
edited on: 04-06-08 16:39

"fix begin"
Installer mantis bug: 6797 fix:'Compiler-Literal-M6797-nice-Patch.1.cs'.
"fix test"
Installer mantis bug: 6797 fix:'Compiler-literal-M6797-nice-Test.1.cs'.
"fix end"

 
(0012535 - 424 - 470 - 470 - 470 - 470 - 470)
kwl
08-28-08 12:34

in NewCompiler this problem is solved with #literalEqual:

  oneLiteral literalEqual: otherLiteral

and the literal objects decide equality for themselves (take Array for example). the compiler should not know anything about Array, ScaledDecimal and any other literal's equality.

the default implementation of #literalEqual: in Object takes class == into account, otherwise 'literal' would be = #literal, for example.
 
(0012536 - 660 - 732 - 732 - 732 - 732 - 732)
nicolas cellier
08-29-08 07:31
edited on: 08-29-08 07:34

Hi Klaus,
Thank you for your contribution.
I totally agree, my first patch is a quick and dirty lightweight hack,
compared to the clean and extensible solution adopted in NewCompiler.
You are right to remind us the Smalltalk way.

Please find two new versions based on your proposition.
NewCompiler-Literal-M6797-nice-Patch.1.cs to patch only the NewCompiler
Compiler-Literal-M6797-nice-Patch.2.cs to patch both the (Old)Compiler and NewCompiler.

The only problem i foresee doing so, is that loading NewCompiler then unloading it might remove #literalEqual: and thus prevent (Old)Compiler to compile literals. But that's a small packaging problem.

 
(0012538 - 153 - 165 - 165 - 165 - 165 - 165)
kwl
08-29-08 15:55

the new patches look good; I will inform the NewCompiler team (and Pharo team, for that matter) that there is something from you for them.

thanks nice
 
(0012540 - 181 - 235 - 235 - 235 - 235 - 235)
nicolas cellier
08-29-08 19:38

"fix begin"
Installer mantis bug: 6797 fix:'Compiler-Literal-M6797-nice-Patch.2.cs'.
"fix test"
Installer mantis bug: 6797 fix:'Compiler-literal-M6797-nice-Test.1.cs'.
"fix end"
 
(0013300 - 116 - 140 - 442 - 442 - 442 - 442)
nicolas cellier
09-12-09 19:25
edited on: 09-12-09 19:37

Fixed in:
http://source.squeak.org/trunk/Compiler-nice.83.mcz [^]
http://source.squeak.org/trunk/Kernel-nice.245.mcz [^]

 

- Issue History
Date Modified Username Field Change
12-03-07 20:47 nicolas cellier New Issue
12-03-07 21:13 nicolas cellier File Added: Compiler-literal-M6797-nice-Test.1.cs
12-03-07 21:14 nicolas cellier Note Added: 0011510
03-12-08 22:17 nicolas cellier File Added: Compiler-Literal-M6797-nice-Patch.1.cs
03-12-08 22:19 nicolas cellier Note Added: 0011917
04-06-08 16:37 nicolas cellier Note Edited: 0011917
04-06-08 16:39 nicolas cellier Note Edited: 0011917
08-28-08 12:34 kwl Note Added: 0012535
08-28-08 12:34 kwl Status new => feedback
08-29-08 07:31 nicolas cellier Note Added: 0012536
08-29-08 07:31 nicolas cellier File Added: NewCompiler-Literal-M6797-nice-Patch.1.cs
08-29-08 07:32 nicolas cellier File Added: Compiler-Literal-M6797-nice-Patch.2.cs
08-29-08 07:34 nicolas cellier Note Edited: 0012536
08-29-08 15:55 kwl Note Added: 0012538
08-29-08 15:55 kwl Status feedback => confirmed
08-29-08 19:38 nicolas cellier Note Added: 0012540
01-10-09 02:00 Keith_Hodges Status confirmed => pending
01-10-09 03:28 Keith_Hodges Status pending => testing
01-10-09 03:39 Keith_Hodges Status testing => resolved
01-10-09 03:39 Keith_Hodges Fixed in Version  => 3.11
01-10-09 03:39 Keith_Hodges Resolution open => fixed
01-10-09 03:39 Keith_Hodges Assigned To  => Keith_Hodges
01-10-09 03:41 Keith_Hodges Status resolved => testing
09-12-09 19:25 nicolas cellier Note Added: 0013300
09-12-09 19:37 nicolas cellier Note Edited: 0013300
10-03-09 19:33 Keith_Hodges Status testing => assigned
10-03-09 19:33 Keith_Hodges Assigned To Keith_Hodges => andreas
10-03-09 20:15 nicolas cellier Status assigned => resolved
10-03-09 20:15 nicolas cellier Fixed in Version 3.11 => trunk
04-18-10 22:05 andreas Status resolved => closed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
93 total queries executed.
46 unique queries executed.
Powered by Mantis Bugtracker