Skip to content
  • fpizlo@apple.com's avatar
    Infer constant global variables · 33961712
    fpizlo@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=124464
    
    Source/JavaScriptCore: 
    
    Reviewed by Sam Weinig.
            
    All global variables that are candidates for watchpoint-based constant inference (i.e.
    not 'const' variables) will now have WatchpointSet's associated with them and those
    are used to drive the inference by tracking three states of each variable:
            
    Uninitialized: the variable's value is Undefined and the WatchpointSet state is
        ClearWatchpoint.
            
    Initialized: the variable's value was set to something (could even be explicitly set
        to Undefined) and the WatchpointSet state is IsWatching.
            
    Invalidated: the variable's value was set to something else (could even be the same
        thing as before but the point is that a put operation did execute again) and the
        WatchpointSet is IsInvalidated.
            
    If the compiler tries to compile a GetGlobalVar and the WatchpointSet state is
    IsWatching, then the current value of the variable can be folded in pl...
    33961712