Ignore:
Timestamp:
Mar 24, 2014, 8:44:52 PM (11 years ago)
Author:
[email protected]
Message:

More scaffolding for a stub routine to have a stub recursively embedded inside it
https://bugs.webkit.org/show_bug.cgi?id=130770

Reviewed by Oliver Hunt.

  • bytecode/CallLinkInfo.cpp:

(JSC::CallLinkInfo::unlink): VM& argument is superfluous.
(JSC::CallLinkInfo::visitWeak): Factor this out, it used to be in CodeBlock::finalizeUnconditionally().

  • bytecode/CallLinkInfo.h:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finalizeUnconditionally): Factor out some functionality into CallLinkInfo::visitWeak(), and make sure we pass RepatchBuffer& in more places.
(JSC::CodeBlock::unlinkCalls):
(JSC::CodeBlock::unlinkIncomingCalls):

  • bytecode/PolymorphicGetByIdList.cpp: Pass RepatchBuffer& through and call JITStubRoutine::visitWeak().

(JSC::GetByIdAccess::visitWeak):
(JSC::PolymorphicGetByIdList::visitWeak):

  • bytecode/PolymorphicGetByIdList.h:
  • bytecode/PolymorphicPutByIdList.cpp: Pass RepatchBuffer& through and call JITStubRoutine::visitWeak().

(JSC::PutByIdAccess::visitWeak):
(JSC::PolymorphicPutByIdList::visitWeak):

  • bytecode/PolymorphicPutByIdList.h:
  • bytecode/StructureStubInfo.cpp: Pass RepatchBuffer& through.

(JSC::StructureStubInfo::visitWeakReferences):

  • bytecode/StructureStubInfo.h:
  • jit/ClosureCallStubRoutine.cpp: isClosureCall is unused.

(JSC::ClosureCallStubRoutine::ClosureCallStubRoutine):

  • jit/GCAwareJITStubRoutine.cpp:

(JSC::GCAwareJITStubRoutine::GCAwareJITStubRoutine):
(JSC::createJITStubRoutine):

  • jit/GCAwareJITStubRoutine.h: Make it easier to construct one of these.

(JSC::GCAwareJITStubRoutine::isClosureCall): Deleted.

  • jit/JITStubRoutine.cpp:

(JSC::JITStubRoutine::visitWeak): This will allow future JITStubRoutine subclasses to have stubs recursively embedded inside them.

  • jit/JITStubRoutine.h:
  • jit/Repatch.cpp:

(JSC::generateGetByIdStub): Fix a possible GC bug where we weren't making the stub routine GC aware.
(JSC::emitCustomSetterStub): Clean up some code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h

    r164424 r166218  
    11/*
    2  * Copyright (C) 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5353class GCAwareJITStubRoutine : public JITStubRoutine {
    5454public:
    55     GCAwareJITStubRoutine(const MacroAssemblerCodeRef&, VM&, bool isClosureCall = false);
     55    GCAwareJITStubRoutine(const MacroAssemblerCodeRef&, VM&);
    5656    virtual ~GCAwareJITStubRoutine();
    5757   
     
    6262   
    6363    void deleteFromGC();
    64    
    65     bool isClosureCall() const { return m_isClosureCall; }
    6664   
    6765protected:
     
    7573    bool m_mayBeExecuting;
    7674    bool m_isJettisoned;
    77     bool m_isClosureCall;
    7875};
    7976
     
    113110
    114111PassRefPtr<JITStubRoutine> createJITStubRoutine(
    115     const MacroAssemblerCodeRef&, VM&, const JSCell* owner, bool makesCalls);
    116 PassRefPtr<JITStubRoutine> createJITStubRoutine(
    117112    const MacroAssemblerCodeRef&, VM&, const JSCell* owner, bool makesCalls,
    118     JSCell*);
     113    JSCell* = 0);
     114
     115// Helper for the creation of simple stub routines that need no help from the GC. Note
     116// that codeBlock gets "executed" more than once.
     117#define FINALIZE_CODE_FOR_GC_AWARE_STUB(codeBlock, patchBuffer, makesCalls, cell, dataLogFArguments) \
     118    (createJITStubRoutine(FINALIZE_CODE_FOR((codeBlock), (patchBuffer), dataLogFArguments), *(codeBlock)->vm(), (codeBlock)->ownerExecutable(), (makesCalls), (cell)))
    119119
    120120} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.