Skip to content
Permalink
Browse files
2010-03-03 Oliver Hunt <oliver@apple.com>
        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  <oliver@apple.com>

        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  <oliver@apple.com>

        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):

Canonical link: https://commits.webkit.org/46861@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ojhunt committed Mar 5, 2010
1 parent a32bf12 commit fe458ccf8d85b71c34f1dd9cb342dfbd894eeba2
Showing 20 changed files with 612 additions and 81 deletions.
@@ -1,3 +1,77 @@
2010-03-03 Oliver Hunt <oliver@apple.com>

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-04 Shinichiro Hamaji <hamaji@chromium.org>

Unreviewed. Remove a non-ASCII character introduced in the following bug.
@@ -785,6 +785,26 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
printGetByIdOp(exec, location, it, "get_by_id_getter_chain");
break;
}
case op_get_by_id_custom_self: {
printGetByIdOp(exec, location, it, "get_by_id_custom_self");
break;
}
case op_get_by_id_custom_self_list: {
printGetByIdOp(exec, location, it, "get_by_id_custom_self_list");
break;
}
case op_get_by_id_custom_proto: {
printGetByIdOp(exec, location, it, "get_by_id_custom_proto");
break;
}
case op_get_by_id_custom_proto_list: {
printGetByIdOp(exec, location, it, "get_by_id_custom_proto_list");
break;
}
case op_get_by_id_custom_chain: {
printGetByIdOp(exec, location, it, "get_by_id_custom_chain");
break;
}
case op_get_by_id_generic: {
printGetByIdOp(exec, location, it, "get_by_id_generic");
break;
@@ -1375,7 +1395,7 @@ void CodeBlock::derefStructures(Instruction* vPC) const
{
Interpreter* interpreter = m_globalData->interpreter;

if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self)) {
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)) {
vPC[4].u.structure->deref();
return;
}
@@ -1422,7 +1442,7 @@ void CodeBlock::refStructures(Instruction* vPC) const
{
Interpreter* interpreter = m_globalData->interpreter;

if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self)) {
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)) {
vPC[4].u.structure->ref();
return;
}
@@ -31,6 +31,7 @@

#include "MacroAssembler.h"
#include "Opcode.h"
#include "PropertySlot.h"
#include "Structure.h"
#include <wtf/VectorTraits.h>

@@ -144,6 +145,7 @@ namespace JSC {
Instruction(StructureChain* structureChain) { u.structureChain = structureChain; }
Instruction(JSCell* jsCell) { u.jsCell = jsCell; }
Instruction(PolymorphicAccessStructureList* polymorphicStructures) { u.polymorphicStructures = polymorphicStructures; }
Instruction(PropertySlot::GetValueFunc getterFunc) { u.getterFunc = getterFunc; }

union {
Opcode opcode;
@@ -152,6 +154,7 @@ namespace JSC {
StructureChain* structureChain;
JSCell* jsCell;
PolymorphicAccessStructureList* polymorphicStructures;
PropertySlot::GetValueFunc getterFunc;
} u;
};

@@ -109,6 +109,11 @@ namespace JSC {
macro(op_get_by_id_getter_proto, 8) \
macro(op_get_by_id_getter_proto_list, 8) \
macro(op_get_by_id_getter_chain, 8) \
macro(op_get_by_id_custom_self, 8) \
macro(op_get_by_id_custom_self_list, 8) \
macro(op_get_by_id_custom_proto, 8) \
macro(op_get_by_id_custom_proto_list, 8) \
macro(op_get_by_id_custom_chain, 8) \
macro(op_get_by_id_generic, 8) \
macro(op_get_array_length, 8) \
macro(op_get_string_length, 8) \

0 comments on commit fe458cc

Please sign in to comment.