Changeset 10701 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Oct 3, 2005, 2:13:12 PM (20 years ago)
Author:
mjs
Message:

JavaScriptCore:

Reviewed by Darin.

<rdar://problem/4283967> REGRESSION: 3% regression on PLT from new FastMalloc
http://bugzilla.opendarwin.org/show_bug.cgi?id=5243

A number of optimizations to the new threadsafe malloc that make it actually as fast
as dlmalloc (I measured wrong before) and as memory-efficient as the system malloc.

  • use fastMalloc for everything - it now gets applied to all new/delete allocations via a private inline operator new that is now included into every file via config.h.
  • tweaked some of the numeric parameters for size classes and amount of wasted memory allowed per allocation - this saves on memory use and consequently improves speed.
  • so long as the allocator is not being used on background threads, get the per-thread cache from a global variable instead of from pthread_getspecific, since the latter is slow.
  • inline more functions, and force the ones GCC refuses to inline with attribute(always_inline), nearly all of these have one call site so inlining them has to be a win.
  • use some tricks to calculate allocation size more efficiently and fewer times for small allocations, to avoid hitting the huge size table array.
  • avoid hitting the per-thread cache on code paths that don't need it.
  • implement inline assembly version of spinlock for PowerPC (was already done for x86)
  • bindings/NP_jsobject.cpp:
  • bindings/c/c_class.cpp:
  • bindings/c/c_instance.cpp:
  • bindings/c/c_runtime.cpp:
  • bindings/c/c_utility.cpp:
  • bindings/jni/jni_class.cpp:
  • bindings/jni/jni_instance.cpp:
  • bindings/jni/jni_jsobject.cpp:
  • bindings/jni/jni_objc.mm:
  • bindings/jni/jni_runtime.cpp:
  • bindings/jni/jni_utility.cpp:
  • bindings/npruntime.cpp:
  • bindings/objc/WebScriptObject.mm:
  • bindings/objc/objc_class.mm:
  • bindings/objc/objc_instance.mm:
  • bindings/objc/objc_runtime.mm:
  • bindings/objc/objc_utility.mm:
  • bindings/runtime.cpp:
  • bindings/runtime_array.cpp:
  • bindings/runtime_method.cpp:
  • bindings/runtime_object.cpp:
  • bindings/runtime_root.cpp:
  • bindings/testbindings.cpp:
  • bindings/testbindings.mm:
  • kjs/array_object.cpp: (ArrayInstanceImp::ArrayInstanceImp): (ArrayInstanceImp::~ArrayInstanceImp): (ArrayInstanceImp::resizeStorage):
  • kjs/bool_object.cpp:
  • kjs/collector.cpp: (KJS::Collector::registerThread):
  • kjs/config.h:
  • kjs/debugger.cpp:
  • kjs/error_object.cpp:
  • kjs/function.cpp:
  • kjs/function_object.cpp:
  • kjs/identifier.cpp: (KJS::Identifier::rehash):
  • kjs/internal.cpp: (KJS::Parser::saveNewNode): (KJS::clearNewNodes):
  • kjs/interpreter.cpp:
  • kjs/lexer.cpp: (Lexer::doneParsing): (Lexer::makeIdentifier): (Lexer::makeUString):
  • kjs/list.cpp:
  • kjs/math_object.cpp:
  • kjs/nodes.cpp:
  • kjs/nodes.h:
  • kjs/nodes2string.cpp:
  • kjs/number_object.cpp: (integer_part_noexp): (char_sequence):
  • kjs/object.cpp:
  • kjs/object_object.cpp:
  • kjs/property_map.cpp:
  • kjs/property_slot.cpp:
  • kjs/protected_values.cpp: (KJS::ProtectedValues::rehash):
  • kjs/reference.cpp:
  • kjs/reference_list.cpp:
  • kjs/regexp.cpp:
  • kjs/regexp_object.cpp:
  • kjs/scope_chain.cpp:
  • kjs/scope_chain.h:
  • kjs/string_object.cpp:
  • kjs/testkjs.cpp:
  • kjs/ustring.h:
  • kjs/value.cpp:
  • kxmlcore/Assertions.mm:
  • kxmlcore/FastMalloc.cpp: (KXMLCore::InitSizeClasses): (KXMLCore::DLL_IsEmpty): (KXMLCore::DLL_Prepend): (KXMLCore::TCMalloc_Central_FreeList::Insert): (KXMLCore::TCMalloc_Central_FreeList::Remove): (KXMLCore::TCMalloc_Central_FreeList::Populate): (KXMLCore::TCMalloc_ThreadCache::Allocate): (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache): (KXMLCore::fastMallocRegisterThread): (KXMLCore::TCMalloc_ThreadCache::GetCache): (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent): (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary): (KXMLCore::do_malloc): (KXMLCore::do_free): (KXMLCore::realloc):
  • kxmlcore/FastMalloc.h: (operator new): (operator delete): (operator new[]): (operator delete[]):
  • kxmlcore/HashTable.cpp:
  • kxmlcore/TCSpinLock.h: (TCMalloc_SpinLock::Lock): (TCMalloc_SpinLock::Unlock): (TCMalloc_SlowLock):
  • kxmlcore/TCSystemAlloc.cpp:

WebCore:

Reviewed by Darin.

<rdar://problem/4283967> REGRESSION: 3% regression on PLT from new FastMalloc
http://bugzilla.opendarwin.org/show_bug.cgi?id=5243

  • use fastMalloc for everything - it now gets applied to all new/delete allocations via a private inline operator new that is now included into every file via config.h
  • WebCore.xcodeproj/project.pbxproj:
  • WebCorePrefix.h:
  • khtml/css/css_base.cpp:
  • khtml/css/css_base.h:
  • khtml/css/css_computedstyle.cpp:
  • khtml/css/css_ruleimpl.cpp:
  • khtml/css/css_stylesheetimpl.cpp:
  • khtml/css/css_valueimpl.cpp:
  • khtml/css/css_valueimpl.h:
  • khtml/css/csshelper.cpp:
  • khtml/css/cssparser.cpp: (ValueList::ValueList): (ValueList::~ValueList): (ValueList::addValue): (CSSParser::CSSParser): (CSSParser::~CSSParser): (CSSParser::setupParser): (CSSParser::addProperty):
  • khtml/css/cssstyleselector.cpp:
  • khtml/css/cssstyleselector.h:
  • khtml/dom/dom2_events.cpp:
  • khtml/dom/dom2_traversal.cpp:
  • khtml/dom/dom_misc.cpp:
  • khtml/dom/dom_string.cpp:
  • khtml/ecma/domparser.cpp:
  • khtml/ecma/kjs_binding.cpp:
  • khtml/ecma/kjs_css.cpp:
  • khtml/ecma/kjs_dom.cpp:
  • khtml/ecma/kjs_events.cpp:
  • khtml/ecma/kjs_html.cpp: (KJS::KJS::Context2DFunction::callAsFunction): (KJS::Gradient::~Gradient): (KJS::Gradient::addColorStop): (KJS::Gradient::colorStops):
  • khtml/ecma/kjs_navigator.cpp:
  • khtml/ecma/kjs_proxy.cpp:
  • khtml/ecma/kjs_range.cpp:
  • khtml/ecma/kjs_traversal.cpp:
  • khtml/ecma/kjs_views.cpp:
  • khtml/ecma/kjs_window.cpp:
  • khtml/ecma/xmlhttprequest.cpp:
  • khtml/ecma/xmlserializer.cpp:
  • khtml/editing/SelectionController.cpp:
  • khtml/editing/append_node_command.cpp:
  • khtml/editing/apply_style_command.cpp:
  • khtml/editing/break_blockquote_command.cpp:
  • khtml/editing/composite_edit_command.cpp:
  • khtml/editing/delete_from_text_node_command.cpp:
  • khtml/editing/delete_selection_command.cpp:
  • khtml/editing/edit_command.cpp:
  • khtml/editing/html_interchange.cpp:
  • khtml/editing/htmlediting.cpp:
  • khtml/editing/insert_into_text_node_command.cpp:
  • khtml/editing/insert_line_break_command.cpp:
  • khtml/editing/insert_node_before_command.cpp:
  • khtml/editing/insert_paragraph_separator_command.cpp:
  • khtml/editing/insert_text_command.cpp:
  • khtml/editing/join_text_nodes_command.cpp:
  • khtml/editing/jsediting.cpp:
  • khtml/editing/markup.cpp:
  • khtml/editing/merge_identical_elements_command.cpp:
  • khtml/editing/move_selection_command.cpp:
  • khtml/editing/rebalance_whitespace_command.cpp:
  • khtml/editing/remove_css_property_command.cpp:
  • khtml/editing/remove_node_attribute_command.cpp:
  • khtml/editing/remove_node_command.cpp:
  • khtml/editing/remove_node_preserving_children_command.cpp:
  • khtml/editing/replace_selection_command.cpp:
  • khtml/editing/set_node_attribute_command.cpp:
  • khtml/editing/split_element_command.cpp:
  • khtml/editing/split_text_node_command.cpp:
  • khtml/editing/split_text_node_containing_element.cpp:
  • khtml/editing/typing_command.cpp:
  • khtml/editing/visible_position.cpp:
  • khtml/editing/visible_range.cpp:
  • khtml/editing/visible_text.cpp: (khtml::CircularSearchBuffer::~CircularSearchBuffer): (khtml::CircularSearchBuffer::CircularSearchBuffer):
  • khtml/editing/visible_units.cpp:
  • khtml/editing/wrap_contents_in_dummy_span_command.cpp:
  • khtml/html/html_baseimpl.cpp:
  • khtml/html/html_blockimpl.cpp:
  • khtml/html/html_canvasimpl.cpp:
  • khtml/html/html_documentimpl.cpp:
  • khtml/html/html_elementimpl.cpp:
  • khtml/html/html_formimpl.cpp:
  • khtml/html/html_headimpl.cpp:
  • khtml/html/html_imageimpl.cpp:
  • khtml/html/html_inlineimpl.cpp:
  • khtml/html/html_listimpl.cpp:
  • khtml/html/html_miscimpl.cpp:
  • khtml/html/html_objectimpl.cpp:
  • khtml/html/html_tableimpl.cpp:
  • khtml/html/htmlfactory.cpp:
  • khtml/html/htmlnames.cpp:
  • khtml/html/htmlparser.cpp:
  • khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::enlargeBuffer): (khtml::HTMLTokenizer::enlargeScriptBuffer):
  • khtml/khtml_events.cpp:
  • khtml/khtml_part.cpp:
  • khtml/khtmlview.cpp:
  • khtml/misc/arena.cpp:
  • khtml/misc/arena.h:
  • khtml/misc/decoder.cpp:
  • khtml/misc/formdata.cpp:
  • khtml/misc/helper.cpp:
  • khtml/misc/loader.cpp:
  • khtml/misc/stringit.cpp:
  • khtml/rendering/bidi.cpp:
  • khtml/rendering/break_lines.cpp:
  • khtml/rendering/font.cpp:
  • khtml/rendering/render_arena.cpp:
  • khtml/rendering/render_block.cpp:
  • khtml/rendering/render_box.cpp:
  • khtml/rendering/render_br.cpp:
  • khtml/rendering/render_canvas.cpp:
  • khtml/rendering/render_canvasimage.cpp: (RenderCanvasImage::~RenderCanvasImage): (RenderCanvasImage::createDrawingContext):
  • khtml/rendering/render_container.cpp:
  • khtml/rendering/render_flexbox.cpp:
  • khtml/rendering/render_flow.cpp:
  • khtml/rendering/render_form.cpp:
  • khtml/rendering/render_frames.cpp:
  • khtml/rendering/render_image.cpp:
  • khtml/rendering/render_inline.cpp:
  • khtml/rendering/render_layer.cpp:
  • khtml/rendering/render_line.cpp:
  • khtml/rendering/render_list.cpp:
  • khtml/rendering/render_object.cpp:
  • khtml/rendering/render_replaced.cpp:
  • khtml/rendering/render_style.cpp:
  • khtml/rendering/render_style.h:
  • khtml/rendering/render_table.cpp:
  • khtml/rendering/render_text.cpp:
  • khtml/rendering/render_theme.cpp:
  • khtml/rendering/render_theme_mac.mm:
  • khtml/rendering/table_layout.cpp:
  • khtml/xbl/xbl_binding.cpp:
  • khtml/xbl/xbl_binding_manager.cpp:
  • khtml/xbl/xbl_docimpl.cpp:
  • khtml/xbl/xbl_protobinding.cpp:
  • khtml/xbl/xbl_protohandler.cpp:
  • khtml/xbl/xbl_protoimplementation.cpp:
  • khtml/xbl/xbl_tokenizer.cpp:
  • khtml/xml/EventNames.cpp:
  • khtml/xml/dom2_eventsimpl.cpp:
  • khtml/xml/dom2_eventsimpl.h:
  • khtml/xml/dom2_rangeimpl.cpp:
  • khtml/xml/dom2_rangeimpl.h:
  • khtml/xml/dom2_traversalimpl.cpp:
  • khtml/xml/dom2_traversalimpl.h:
  • khtml/xml/dom2_viewsimpl.cpp:
  • khtml/xml/dom2_viewsimpl.h:
  • khtml/xml/dom_atomicstring.cpp:
  • khtml/xml/dom_docimpl.cpp:
  • khtml/xml/dom_docimpl.h:
  • khtml/xml/dom_elementimpl.cpp:
  • khtml/xml/dom_elementimpl.h:
  • khtml/xml/dom_nodeimpl.cpp:
  • khtml/xml/dom_nodeimpl.h:
  • khtml/xml/dom_position.cpp:
  • khtml/xml/dom_qname.cpp:
  • khtml/xml/dom_stringimpl.cpp:
  • khtml/xml/dom_stringimpl.h:
  • khtml/xml/dom_textimpl.cpp:
  • khtml/xml/dom_xmlimpl.cpp:
  • khtml/xml/xml_tokenizer.cpp:
  • khtml/xsl/xsl_stylesheetimpl.cpp:
  • khtml/xsl/xslt_processorimpl.cpp:
  • kwq/DOM-CSS.mm:
  • kwq/DOM.mm:
  • kwq/DOMEvents.mm:
  • kwq/DOMHTML.mm:
  • kwq/DOMInternal.mm: (DOMString::DOMString):
  • kwq/DOMUtility.mm:
  • kwq/DOMViews.mm:
  • kwq/KWQAccObject.mm:
  • kwq/KWQAccObjectCache.mm:
  • kwq/KWQApplication.mm:
  • kwq/KWQArrayImpl.h:
  • kwq/KWQArrayImpl.mm:
  • kwq/KWQBuffer.mm:
  • kwq/KWQButton.mm:
  • kwq/KWQCString.mm:
  • kwq/KWQCharsets.mm:
  • kwq/KWQClipboard.mm:
  • kwq/KWQCollection.mm:
  • kwq/KWQColor.mm:
  • kwq/KWQComboBox.mm:
  • kwq/KWQCursor.mm:
  • kwq/KWQDateTime.mm:
  • kwq/KWQDictImpl.mm:
  • kwq/KWQEditCommand.mm:
  • kwq/KWQEvent.mm:
  • kwq/KWQExceptions.mm:
  • kwq/KWQFile.mm:
  • kwq/KWQFileButton.mm:
  • kwq/KWQFont.mm:
  • kwq/KWQFontFamily.h:
  • kwq/KWQFontFamily.mm:
  • kwq/KWQFontMetrics.mm:
  • kwq/KWQFormData.mm:
  • kwq/KWQFrame.mm:
  • kwq/KWQGlobal.mm:
  • kwq/KWQGuardedPtr.mm:
  • kwq/KWQKCharsets.mm:
  • kwq/KWQKConfigBase.mm:
  • kwq/KWQKCookieJar.mm:
  • kwq/KWQKCursor.mm:
  • kwq/KWQKGlobal.mm:
  • kwq/KWQKGlobalSettings.mm:
  • kwq/KWQKHTMLFactory.mm:
  • kwq/KWQKHTMLPart.cpp:
  • kwq/KWQKHTMLPart.mm:
  • kwq/KWQKHTMLPartBrowserExtension.mm:
  • kwq/KWQKHTMLView.mm:
  • kwq/KWQKHistoryProvider.mm:
  • kwq/KWQKJavaAppletWidget.mm:
  • kwq/KWQKJob.mm:
  • kwq/KWQKJobClasses.mm:
  • kwq/KWQKLocale.mm:
  • kwq/KWQKPartsBrowserInterface.mm:
  • kwq/KWQKPartsEvent.mm:
  • kwq/KWQKPartsPart.mm:
  • kwq/KWQKSSLKeyGen.mm:
  • kwq/KWQKStandardDirs.mm:
  • kwq/KWQKStringHandler.mm:
  • kwq/KWQKURL.mm: (KURL::KURL): (KURL::decode_string): (KURL::parse): (KURL::encode_string): (encodeRelativeString):
  • kwq/KWQKWin.mm:
  • kwq/KWQKWinModule.mm:
  • kwq/KWQLabel.mm:
  • kwq/KWQLineEdit.mm:
  • kwq/KWQListBox.mm:
  • kwq/KWQListImpl.mm:
  • kwq/KWQLoader.mm: (KWQIsResponseURLEqualToURL):
  • kwq/KWQMapImpl.h:
  • kwq/KWQMapImpl.mm:
  • kwq/KWQMovie.mm:
  • kwq/KWQObject.mm:
  • kwq/KWQPageState.mm:
  • kwq/KWQPaintDeviceMetrics.mm:
  • kwq/KWQPainter.mm:
  • kwq/KWQPalette.mm:
  • kwq/KWQPen.mm:
  • kwq/KWQPixmap.mm:
  • kwq/KWQPoint.mm:
  • kwq/KWQPointArray.mm:
  • kwq/KWQPtrDictImpl.mm:
  • kwq/KWQPushButton.mm:
  • kwq/KWQRect.mm:
  • kwq/KWQRegExp.mm:
  • kwq/KWQRegion.mm:
  • kwq/KWQRenderTreeDebug.cpp:
  • kwq/KWQResourceLoader.mm:
  • kwq/KWQScrollBar.mm:
  • kwq/KWQScrollView.mm:
  • kwq/KWQSignal.mm:
  • kwq/KWQSignalStubs.mm:
  • kwq/KWQSize.mm:
  • kwq/KWQSlider.mm:
  • kwq/KWQSlot.mm:
  • kwq/KWQString.h:
  • kwq/KWQString.mm: (ALLOC_CHAR): (REALLOC_CHAR): (DELETE_CHAR): (ALLOC_QCHAR): (REALLOC_QCHAR): (DELETE_QCHAR): (_printQStringAllocationStatistics): (allocateHandle): (KWQStringData::operator new): (KWQStringData::operator delete): (freeHandle):
  • kwq/KWQStringList.mm:
  • kwq/KWQStyle.mm:
  • kwq/KWQTextArea.mm:
  • kwq/KWQTextCodec.mm:
  • kwq/KWQTextEdit.mm:
  • kwq/KWQTextField.mm:
  • kwq/KWQTextStream.mm:
  • kwq/KWQTextUtilities.mm:
  • kwq/KWQTimer.mm:
  • kwq/KWQValueListImpl.h:
  • kwq/KWQValueListImpl.mm:
  • kwq/KWQVariant.mm:
  • kwq/KWQVectorImpl.mm: (KWQVectorImpl::KWQVectorImpl): (KWQVectorImpl::~KWQVectorImpl): (KWQVectorImpl::clear): (KWQVectorImpl::resize): (KWQVectorImpl::assign):
  • kwq/KWQWMatrix.mm:
  • kwq/KWQWidget.mm:
  • kwq/KWQWindowWidget.mm:
  • kwq/WebCoreBridge.mm:
  • kwq/WebCoreCache.mm:
  • kwq/WebCoreEncodings.mm:
  • kwq/WebCoreJavaScript.mm:
  • kwq/WebCoreScriptDebugger.mm:
  • kwq/WebCoreSettings.mm:
  • kwq/WebCoreTextRendererFactory.mm:
  • kwq/can-convert.mm:
Location:
trunk/JavaScriptCore/kjs
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/array_object.cpp

    r10207 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "array_object.h"
    2425
     
    5051  , storageLength(initialLength < sparseArrayCutoff ? initialLength : 0)
    5152  , capacity(storageLength)
    52   , storage(capacity ? (ValueImp **)calloc(capacity, sizeof(ValueImp *)) : 0)
     53  , storage(capacity ? (ValueImp **)fastCalloc(capacity, sizeof(ValueImp *)) : 0)
    5354{
    5455}
     
    5960  , storageLength(length)
    6061  , capacity(storageLength)
    61   , storage(capacity ? (ValueImp **)malloc(sizeof(ValueImp *) * capacity) : 0)
     62  , storage(capacity ? (ValueImp **)fastMalloc(sizeof(ValueImp *) * capacity) : 0)
    6263{
    6364  ListIterator it = list.begin();
     
    7071ArrayInstanceImp::~ArrayInstanceImp()
    7172{
    72   free(storage);
     73  fastFree(storage);
    7374}
    7475
     
    216217        }
    217218      }
    218       storage = (ValueImp **)realloc(storage, newCapacity * sizeof (ValueImp *));
     219      storage = (ValueImp **)fastRealloc(storage, newCapacity * sizeof (ValueImp *));
    219220      memset(storage + capacity, 0, sizeof(ValueImp *) * (newCapacity - capacity));
    220221      capacity = newCapacity;
  • trunk/JavaScriptCore/kjs/bool_object.cpp

    r10207 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "value.h"
    2425#include "object.h"
  • trunk/JavaScriptCore/kjs/collector.cpp

    r10641 r10701  
    2020 */
    2121
     22#include "config.h"
    2223#include "collector.h"
    2324
    2425#include <kxmlcore/FastMalloc.h>
     26#include <kxmlcore/FastMallocInternal.h>
    2527#include "internal.h"
    2628#include "list.h"
     
    225227  if (!pthread_getspecific(registeredThreadKey)) {
    226228    pthread_t pthread = pthread_self();
     229    KXMLCore::fastMallocRegisterThread(pthread);
    227230    Collector::Thread *thread = new Collector::Thread(pthread, pthread_mach_thread_np(pthread));
    228231    thread->next = registeredThreads;
  • trunk/JavaScriptCore/kjs/config.h

    r10634 r10701  
    3333
    3434#define KXC_CHANGES 1
     35
     36#ifdef __cplusplus
     37#undef new
     38#undef delete
     39#include <kxmlcore/FastMalloc.h>
     40#endif
  • trunk/JavaScriptCore/kjs/debugger.cpp

    r10084 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "debugger.h"
    2425#include "value.h"
  • trunk/JavaScriptCore/kjs/error_object.cpp

    r10178 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "value.h"
    2425#include "object.h"
  • trunk/JavaScriptCore/kjs/fpconst.cpp

    r4206 r10701  
    1818 */
    1919
    20 #include <config.h>
     20#include "config.h"
    2121
    2222// This file exists because JavaScriptCore needs to define the NaN and Inf globals in a way
  • trunk/JavaScriptCore/kjs/function.cpp

    r10634 r10701  
    2323 */
    2424
     25#include "config.h"
    2526#include "function.h"
    2627
  • trunk/JavaScriptCore/kjs/function_object.cpp

    r10634 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "function_object.h"
    2425#include "internal.h"
  • trunk/JavaScriptCore/kjs/identifier.cpp

    r10634 r10701  
    3434#endif
    3535
     36#include "config.h"
    3637#include "identifier.h"
    3738
     
    288289    _tableSize = newTableSize;
    289290    _tableSizeMask = newTableSize - 1;
    290     _table = (UString::Rep **)calloc(newTableSize, sizeof(UString::Rep *));
     291    _table = (UString::Rep **)fastCalloc(newTableSize, sizeof(UString::Rep *));
    291292
    292293    for (int i = 0; i != oldTableSize; ++i)
     
    294295            insert(key);
    295296
    296     free(oldTable);
     297    fastFree(oldTable);
    297298}
    298299
  • trunk/JavaScriptCore/kjs/internal.cpp

    r10653 r10701  
    2222 */
    2323
     24#include "config.h"
    2425#include <stdio.h>
    2526#include <math.h>
     
    368369  if (numNewNodes == newNodesCapacity) {
    369370    newNodesCapacity = (newNodesCapacity == 0) ? initialCapacity : newNodesCapacity * growthFactor;
    370     newNodes = (Node **)realloc(newNodes, sizeof(Node *) * newNodesCapacity);
     371    newNodes = (Node **)fastRealloc(newNodes, sizeof(Node *) * newNodesCapacity);
    371372  }
    372373
     
    380381      delete newNodes[i];
    381382  }
    382   delete newNodes;
     383  fastFree(newNodes);
    383384  newNodes = 0;
    384385  numNewNodes = 0;
  • trunk/JavaScriptCore/kjs/interpreter.cpp

    r10563 r10701  
    2323 */
    2424
     25#include "config.h"
    2526#include "value.h"
    2627#include "object.h"
  • trunk/JavaScriptCore/kjs/lexer.cpp

    r10588 r10701  
    835835    delete identifiers[i];
    836836  }
    837   free (identifiers);
     837  fastFree(identifiers);
    838838  identifiers = 0;
    839839  numIdentifiers = 0;
     
    843843    delete strings[i];
    844844  }
    845   free (strings);
     845  fastFree(strings);
    846846  strings = 0;
    847847  numStrings = 0;
     
    856856  if (numIdentifiers == identifiersCapacity) {
    857857    identifiersCapacity = (identifiersCapacity == 0) ? initialCapacity : identifiersCapacity *growthFactor;
    858     identifiers = (KJS::Identifier **)realloc(identifiers, sizeof(KJS::Identifier *) * identifiersCapacity);
     858    identifiers = (KJS::Identifier **)fastRealloc(identifiers, sizeof(KJS::Identifier *) * identifiersCapacity);
    859859  }
    860860
     
    868868  if (numStrings == stringsCapacity) {
    869869    stringsCapacity = (stringsCapacity == 0) ? initialCapacity : stringsCapacity *growthFactor;
    870     strings = (UString **)realloc(strings, sizeof(UString *) * stringsCapacity);
     870    strings = (UString **)fastRealloc(strings, sizeof(UString *) * stringsCapacity);
    871871  }
    872872
  • trunk/JavaScriptCore/kjs/list.cpp

    r10456 r10701  
    2020 */
    2121
     22#include "config.h"
    2223#include "list.h"
    2324
  • trunk/JavaScriptCore/kjs/lookup.cpp

    r9768 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include <stdio.h>
    2425#include <string.h>
     
    2728
    2829#ifdef HAVE_CONFIG_H
    29 #include <config.h>
    3030#endif
    3131
  • trunk/JavaScriptCore/kjs/math_object.cpp

    r10456 r10701  
    2020 */
    2121
     22#include "config.h"
    2223#include <math.h>
    2324#include <stdlib.h>
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r10646 r10701  
    2222 */
    2323
     24#include "config.h"
    2425#include "nodes.h"
    2526
  • trunk/JavaScriptCore/kjs/nodes.h

    r10646 r10701  
    2626#define _NODES_H_
    2727
    28 #include <kxmlcore/FastMalloc.h>
    2928#include <kxmlcore/SharedPtr.h>
    3029
     
    7271  };
    7372
    74   class Node : public FastAllocated {
     73  class Node {
    7574  public:
    7675    Node();
  • trunk/JavaScriptCore/kjs/nodes2string.cpp

    r10646 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "nodes.h"
    2425
  • trunk/JavaScriptCore/kjs/number_object.cpp

    r10456 r10701  
    2020 */
    2121
     22#include "config.h"
    2223#include "value.h"
    2324#include "object.h"
     
    9798       
    9899        if (length <= decimalPoint) {
    99             buf = (char*)malloc(decimalPoint+1);
     100            buf = (char*)fastMalloc(decimalPoint+1);
    100101            strcpy(buf,result);
    101102            memset(buf+length,'0',decimalPoint-length);
    102103        } else {
    103             buf = (char*)malloc(decimalPoint+1);
     104            buf = (char*)fastMalloc(decimalPoint+1);
    104105            strncpy(buf,result,decimalPoint);
    105106        }
     
    107108        buf[decimalPoint] = '\0';
    108109        str += UString(buf);
    109         free(buf);
     110        fastFree(buf);
    110111    }
    111112   
     
    117118static UString char_sequence(char c, int count)
    118119{
    119     char *buf = (char*)malloc(count+1);
     120    char *buf = (char*)fastMalloc(count+1);
    120121    memset(buf,c,count);
    121122    buf[count] = '\0';
    122123    UString s(buf);
    123     free(buf);
     124    fastFree(buf);
    124125    return s;
    125126}
  • trunk/JavaScriptCore/kjs/object.cpp

    r10207 r10701  
    2323 */
    2424
     25#include "config.h"
    2526#include "value.h"
    2627#include "object.h"
  • trunk/JavaScriptCore/kjs/object_object.cpp

    r10207 r10701  
    2020 */
    2121
     22#include "config.h"
    2223#include "value.h"
    2324#include "object.h"
  • trunk/JavaScriptCore/kjs/operations.cpp

    r10456 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "operations.h"
    2425
    25 #include "config.h"
    2626
    2727#include <stdio.h>
  • trunk/JavaScriptCore/kjs/property_map.cpp

    r10634 r10701  
    2020 */
    2121
     22#include "config.h"
    2223#include "property_map.h"
    2324
  • trunk/JavaScriptCore/kjs/property_slot.cpp

    r10084 r10701  
    2222
    2323
     24#include "config.h"
    2425#include "property_slot.h"
    2526
  • trunk/JavaScriptCore/kjs/protected_values.cpp

    r10563 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "protected_values.h"
    2425
     
    185186    _tableSize = newTableSize;
    186187    _tableSizeMask = newTableSize - 1;
    187     _table = (KeyValue *)calloc(newTableSize, sizeof(KeyValue));
     188    _table = (KeyValue *)fastCalloc(newTableSize, sizeof(KeyValue));
    188189
    189190    for (int i = 0; i != oldTableSize; ++i)
     
    191192            insert(oldTable[i].key, oldTable[i].value);
    192193
    193     free(oldTable);
     194    fastFree(oldTable);
    194195}
    195196
  • trunk/JavaScriptCore/kjs/reference.cpp

    r10621 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "reference.h"
     25
    2426#include "internal.h"
    2527
  • trunk/JavaScriptCore/kjs/reference_list.cpp

    r10563 r10701  
    2121 */
    2222
     23#include "config.h"
    2324#include "reference_list.h"
     25
    2426#include "protected_reference.h"
    2527
  • trunk/JavaScriptCore/kjs/regexp.cpp

    r10456 r10701  
    2020 */
    2121
     22#include "config.h"
    2223#include "regexp.h"
    2324
  • trunk/JavaScriptCore/kjs/regexp_object.cpp

    r10556 r10701  
    2121 */
    2222
     23#include "config.h"
     24#include "regexp_object.h"
     25
    2326#include <stdio.h>
    24 
    2527#include "value.h"
    2628#include "object.h"
     
    3032#include "internal.h"
    3133#include "regexp.h"
    32 #include "regexp_object.h"
    3334#include "error_object.h"
    3435
  • trunk/JavaScriptCore/kjs/scope_chain.cpp

    r9768 r10701  
    2020 */
    2121
     22#include "config.h"
    2223#include "scope_chain.h"
    2324
  • trunk/JavaScriptCore/kjs/scope_chain.h

    r10634 r10701  
    2323#define KJS_SCOPE_CHAIN_H
    2424
    25 #include <kxmlcore/FastMalloc.h>
    26 
    2725namespace KJS {
    2826
    2927    class ObjectImp;
    3028   
    31     class ScopeChainNode : public FastAllocated {
     29    class ScopeChainNode {
    3230    public:
    3331        ScopeChainNode(ScopeChainNode *n, ObjectImp *o)
  • trunk/JavaScriptCore/kjs/string_object.cpp

    r10634 r10701  
    2121 */
    2222
     23#include "config.h"
     24#include "string_object.h"
     25
    2326#include "value.h"
    2427#include "object.h"
     
    2831#include "regexp.h"
    2932#include "regexp_object.h"
    30 #include "string_object.h"
    3133#include "error_object.h"
    3234#include <stdio.h>
  • trunk/JavaScriptCore/kjs/testkjs.cpp

    r10563 r10701  
    2222 */
    2323
     24#include "config.h"
    2425#include <stdio.h>
    2526#include <stdlib.h>
  • trunk/JavaScriptCore/kjs/ustring.h

    r10634 r10701  
    194194   * @short Unicode string class
    195195   */
    196   class UString : public FastAllocated {
     196  class UString {
    197197    friend bool operator==(const UString&, const UString&);
    198198    friend class UCharReference;
     
    205205     */
    206206    struct Rep {
    207 
    208       FAST_ALLOCATED_POD;
    209207
    210208      static Rep *create(UChar *d, int l);
  • trunk/JavaScriptCore/kjs/value.cpp

    r10556 r10701  
    2222 */
    2323
     24#include "config.h"
    2425#include "value.h"
    2526
Note: See TracChangeset for help on using the changeset viewer.