Ignore:
Timestamp:
Aug 25, 2014, 9:36:42 PM (11 years ago)
Author:
[email protected]
Message:

TypeProfiler search breaks on return statements
https://bugs.webkit.org/show_bug.cgi?id=136201

Patch by Saam Barati <[email protected]> on 2014-08-25
Reviewed by Filip Pizlo.

Searching for return statements in the TypeProfiler currently
breaks down because it expected to see the search descriptor
TypeProfilerSearchDescriptorFunctionReturn when looking for
return statements in the actual source code of the program.
But, TypeProfilerSearchDescriptorFunctionReturn search descriptor
is reserved for looking for return statements that aren't in the
actual source code of the program, but when asking for the
aggregate return type of a function. Now, searching for
return statements in the actual source code of the program will
work when passing in the search descriptor TypeProfilerSearchDescriptorNormal.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

  • runtime/TypeProfiler.cpp:

(JSC::TypeProfiler::findLocation):
(JSC::descriptorMatchesTypeLocation): Deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r172949 r172950  
    20472047                globalVariableID = TypeProfilerReturnStatement;
    20482048                if (!shouldAnalyze) {
    2049                     // Because some return statements are added implicitly (to return undefined at the end of a function), and these nodes don't emit expression ranges, give them some range.
    2050                     // Currently, this divot is on the open brace of the function.
     2049                    // Because a return statement can be added implicitly to return undefined at the end of a function,
     2050                    // and these nodes don't emit expression ranges because they aren't in the actual source text of
     2051                    // the user's program, give the type profiler some range to identify these return statements.
     2052                    // Currently, the text offset that is used as identification is on the open brace of the function
     2053                    // and is stored on TypeLocation's m_divotForFunctionOffsetIfReturnStatement member variable.
    20512054                    divotStart = divotEnd = m_sourceOffset;
    20522055                    shouldAnalyze = true;
     
    20612064            bool isNewLocation = locationPair.second;
    20622065
    2063             if (ProfileTypeBytecodeFunctionReturnStatement)
     2066            if (flag == ProfileTypeBytecodeFunctionReturnStatement)
    20642067                location->m_divotForFunctionOffsetIfReturnStatement = m_sourceOffset;
    20652068
Note: See TracChangeset for help on using the changeset viewer.