Ignore:
Timestamp:
Oct 9, 2009, 11:14:08 AM (16 years ago)
Author:
[email protected]
Message:

Migrated some code that didn't belong out of Structure.

Patch by Geoffrey Garen <[email protected]> on 2009-10-09
Reviewed by Sam Weinig.

SunSpider says maybe 1.03x faster.

  • runtime/JSCell.h: Nixed Structure::markAggregate, and made marking of

a Structure's prototype the direct responsility of the object using it.
(Giving Structure a mark function was misleading because it implied that
all live structures get marked during GC, when they don't.)

  • runtime/JSGlobalObject.cpp:

(JSC::markIfNeeded):
(JSC::JSGlobalObject::markChildren): Added code to mark prototypes stored
on the global object. Maybe this wasn't necessary, but now we don't have
to wonder.

  • runtime/JSObject.cpp:

(JSC::JSObject::getPropertyNames):
(JSC::JSObject::getOwnPropertyNames):
(JSC::JSObject::getEnumerableNamesFromClassInfoTable):

  • runtime/JSObject.h:

(JSC::JSObject::markChildrenDirect):

  • runtime/PropertyNameArray.h:
  • runtime/Structure.cpp:
  • runtime/Structure.h:

(JSC::Structure::setEnumerationCache):
(JSC::Structure::enumerationCache): Moved property name gathering code
from Structure to JSObject because having a Structure iterate its JSObject
was a layering violation. A JSObject is implemented using a Structure; not
the other way around.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalObject.cpp

    r49365 r49398  
    9090{
    9191    if (s)
    92         s->markAggregate(markStack);
     92        markIfNeeded(markStack, s->storedPrototype());
    9393}
    9494
     
    395395
    396396    markIfNeeded(markStack, d()->errorStructure);
     397    markIfNeeded(markStack, d()->argumentsStructure);
     398    markIfNeeded(markStack, d()->arrayStructure);
     399    markIfNeeded(markStack, d()->booleanObjectStructure);
     400    markIfNeeded(markStack, d()->callbackConstructorStructure);
     401    markIfNeeded(markStack, d()->callbackFunctionStructure);
     402    markIfNeeded(markStack, d()->callbackObjectStructure);
     403    markIfNeeded(markStack, d()->dateStructure);
     404    markIfNeeded(markStack, d()->emptyObjectStructure);
     405    markIfNeeded(markStack, d()->errorStructure);
     406    markIfNeeded(markStack, d()->functionStructure);
     407    markIfNeeded(markStack, d()->numberObjectStructure);
     408    markIfNeeded(markStack, d()->prototypeFunctionStructure);
     409    markIfNeeded(markStack, d()->regExpMatchesArrayStructure);
     410    markIfNeeded(markStack, d()->regExpStructure);
     411    markIfNeeded(markStack, d()->stringObjectStructure);
    397412
    398413    // No need to mark the other structures, because their prototypes are all
Note: See TracChangeset for help on using the changeset viewer.