Changeset 241431 in webkit


Ignore:
Timestamp:
Feb 13, 2019 4:21:00 AM (5 years ago)
Author:
Tadeu Zagallo
Message:

SourceCode should be copied when generating bytecode for functions
https://bugs.webkit.org/show_bug.cgi?id=194536

Reviewed by Saam Barati.

The FunctionExecutable might be collected while generating the bytecode
for nested functions, in which case the SourceCode reference would no
longer be valid.

  • runtime/CodeCache.cpp:

(JSC::generateUnlinkedCodeBlockForFunctions):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r241340 r241431  
     12019-02-13  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        SourceCode should be copied when generating bytecode for functions
     4        https://bugs.webkit.org/show_bug.cgi?id=194536
     5
     6        Reviewed by Saam Barati.
     7
     8        The FunctionExecutable might be collected while generating the bytecode
     9        for nested functions, in which case the SourceCode reference would no
     10        longer be valid.
     11
     12        * runtime/CodeCache.cpp:
     13        (JSC::generateUnlinkedCodeBlockForFunctions):
     14
    1152019-02-12  Saam barati  <sbarati@apple.com>
    216
  • trunk/Source/JavaScriptCore/runtime/CodeCache.cpp

    r240557 r241431  
    171171
    172172        FunctionExecutable* executable = unlinkedExecutable->link(vm, parentSource);
    173         const SourceCode& source = executable->source();
     173        // FIXME: We shouldn't need to create a FunctionExecutable just to get its source code
     174        // https://bugs.webkit.org/show_bug.cgi?id=194576
     175        SourceCode source = executable->source();
    174176        UnlinkedFunctionCodeBlock* unlinkedFunctionCodeBlock = unlinkedExecutable->unlinkedCodeBlockFor(vm, source, constructorKind, debuggerMode, error, unlinkedExecutable->parseMode());
    175177        if (unlinkedFunctionCodeBlock)
Note: See TracChangeset for help on using the changeset viewer.