Ignore:
Timestamp:
Feb 2, 2008, 4:20:34 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

Reviewed by Geoff Garen.

PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
slower due to r28884 (global variable symbol table optimization)

Geoff's theory is that the slowdown was due to copying hash tables when
putting things into the back/forward cache. If that's true, then this
should fix the problem.


(According to Geoff's measurements, in a PLT that exaggerates the
importance of symbol table saving during cached page creation, this
patch is a ~3X speedup in cached page creation, and a 9% speedup overall.)

  • kjs/JSVariableObject.cpp: (KJS::JSVariableObject::saveLocalStorage): Updated for changes to SavedProperty, which has been revised to avoid initializing each SavedProperty twice when building the array. Store the property names too, so we don't have to store the symbol table separately. Do this by iterating the symbol table instead of the local storage vector. (KJS::JSVariableObject::restoreLocalStorage): Ditto. Restore the symbol table as well as the local storage vector.
  • kjs/JSVariableObject.h: Removed save/restoreSymbolTable and do that work inside save/restoreLocalStorage instead. Made restoreLocalStorage a non-const member function that takes a const reference to a SavedProperties object.
  • kjs/LocalStorage.h: Changed attributes to be unsigned instead of int to match other declarations of attributes elsewhere.
  • kjs/property_map.cpp: (KJS::SavedProperties::SavedProperties): Updated for data member name change. (KJS::PropertyMap::save): Updated for data member name change and to use the new inline init function instead of setting the fields directly. This allows us to skip initializing the SavedProperty objects when first allocating the array, and just do it when we're actually setting up the individual elements. (KJS::PropertyMap::restore): Updated for SavedProperty changes.
  • kjs/property_map.h: Changed SavedProperty from a struct to a class. Set it up so it does not get initialized at construction time to avoid initializing twice when creating an array of SavedProperty. Removed the m_ prefixes from the members of the SavedProperties struct. Generally we use m_ for class members and not struct.

WebCore:

Reviewed by Geoff Garen.

PLT speedup related to <rdar://problem/5659272> REGRESSION: PLT .4%
slower due to r28884 (global variable symbol table optimization)

  • history/CachedPage.cpp: (WebCore::CachedPage::CachedPage): Removed saveSymbolTable call. (WebCore::CachedPage::restore): Removed restoreSymbolTable call. (WebCore::CachedPage::clear): Removed clear of m_windowSymbolTable.
  • history/CachedPage.h: Removed m_windowSymbolTable, since save/restoreLocalStorage now takes care of the symbol table. Also removed many unnecessary includes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSVariableObject.h

    r29818 r29943  
    11/*
    2  * Copyright (C) 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4141        LocalStorage& localStorage() { return d->localStorage; }
    4242       
    43         void saveSymbolTable(SymbolTable& s) const;
    44         void restoreSymbolTable(SymbolTable& s) const;
    45 
    46         void saveLocalStorage(SavedProperties& s) const;
    47         void restoreLocalStorage(SavedProperties& s) const;
     43        void saveLocalStorage(SavedProperties&) const;
     44        void restoreLocalStorage(const SavedProperties&);
    4845       
    4946        virtual bool deleteProperty(ExecState*, const Identifier&);
     
    5855        struct JSVariableObjectData {
    5956            JSVariableObjectData() { }
    60 
    6157            JSVariableObjectData(SymbolTable* s)
    6258                : symbolTable(s) // Subclass owns this pointer.
     
    6662            LocalStorage localStorage; // Storage for variables in the symbol table.
    6763            SymbolTable* symbolTable; // Maps name -> index in localStorage.
    68 
    6964        };
    7065
     
    107102            return true;
    108103        }
    109 
    110104        return false;
    111105    }
Note: See TracChangeset for help on using the changeset viewer.