Ignore:
Timestamp:
Dec 21, 2007, 1:54:51 PM (17 years ago)
Author:
Darin Adler
Message:

Reviewed by Eric.

1.022x as fast on SunSpider.

  • kjs/NodeInfo.h: Renamed SourceElementsStub to SourceElements, since that more accurately describes the role of this object, which is a reference-counted wrapper for a Vector.
  • kjs/Parser.cpp: (KJS::Parser::didFinishParsing): Changed parameter type to SourceElements, and use plain assignment instead of set.
  • kjs/Parser.h: Changed parameter type of didFinishParsing to a SourceElements. Also changed m_sourceElements; we now use a RefPtr instead of an OwnPtr as well.
  • kjs/grammar.y: Got rid of all the calls to release() on SourceElements. That's now handed inside the constructors for various node types, since we now use vector swapping instead.
  • kjs/nodes.cpp: (KJS::Node::rethrowException): Added NEVER_INLINE, because this was getting inlined and we want exception handling out of the normal code flow. (KJS::SourceElements::append): Moved here from the header. This now handles creating a BreakpointCheckStatement for each statement in the debugger case. That way we can get breakpoint handling without having it in every execute function. (KJS::BreakpointCheckStatement::BreakpointCheckStatement): Added. (KJS::BreakpointCheckStatement::execute): Added. Contains the code that was formerly in the StatementNode::hitStatement function and the KJS_BREAKPOINT macro. (KJS::BreakpointCheckStatement::streamTo): Added. (KJS::ArgumentListNode::evaluateList): Use KJS_CHECKEXCEPTIONVOID since the return type is void. (KJS::VarStatementNode::execute): Removed KJS_BREAKPOINT. (KJS::BlockNode::BlockNode): Changed parameter type to SourceElements. Changed code to use release since the class now contains a vector rather than a vector point. (KJS::BlockNode::optimizeVariableAccess): Updated since member is now a vector rather than a vector pointer. (KJS::BlockNode::execute): Ditto. (KJS::ExprStatementNode::execute): Removed KJS_BREAKPOINT. (KJS::IfNode::execute): Ditto. (KJS::IfElseNode::execute): Ditto. (KJS::DoWhileNode::execute): Ditto. (KJS::WhileNode::execute): Ditto. (KJS::ContinueNode::execute): Ditto. (KJS::BreakNode::execute): Ditto. (KJS::ReturnNode::execute): Ditto. (KJS::WithNode::execute): Ditto. (KJS::CaseClauseNode::optimizeVariableAccess): Updated since member is now a vector rather than a vector pointer. (KJS::CaseClauseNode::executeStatements): Ditto. (KJS::SwitchNode::execute): Removed KJS_BREAKPOINT. (KJS::ThrowNode::execute): Ditto. (KJS::TryNode::execute): Ditto. (KJS::ScopeNode::ScopeNode): Changed parameter type to SourceElements. (KJS::ProgramNode::ProgramNode): Ditto. (KJS::EvalNode::EvalNode): Ditto. (KJS::FunctionBodyNode::FunctionBodyNode): Ditto. (KJS::ScopeNode::optimizeVariableAccess): Updated since member is now a vector rather than a vector pointer.
  • kjs/nodes.h: Removed hitStatement. Renamed SourceElements to StatementVector. Renamed SourceElementsStub to SourceElements and made it derive from ParserRefCounted rather than from Node, hold a vector rather than a pointer to a vector, and changed the release function to swap with another vector rather than the pointer idiom. Updated BlockNode and CaseClauseNode to hold actual vectors instead of pointers to vectors. Added BreakpointCheckStatement.
  • kjs/nodes2string.cpp: (KJS::statementListStreamTo): Changed to work on a vector instead of a pointer to a vector. (KJS::BlockNode::streamTo): Ditto. (KJS::CaseClauseNode::streamTo): Ditto.
  • wtf/AlwaysInline.h: Added NEVER_INLINE.
  • wtf/PassRefPtr.h: Tweaked formatting. Added clear() function that matches the ones in OwnPtr and auto_ptr.
  • wtf/RefPtr.h: Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/PassRefPtr.h

    r27103 r28937  
    11// -*- mode: c++; c-basic-offset: 4 -*-
    22/*
    3  *  This file is part of the KDE libraries
    4  *  Copyright (C) 2005, 2006 Apple Computer, Inc.
     3 *  Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
    54 *
    65 *  This library is free software; you can redistribute it and/or
     
    3231    template <typename T> PassRefPtr<T> adoptRef(T*);
    3332
    34     template<typename T>
    35     class PassRefPtr
    36     {
     33    template<typename T> class PassRefPtr {
    3734    public:
    3835        PassRefPtr() : m_ptr(0) {}
     
    5249        T* get() const { return m_ptr; }
    5350
     51        void clear() { if (T* ptr = m_ptr) ptr->deref(); m_ptr = 0; }
    5452        T* releaseRef() const { T* tmp = m_ptr; m_ptr = 0; return tmp; }
    5553
Note: See TracChangeset for help on using the changeset viewer.