Changeset 27206 in webkit for trunk/JavaScriptCore/kjs/nodes.h


Ignore:
Timestamp:
Oct 28, 2007, 9:11:37 PM (18 years ago)
Author:
darin
Message:

Reviewed by Maciej.

  • fix a storage leak where we ref the UString every time we replace a ResolveNode with a LocalVarAccessNode
  • kjs/identifier.h: (KJS::Identifier::Identifier): Added a constructor that takes PlacementNewAdopt.
  • kjs/nodes.h: (KJS::ResolveNode::ResolveNode): Initialize the ident with PlacementNewAdopt instead of the old value of ident.
  • kjs/ustring.h: (KJS::UString::UString): Added a constructor that takes PlacementNewAdopt.
File:
1 edited

Legend:

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

    r27204 r27206  
    9090    };
    9191 
    92     // Specifies that a Node should adopt the memory layout it was initialized into.
    93     // We use this to swap a pre-existing base class node with a more optimized
    94     // subclass node.
    95     enum PlacementNewAdoptTag { PlacementNewAdopt };
    96 
    9792  struct DeclarationStacks {
    9893      typedef Vector<Node*, 16> NodeStack;
     
    117112  public:
    118113    Node() KJS_FAST_CALL;
    119     Node(PlacementNewAdoptTag) KJS_FAST_CALL { }
     114    Node(PlacementNewAdoptType) KJS_FAST_CALL { }
    120115    virtual ~Node();
    121116
     
    274269    }
    275270
    276     ResolveNode(PlacementNewAdoptTag) KJS_FAST_CALL
     271    // Special constructor for cases where we overwrite an object in place.
     272    ResolveNode(PlacementNewAdoptType) KJS_FAST_CALL
    277273        : Node(PlacementNewAdopt)
    278         , ident(ident)
     274        , ident(PlacementNewAdopt)
    279275    {
    280276    }
     
    297293  class LocalVarAccessNode : public ResolveNode {
    298294  public:
     295    // Overwrites a ResolveNode in place.
    299296    LocalVarAccessNode(size_t i)
    300297        : ResolveNode(PlacementNewAdopt)
Note: See TracChangeset for help on using the changeset viewer.