⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236495 in webkit


Ignore:
Timestamp:
Sep 25, 2018, 8:14:09 PM (8 years ago)
Author:
sbarati@apple.com
Message:

Calls to baselineCodeBlockForOriginAndBaselineCodeBlock in operationMaterializeObjectInOSR should actually pass in the baseline CodeBlock
https://bugs.webkit.org/show_bug.cgi?id=189940
<rdar://problem/43640987>

Reviewed by Mark Lam.

JSTests:

  • stress/use-baseline-codeblock-materialize-osr-exit.js: Added.

Source/JavaScriptCore:

We were calling baselineCodeBlockForOriginAndBaselineCodeBlock with the FTL
CodeBlock. There is nothing semantically wrong with doing that (except for
poor naming), however, the poor naming here led us to make a real semantic
mistake. We wanted the baseline CodeBlock's constant pool, but we were
accessing the FTL CodeBlock's constant pool accidentally. We need to
access the baseline CodeBlock's constant pool when we update the NewArrayBuffer
constant value.

  • bytecode/InlineCallFrame.h:

(JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):

  • ftl/FTLOperations.cpp:

(JSC::FTL::operationMaterializeObjectInOSR):

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r236437 r236495  
     12018-09-25  Saam Barati  <sbarati@apple.com>
     2
     3        Calls to baselineCodeBlockForOriginAndBaselineCodeBlock in operationMaterializeObjectInOSR should actually pass in the baseline CodeBlock
     4        https://bugs.webkit.org/show_bug.cgi?id=189940
     5        <rdar://problem/43640987>
     6
     7        Reviewed by Mark Lam.
     8
     9        * stress/use-baseline-codeblock-materialize-osr-exit.js: Added.
     10
    1112018-09-24  Saam Barati  <sbarati@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r236469 r236495  
     12018-09-25  Saam Barati  <sbarati@apple.com>
     2
     3        Calls to baselineCodeBlockForOriginAndBaselineCodeBlock in operationMaterializeObjectInOSR should actually pass in the baseline CodeBlock
     4        https://bugs.webkit.org/show_bug.cgi?id=189940
     5        <rdar://problem/43640987>
     6
     7        Reviewed by Mark Lam.
     8
     9        We were calling baselineCodeBlockForOriginAndBaselineCodeBlock with the FTL
     10        CodeBlock. There is nothing semantically wrong with doing that (except for
     11        poor naming), however, the poor naming here led us to make a real semantic
     12        mistake. We wanted the baseline CodeBlock's constant pool, but we were
     13        accessing the FTL CodeBlock's constant pool accidentally. We need to
     14        access the baseline CodeBlock's constant pool when we update the NewArrayBuffer
     15        constant value.
     16
     17        * bytecode/InlineCallFrame.h:
     18        (JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):
     19        * ftl/FTLOperations.cpp:
     20        (JSC::FTL::operationMaterializeObjectInOSR):
     21
    1222018-09-25  Joseph Pecoraro  <pecoraro@apple.com>
    223
  • trunk/Source/JavaScriptCore/bytecode/InlineCallFrame.h

    r226811 r236495  
    241241inline CodeBlock* baselineCodeBlockForOriginAndBaselineCodeBlock(const CodeOrigin& codeOrigin, CodeBlock* baselineCodeBlock)
    242242{
     243    ASSERT(baselineCodeBlock->jitType() == JITCode::BaselineJIT);
    243244    if (codeOrigin.inlineCallFrame)
    244245        return baselineCodeBlockForInlineCallFrame(codeOrigin.inlineCallFrame);
  • trunk/Source/JavaScriptCore/ftl/FTLOperations.cpp

    r232904 r236495  
    226226
    227227        CodeBlock* codeBlock = baselineCodeBlockForOriginAndBaselineCodeBlock(
    228             materialization->origin(), exec->codeBlock());
     228            materialization->origin(), exec->codeBlock()->baselineAlternative());
    229229        Structure* structure = codeBlock->globalObject()->activationStructure();
    230230
     
    287287            case PhantomCreateRest: {
    288288                CodeBlock* codeBlock = baselineCodeBlockForOriginAndBaselineCodeBlock(
    289                     materialization->origin(), exec->codeBlock());
     289                    materialization->origin(), exec->codeBlock()->baselineAlternative());
    290290
    291291                unsigned numberOfArgumentsToSkip = codeBlock->numberOfArgumentsToSkip();
     
    331331       
    332332        CodeBlock* codeBlock = baselineCodeBlockForOriginAndBaselineCodeBlock(
    333             materialization->origin(), exec->codeBlock());
     333            materialization->origin(), exec->codeBlock()->baselineAlternative());
    334334       
    335335        // We have an inline frame and we have all of the data we need to recreate it.
     
    474474        // For now, we use array allocation profile in the actual CodeBlock. It is OK since current NewArrayBuffer
    475475        // and PhantomNewArrayBuffer are always bound to a specific op_new_array_buffer.
    476         CodeBlock* codeBlock = baselineCodeBlockForOriginAndBaselineCodeBlock(materialization->origin(), exec->codeBlock());
     476        CodeBlock* codeBlock = baselineCodeBlockForOriginAndBaselineCodeBlock(materialization->origin(), exec->codeBlock()->baselineAlternative());
    477477        Instruction* currentInstruction = &codeBlock->instructions()[materialization->origin().bytecodeIndex];
    478478        RELEASE_ASSERT(Interpreter::getOpcodeID(currentInstruction[0].u.opcode) == op_new_array_buffer);
     
    507507    case PhantomNewArrayWithSpread: {
    508508        CodeBlock* codeBlock = baselineCodeBlockForOriginAndBaselineCodeBlock(
    509             materialization->origin(), exec->codeBlock());
     509            materialization->origin(), exec->codeBlock()->baselineAlternative());
    510510        JSGlobalObject* globalObject = codeBlock->globalObject();
    511511        Structure* structure = globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous);
     
    586586        }
    587587        RELEASE_ASSERT(regExp);
    588         CodeBlock* codeBlock = baselineCodeBlockForOriginAndBaselineCodeBlock(materialization->origin(), exec->codeBlock());
     588        CodeBlock* codeBlock = baselineCodeBlockForOriginAndBaselineCodeBlock(materialization->origin(), exec->codeBlock()->baselineAlternative());
    589589        Structure* structure = codeBlock->globalObject()->regExpStructure();
    590590        return RegExpObject::create(vm, structure, regExp);
Note: See TracChangeset for help on using the changeset viewer.