Ignore:
Timestamp:
May 25, 2012, 1:19:55 PM (13 years ago)
Author:
[email protected]
Message:

DFG ConvertThis should just be a CheckStructure if the structure is known
https://bugs.webkit.org/show_bug.cgi?id=87057

Reviewed by Gavin Barraclough.

Merged r118021 from dfgopt.

This gives ValueProfile the ability to track singleton values - i.e. profiling
sites that always see the same value.

That is then used to profile the structure in op_convert_this.

This is then used to optimize op_convert_this into a CheckStructure if the
structure is always the same.

That then results in better CSE in inlined code that uses 'this', since
previously we couldn't CSE accesses on 'this' from different inline call frames.

Also fixed a bug where we were unnecessarily flushing 'this'.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dump):
(JSC::CodeBlock::stronglyVisitStrongReferences):

  • bytecode/LazyOperandValueProfile.cpp:

(JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions):

  • bytecode/LazyOperandValueProfile.h:

(CompressedLazyOperandValueProfileHolder):

  • bytecode/Opcode.h:

(JSC):
(JSC::padOpcodeName):

  • bytecode/ValueProfile.h:

(JSC::ValueProfileBase::ValueProfileBase):
(JSC::ValueProfileBase::dump):
(JSC::ValueProfileBase::computeUpdatedPrediction):
(ValueProfileBase):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::setArgument):
(JSC::DFG::ByteCodeParser::parseBlock):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_convert_this):
(JSC::JIT::emitSlow_op_convert_this):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_convert_this):
(JSC::JIT::emitSlow_op_convert_this):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/JSValue.h:

(JSValue):

  • runtime/Structure.h:

(JSC::JSValue::structureOrUndefined):
(JSC):

File:
1 edited

Legend:

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

    r118270 r118555  
    671671            int r0 = (++it)->u.operand;
    672672            dataLog("[%4d] convert_this\t %s\n", location, registerName(exec, r0).data());
     673            ++it; // Skip value profile.
    673674            break;
    674675        }
     
    20862087    }
    20872088   
    2088     m_lazyOperandValueProfiles.computeUpdatedPredictions();
     2089    m_lazyOperandValueProfiles.computeUpdatedPredictions(Collection);
    20892090#endif
    20902091
    20912092#if ENABLE(VALUE_PROFILER)
    20922093    for (unsigned profileIndex = 0; profileIndex < numberOfArgumentValueProfiles(); ++profileIndex)
    2093         valueProfileForArgument(profileIndex)->computeUpdatedPrediction();
     2094        valueProfileForArgument(profileIndex)->computeUpdatedPrediction(Collection);
    20942095    for (unsigned profileIndex = 0; profileIndex < numberOfValueProfiles(); ++profileIndex)
    2095         valueProfile(profileIndex)->computeUpdatedPrediction();
     2096        valueProfile(profileIndex)->computeUpdatedPrediction(Collection);
    20962097#endif
    20972098}
Note: See TracChangeset for help on using the changeset viewer.