Ignore:
Timestamp:
Aug 29, 2012, 5:27:19 PM (13 years ago)
Author:
[email protected]
Message:

Refactoring LLInt::Data.
https://bugs.webkit.org/show_bug.cgi?id=95316.

Patch by Mark Lam <[email protected]> on 2012-08-29
Reviewed by Geoff Garen.

This change allows its opcodeMap to be easily queried from any function
without needing to go through a GlobalData object. It also introduces
the LLInt::getCodePtr() methods that will be used by the LLInt C loop
later to redefine how llint symbols (opcodes and trampoline glue
labels) get resolved.

  • assembler/MacroAssemblerCodeRef.h:

(MacroAssemblerCodePtr):
(JSC::MacroAssemblerCodePtr::createLLIntCodePtr):
(MacroAssemblerCodeRef):
(JSC::MacroAssemblerCodeRef::createLLIntCodeRef):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::adjustPCIfAtCallSite):
(JSC::CodeBlock::bytecodeOffset):

  • bytecode/Opcode.h:

Remove the 'const' to simplify things and avoid having to do
additional casts and #ifdefs in many places.

  • bytecode/ResolveGlobalStatus.cpp:

(JSC::computeForLLInt):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::generate):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::initialize):

  • interpreter/Interpreter.h:

(Interpreter):

  • jit/JITExceptions.cpp:

(JSC::genericThrow):

  • llint/LLIntData.cpp:

(LLInt):
(JSC::LLInt::initialize):

  • llint/LLIntData.h:

(JSC):
(LLInt):
(Data):
(JSC::LLInt::exceptionInstructions):
(JSC::LLInt::opcodeMap):
(JSC::LLInt::getOpcode):
(JSC::LLInt::getCodePtr):
(JSC::LLInt::Data::performAssertions):

  • llint/LLIntExceptions.cpp:

(JSC::LLInt::returnToThrowForThrownException):
(JSC::LLInt::returnToThrow):
(JSC::LLInt::callToThrow):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::handleHostCall):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce): Initialize the singleton LLInt data.

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):

  • runtime/JSGlobalData.h:

(JSGlobalData): Removed the now unneeded LLInt::Data instance in

JSGlobalData.

  • runtime/JSValue.h:

(JSValue):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h

    r122768 r127068  
    2929#include "Disassembler.h"
    3030#include "ExecutableAllocator.h"
     31#include "LLIntData.h"
    3132#include <wtf/DataLog.h>
    3233#include <wtf/PassRefPtr.h>
     
    290291    }
    291292
    292     static MacroAssemblerCodePtr createLLIntCodePtr(void (*function)())
    293     {
    294         return createFromExecutableAddress(bitwise_cast<void*>(function));
    295     }
     293#if ENABLE(LLINT)
     294    static MacroAssemblerCodePtr createLLIntCodePtr(LLIntCode codeId)
     295    {
     296        return createFromExecutableAddress(LLInt::getCodePtr(codeId));
     297    }
     298#endif
     299
    296300    explicit MacroAssemblerCodePtr(ReturnAddressPtr ra)
    297301        : m_value(ra.value())
     
    354358    }
    355359   
     360#if ENABLE(LLINT)
    356361    // Helper for creating self-managed code refs from LLInt.
    357     static MacroAssemblerCodeRef createLLIntCodeRef(void (*function)())
    358     {
    359         return createSelfManagedCodeRef(MacroAssemblerCodePtr::createFromExecutableAddress(bitwise_cast<void*>(function)));
    360     }
    361    
     362    static MacroAssemblerCodeRef createLLIntCodeRef(LLIntCode codeId)
     363    {
     364        return createSelfManagedCodeRef(MacroAssemblerCodePtr::createFromExecutableAddress(LLInt::getCodePtr(codeId)));
     365    }
     366#endif
     367
    362368    ExecutableMemoryHandle* executableMemory() const
    363369    {
Note: See TracChangeset for help on using the changeset viewer.