• adamk's avatar
    [modules] Detect and throw exceptions for cyclic dependencies · b48eb569
    adamk authored
    Use an unordered_map<Module, unordered_set<String>> to keep track
    of visited Module/ExportName pairs during ResolveExport.
    
    This required adding a Hash() method to Module, which is accomplished
    by allocating a Symbol and storing it in the SharedFunctionInfo::name
    slot, then delegating the hash to that Symbol.
    
    Also added a helper method Module::shared() to easily get ahold of
    the SharedFunctionInfo and call it in the appropriate places instead
    of re-doing the ternary operator.
    
    BUG=v8:1569
    
    Review-Url: https://codereview.chromium.org/2367623004
    Cr-Commit-Position: refs/heads/master@{#39743}
    b48eb569
objects-debug.cc 41.2 KB