Changeset 85226 in webkit


Ignore:
Timestamp:
Apr 28, 2011 12:29:11 PM (13 years ago)
Author:
oliver@apple.com
Message:

2011-04-28 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.

Only need a single implementation of testPrototype
https://bugs.webkit.org/show_bug.cgi?id=59724

Remove excess copy of identical testPrototype() code

  • jit/JITPropertyAccess.cpp: (JSC::JIT::testPrototype):
  • jit/JITPropertyAccess32_64.cpp:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r85224 r85226  
     12011-04-28  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        Only need a single implementation of testPrototype
     6        https://bugs.webkit.org/show_bug.cgi?id=59724
     7
     8        Remove excess copy of identical testPrototype() code
     9
     10        * jit/JITPropertyAccess.cpp:
     11        (JSC::JIT::testPrototype):
     12        * jit/JITPropertyAccess32_64.cpp:
     13
    1142011-04-28  Xan Lopez  <xlopez@igalia.com>
    215
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r84052 r85226  
    2727
    2828#if ENABLE(JIT)
    29 #if USE(JSVALUE64)
    3029#include "JIT.h"
    3130
     
    5049
    5150namespace JSC {
     51#if USE(JSVALUE64)
    5252
    5353JIT::CodePtr JIT::stringGetByValStubGenerator(JSGlobalData* globalData, ExecutablePool* pool)
     
    553553{
    554554    loadPtr(static_cast<void*>(&base->m_propertyStorage[cachedOffset]), result);
    555 }
    556 
    557 void JIT::testPrototype(JSValue prototype, JumpList& failureCases)
    558 {
    559     if (prototype.isNull())
    560         return;
    561 
    562     // We have a special case for X86_64 here because X86 instructions that take immediate values
    563     // only take 32 bit immediate values, wheras the pointer constants we are using here are 64 bit
    564     // values.  In the non X86_64 case, the generated code is slightly more efficient because it uses
    565     // two less instructions and doesn't require any scratch registers.
    566 #if CPU(X86_64)
    567     move(TrustedImmPtr(prototype.asCell()->structure()), regT3);
    568     failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), regT3));
    569 #else
    570     failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), TrustedImmPtr(prototype.asCell()->structure())));
    571 #endif
    572555}
    573556
     
    10491032#endif // !ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
    10501033
     1034#endif // USE(JSVALUE64)
     1035
     1036void JIT::testPrototype(JSValue prototype, JumpList& failureCases)
     1037{
     1038    if (prototype.isNull())
     1039        return;
     1040   
     1041    // We have a special case for X86_64 here because X86 instructions that take immediate values
     1042    // only take 32 bit immediate values, wheras the pointer constants we are using here are 64 bit
     1043    // values. In the non X86_64 case, the generated code is slightly more efficient because it uses
     1044    // two less instructions and doesn't require any scratch registers.
     1045#if CPU(X86_64)
     1046    move(TrustedImmPtr(prototype.asCell()->structure()), regT3);
     1047    failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), regT3));
     1048#else
     1049    failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), TrustedImmPtr(prototype.asCell()->structure())));
     1050#endif
     1051}
     1052
    10511053} // namespace JSC
    10521054
    1053 #endif // USE(JSVALUE64)
    10541055#endif // ENABLE(JIT)
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r84052 r85226  
    568568    load32(reinterpret_cast<char*>(&base->m_propertyStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload), resultPayload);
    569569    load32(reinterpret_cast<char*>(&base->m_propertyStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag), resultTag);
    570 }
    571 
    572 void JIT::testPrototype(JSValue prototype, JumpList& failureCases)
    573 {
    574     if (prototype.isNull())
    575         return;
    576    
    577     // We have a special case for X86_64 here because X86 instructions that take immediate values
    578     // only take 32 bit immediate values, wheras the pointer constants we are using here are 64 bit
    579     // values.  In the non X86_64 case, the generated code is slightly more efficient because it uses
    580     // two less instructions and doesn't require any scratch registers.
    581 #if CPU(X86_64)
    582     move(TrustedImmPtr(prototype.asCell()->structure()), regT3);
    583     failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), regT3));
    584 #else
    585     failureCases.append(branchPtr(NotEqual, AbsoluteAddress(prototype.asCell()->addressOfStructure()), TrustedImmPtr(prototype.asCell()->structure())));
    586 #endif
    587570}
    588571
Note: See TracChangeset for help on using the changeset viewer.