Ignore:
Timestamp:
Mar 11, 2011, 7:12:05 PM (14 years ago)
Author:
[email protected]
Message:

2011-03-11 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Ensure all values are correctly tagged in the registerfile
https://bugs.webkit.org/show_bug.cgi?id=56214

This patch makes sure that all JSCell pointers written to
the registerfile are correctly tagged as JSCells, and replaces
raw int usage with the immediate representation.

For performance, register pressure, and general saneness reasons
I've added abstractions for reading and writing the tag
and payload of integer registers directly for the JSVALUE64
encoding.

  • interpreter/Register.h: (JSC::Register::withInt): (JSC::Register::withCallee): (JSC::Register::operator=): (JSC::Register::i): (JSC::Register::activation): (JSC::Register::function): (JSC::Register::propertyNameIterator): (JSC::Register::scopeChain):
  • jit/JIT.h:
  • jit/JITCall.cpp: (JSC::JIT::compileOpCallInitializeCallFrame): (JSC::JIT::compileOpCallVarargs): (JSC::JIT::compileOpCall):
  • jit/JITCall32_64.cpp: (JSC::JIT::compileOpCallInitializeCallFrame): (JSC::JIT::compileOpCallVarargs): (JSC::JIT::compileOpCall): (JSC::JIT::compileOpCallSlowCase):
  • jit/JITInlineMethods.h: (JSC::JIT::emitPutToCallFrameHeader): (JSC::JIT::emitPutCellToCallFrameHeader): (JSC::JIT::emitPutIntToCallFrameHeader):
  • jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTINativeCall): (JSC::JIT::emit_op_get_pnames): (JSC::JIT::emit_op_next_pname): (JSC::JIT::emit_op_load_varargs): (JSC::JIT::emitSlow_op_load_varargs):
  • jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTINativeCall): (JSC::JIT::emit_op_get_pnames): (JSC::JIT::emit_op_next_pname):
  • jit/JSInterfaceJIT.h: (JSC::JSInterfaceJIT::intPayloadFor): (JSC::JSInterfaceJIT::intTagFor):
  • jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::returnJSValue): (JSC::SpecializedThunkJIT::returnDouble): (JSC::SpecializedThunkJIT::returnInt32): (JSC::SpecializedThunkJIT::returnJSCell):

2011-03-11 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Ensure all values are correctly tagged in the registerfile
https://bugs.webkit.org/show_bug.cgi?id=56214

Make sure everything builds still.

  • bridge/c/c_class.cpp:
  • bridge/c/c_runtime.cpp:
  • bridge/jni/JavaMethod.cpp:
  • plugins/PluginViewNone.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSValue.h

    r80751 r80919  
    5353    enum PreferredPrimitiveType { NoPreference, PreferNumber, PreferString };
    5454
     55
    5556#if USE(JSVALUE32_64)
    5657    typedef int64_t EncodedJSValue;
     
    5859    typedef void* EncodedJSValue;
    5960#endif
     61   
     62    union EncodedValueDescriptor {
     63        EncodedJSValue asEncodedJSValue;
     64#if USE(JSVALUE32_64)
     65        double asDouble;
     66#elif USE(JSVALUE64)
     67        JSCell* ptr;
     68#endif
     69       
     70#if CPU(BIG_ENDIAN)
     71        struct {
     72            int32_t tag;
     73            int32_t payload;
     74        } asBits;
     75#else
     76        struct {
     77            int32_t payload;
     78            int32_t tag;
     79        } asBits;
     80#endif
     81    };
    6082
    6183    double nonInlineNaN();
     
    240262       
    241263        enum { LowestTag =  DeletedValueTag };
    242        
     264
    243265        uint32_t tag() const;
    244266        int32_t payload() const;
    245267
    246         union {
    247             EncodedJSValue asEncodedJSValue;
    248             double asDouble;
    249 #if CPU(BIG_ENDIAN)
    250             struct {
    251                 int32_t tag;
    252                 int32_t payload;
    253             } asBits;
    254 #else
    255             struct {
    256                 int32_t payload;
    257                 int32_t tag;
    258             } asBits;
    259 #endif
    260         } u;
    261 #else // USE(JSVALUE32_64)
     268        EncodedValueDescriptor u;
     269#elif USE(JSVALUE64)
    262270        JSCell* m_ptr;
    263 #endif // USE(JSVALUE32_64)
     271#endif
    264272    };
    265273
Note: See TracChangeset for help on using the changeset viewer.