Changeset 55564 in webkit for trunk/JavaScriptCore/bytecode


Ignore:
Timestamp:
Mar 4, 2010, 5:33:54 PM (15 years ago)
Author:
[email protected]
Message:

2010-03-03 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Allow static property getters to interact with JSCs caching
https://bugs.webkit.org/show_bug.cgi?id=35716

Add new opcodes for handling cached lookup of static value getters.
More or less the same as with JS getters, all that changes is that
instead of calling through a JSFunction we always know that we have
a C function to call.

For the patching routines in the JIT we now need to pass a few
new parameters to allow us to pass enough information to the stub
function to allow us to call the C function correctly. Logically
this shouldn't actually be necessary as all of these functions ignore
the identifier, but removing the ident parameter would require
somewhat involved changes to the way we implement getOwnPropertySlot,
etc.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::derefStructures): (JSC::CodeBlock::refStructures):
  • bytecode/Instruction.h: (JSC::Instruction::Instruction): (JSC::Instruction::):
  • bytecode/Opcode.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::tryCacheGetByID): (JSC::Interpreter::privateExecute):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass):
  • jit/JIT.h: (JSC::JIT::compileGetByIdProto): (JSC::JIT::compileGetByIdSelfList): (JSC::JIT::compileGetByIdProtoList): (JSC::JIT::compileGetByIdChainList): (JSC::JIT::compileGetByIdChain):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain):
  • jit/JITPropertyAccess32_64.cpp: (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain):
  • jit/JITStubs.cpp: (JSC::JITThunks::tryCacheGetByID): (JSC::DEFINE_STUB_FUNCTION):
  • jit/JITStubs.h: (JSC::):
  • runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot):
  • runtime/Lookup.h: (JSC::getStaticPropertySlot): (JSC::getStaticValueSlot):
  • runtime/PropertySlot.h: (JSC::PropertySlot::): (JSC::PropertySlot::PropertySlot): (JSC::PropertySlot::cachedPropertyType): (JSC::PropertySlot::isCacheable): (JSC::PropertySlot::isCacheableValue): (JSC::PropertySlot::setValueSlot): (JSC::PropertySlot::setCacheableCustom): (JSC::PropertySlot::setGetterSlot): (JSC::PropertySlot::setCacheableGetterSlot): (JSC::PropertySlot::clearOffset): (JSC::PropertySlot::customGetter):

2010-03-03 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Allow static property getters to interact with JSCs caching
https://bugs.webkit.org/show_bug.cgi?id=35716

Add tests to ensure nothing horrifying happens to static property
getters if they're in a path where we end up caching lookups.

  • fast/js/pic/cached-named-property-getter-expected.txt: Added.
  • fast/js/pic/cached-named-property-getter.html: Added.

2010-03-03 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Allow static property getters to interact with JSCs caching
https://bugs.webkit.org/show_bug.cgi?id=35716

Update the obviously safe getters to allow caching

Test: fast/js/pic/cached-named-property-getter.html

  • bridge/runtime_array.cpp: (JSC::RuntimeArray::getOwnPropertySlot):
  • bridge/runtime_method.cpp: (JSC::RuntimeMethod::getOwnPropertySlot):
Location:
trunk/JavaScriptCore/bytecode
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/CodeBlock.cpp

    r55002 r55564  
    786786            break;
    787787        }
     788        case op_get_by_id_custom_self: {
     789            printGetByIdOp(exec, location, it, "get_by_id_custom_self");
     790            break;
     791        }
     792        case op_get_by_id_custom_self_list: {
     793            printGetByIdOp(exec, location, it, "get_by_id_custom_self_list");
     794            break;
     795        }
     796        case op_get_by_id_custom_proto: {
     797            printGetByIdOp(exec, location, it, "get_by_id_custom_proto");
     798            break;
     799        }
     800        case op_get_by_id_custom_proto_list: {
     801            printGetByIdOp(exec, location, it, "get_by_id_custom_proto_list");
     802            break;
     803        }
     804        case op_get_by_id_custom_chain: {
     805            printGetByIdOp(exec, location, it, "get_by_id_custom_chain");
     806            break;
     807        }
    788808        case op_get_by_id_generic: {
    789809            printGetByIdOp(exec, location, it, "get_by_id_generic");
     
    13761396    Interpreter* interpreter = m_globalData->interpreter;
    13771397
    1378     if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self)) {
     1398    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) {
    13791399        vPC[4].u.structure->deref();
    13801400        return;
     
    14231443    Interpreter* interpreter = m_globalData->interpreter;
    14241444
    1425     if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self)) {
     1445    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) {
    14261446        vPC[4].u.structure->ref();
    14271447        return;
  • trunk/JavaScriptCore/bytecode/Instruction.h

    r46854 r55564  
    3232#include "MacroAssembler.h"
    3333#include "Opcode.h"
     34#include "PropertySlot.h"
    3435#include "Structure.h"
    3536#include <wtf/VectorTraits.h>
     
    145146        Instruction(JSCell* jsCell) { u.jsCell = jsCell; }
    146147        Instruction(PolymorphicAccessStructureList* polymorphicStructures) { u.polymorphicStructures = polymorphicStructures; }
     148        Instruction(PropertySlot::GetValueFunc getterFunc) { u.getterFunc = getterFunc; }
    147149
    148150        union {
     
    153155            JSCell* jsCell;
    154156            PolymorphicAccessStructureList* polymorphicStructures;
     157            PropertySlot::GetValueFunc getterFunc;
    155158        } u;
    156159    };
  • trunk/JavaScriptCore/bytecode/Opcode.h

    r55002 r55564  
    110110        macro(op_get_by_id_getter_proto_list, 8) \
    111111        macro(op_get_by_id_getter_chain, 8) \
     112        macro(op_get_by_id_custom_self, 8) \
     113        macro(op_get_by_id_custom_self_list, 8) \
     114        macro(op_get_by_id_custom_proto, 8) \
     115        macro(op_get_by_id_custom_proto_list, 8) \
     116        macro(op_get_by_id_custom_chain, 8) \
    112117        macro(op_get_by_id_generic, 8) \
    113118        macro(op_get_array_length, 8) \
Note: See TracChangeset for help on using the changeset viewer.