Changeset 88962 in webkit


Ignore:
Timestamp:
Jun 15, 2011 11:27:10 AM (13 years ago)
Author:
oliver@apple.com
Message:

2011-06-15 Oliver Hunt <oliver@apple.com>

Reviewed by Sam Weinig.

Reduce the size of global_resolve
https://bugs.webkit.org/show_bug.cgi?id=62738

Reduce the code size of global_resolve in the JIT by replacing
multiple pointer loads with a single pointer move + two offset
loads.

  • jit/JITOpcodes.cpp: (JSC::JIT::emit_op_resolve_global):
  • jit/JITOpcodes32_64.cpp: (JSC::JIT::emit_op_resolve_global):
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r88911 r88962  
     12011-06-15  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Reduce the size of global_resolve
     6        https://bugs.webkit.org/show_bug.cgi?id=62738
     7
     8        Reduce the code size of global_resolve in the JIT by replacing
     9        multiple pointer loads with a single pointer move + two offset
     10        loads.
     11
     12        * jit/JITOpcodes.cpp:
     13        (JSC::JIT::emit_op_resolve_global):
     14        * jit/JITOpcodes32_64.cpp:
     15        (JSC::JIT::emit_op_resolve_global):
     16
    1172011-06-14  Geoffrey Garen  <ggaren@apple.com>
    218
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r88873 r88962  
    639639    void* globalObject = m_codeBlock->globalObject();
    640640    unsigned currentIndex = m_globalResolveInfoIndex++;
    641     void* structureAddress = &(m_codeBlock->globalResolveInfo(currentIndex).structure);
    642     void* offsetAddr = &(m_codeBlock->globalResolveInfo(currentIndex).offset);
     641    GlobalResolveInfo* resolveInfoAddress = &(m_codeBlock->globalResolveInfo(currentIndex));
    643642
    644643    // Check Structure of global object
    645644    move(TrustedImmPtr(globalObject), regT0);
    646     loadPtr(structureAddress, regT1);
     645    move(TrustedImmPtr(resolveInfoAddress), regT2);
     646    loadPtr(Address(regT2, OBJECT_OFFSETOF(GlobalResolveInfo, structure)), regT1);
    647647    addSlowCase(branchPtr(NotEqual, regT1, Address(regT0, JSCell::structureOffset()))); // Structures don't match
    648648
     
    650650    // Assume that the global object always uses external storage.
    651651    loadPtr(Address(regT0, OBJECT_OFFSETOF(JSGlobalObject, m_propertyStorage)), regT0);
    652     load32(offsetAddr, regT1);
     652    load32(Address(regT2, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), regT1);
    653653    loadPtr(BaseIndex(regT0, regT1, ScalePtr), regT0);
    654654    emitPutVirtualRegister(currentInstruction[1].u.operand);
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r88873 r88962  
    807807
    808808    unsigned currentIndex = m_globalResolveInfoIndex++;
    809     void* structureAddress = &(m_codeBlock->globalResolveInfo(currentIndex).structure);
    810     void* offsetAddr = &(m_codeBlock->globalResolveInfo(currentIndex).offset);
     809    GlobalResolveInfo* resolveInfoAddress = &m_codeBlock->globalResolveInfo(currentIndex);
     810
    811811
    812812    // Verify structure.
    813813    move(TrustedImmPtr(globalObject), regT0);
    814     loadPtr(structureAddress, regT1);
     814    move(TrustedImmPtr(resolveInfoAddress), regT3);
     815    loadPtr(Address(regT3, OBJECT_OFFSETOF(GlobalResolveInfo, structure)), regT1);
    815816    addSlowCase(branchPtr(NotEqual, regT1, Address(regT0, JSCell::structureOffset())));
    816817
    817818    // Load property.
    818819    loadPtr(Address(regT0, OBJECT_OFFSETOF(JSGlobalObject, m_propertyStorage)), regT2);
    819     load32(offsetAddr, regT3);
     820    load32(Address(regT3, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), regT3);
    820821    load32(BaseIndex(regT2, regT3, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); // payload
    821822    load32(BaseIndex(regT2, regT3, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); // tag
Note: See TracChangeset for help on using the changeset viewer.