Ignore:
Timestamp:
May 27, 2011, 4:53:36 PM (14 years ago)
Author:
[email protected]
Message:

2011-05-27 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Property caching is too aggressive for API objects
https://bugs.webkit.org/show_bug.cgi?id=61677

  • API/JSCallbackObject.h: Opt in to ProhibitsPropertyCaching, since our callback APIs allow the client to change its mind about our propertis at any time.
  • API/tests/testapi.c: (PropertyCatchalls_getProperty): (PropertyCatchalls_setProperty): (PropertyCatchalls_getPropertyNames): (PropertyCatchalls_class): (main):
  • API/tests/testapi.js: Some tests for dynamic API objects.
  • interpreter/Interpreter.cpp: (JSC::Interpreter::tryCachePutByID): (JSC::Interpreter::tryCacheGetByID):
  • jit/JITStubs.cpp: (JSC::JITThunks::tryCachePutByID): (JSC::JITThunks::tryCacheGetByID): (JSC::DEFINE_STUB_FUNCTION): Opt out of property caching if the client requires it.
  • runtime/JSTypeInfo.h: (JSC::TypeInfo::TypeInfo): (JSC::TypeInfo::isFinal): (JSC::TypeInfo::prohibitsPropertyCaching): (JSC::TypeInfo::flags): Added a flag to track opting out of property caching. Fixed an "&&" vs "&" typo that was previously harmless, but is now harmful since m_flags2 can have more than one bit set.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r86960 r87586  
    12401240    Structure* structure = baseCell->structure();
    12411241
    1242     if (structure->isUncacheableDictionary()) {
     1242    if (structure->isUncacheableDictionary() || structure->typeInfo().prohibitsPropertyCaching()) {
    12431243        vPC[0] = getOpcode(op_put_by_id_generic);
    12441244        return;
     
    13281328    Structure* structure = baseValue.asCell()->structure();
    13291329
    1330     if (structure->isUncacheableDictionary()) {
     1330    if (structure->isUncacheableDictionary() || structure->typeInfo().prohibitsPropertyCaching()) {
    13311331        vPC[0] = getOpcode(op_get_by_id_generic);
    13321332        return;
Note: See TracChangeset for help on using the changeset viewer.