Show
Ignore:
Timestamp:
09/04/09 12:18:45 (3 months ago)
Author:
jmaessen
Message:

[codegen] Fix two major bugs: first, make sure we name system classes
correctly when constructing jvm-level type descriptors. Second,
distinguish between dotted method calls on trait-typed receivers
(which require INVOKEINTERFACE) from those on object-typed receivers
(which require INVOKEVIRTUAL). This latter requires some tricky
special-case code for builtin types.

Tried to clean up NamingCzar? and CodeGen? a bit along the way, as
messiness in these classes slowed down bug hunting considerably.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/LibraryBuiltin/CompilerBuiltin.fss

    r4118 r4128  
    113113    opr ^(self, other:RR64): RR64 = jDoublePow(self,other) 
    114114    opr ^(self, other:ZZ32): RR64 = 
    115         if other > 0 then 
     115        if other > 2 then 
    116116            mid = other DIV 2 
    117117            if (mid + mid) = other then 
    118                 (self self)^mid 
     118                self2 = self self 
     119                (self2)^mid 
    119120            else 
    120                 self (self^(mid-1)) 
     121                self (self^(other-1)) 
    121122            end 
     123        elif other = 2 then self self 
     124        elif other = 1 then self 
    122125        elif other = 0 then 1.0 
    123         else 1.0 / (self^(-other)) 
     126        else (* other < 0 then *) 1.0 / (self^(-other)) 
    124127        end 
    125128end