Main Page   Class Hierarchy   Compound List   File List   Header Files   Compound Members   File Members  

deps.h

This is the verbatim text of the deps.h include file.
/* Sun-$Revision: 23.5 $ */

/* Copyright 1992-9 Sun Microsystems, Inc. and Stanford University.
   See the LICENSE file for license information. */

# pragma interface


const int32 DependentsArraySize = 10000;

class dependencyList: public ResourceObj {
private:
  static nmln* dependentsArrayS;
  nmln* top;
  
public:
  dependencyList() {
    if (dependentsArrayS == NULL)
      dependentsArrayS = (nmln*)
        AllocateHeap(DependentsArraySize * sizeof(nmln), "dependents buffer");
    top = dependentsArrayS; }
  
# ifdef GENERATE_ASSERTIONS
public:
  bool includes(nmln* dep);
# endif
  
private:
  bool isInDependentsArray(nmln* dep) {
    return dep >= dependentsArrayS && dep < top; }

public:
  bool alreadyThere(nmln* dep) {
    bool b = (isInDependentsArray(dep->next) || isInDependentsArray(dep->prev));
    // if it's already there, it'll be adjacent to the current nmln
    // uncommented assert below because it's slow  -Urs 9/92
    // assert(b == includes(dep), "auugh!");
    return b; }

  nmln *start() { return dependentsArrayS; }
  nmln *end() { return top; }

  void add(nmln* dep);
  void add(slotsMapDeps *m, slotDesc* s) {
    add(m->dependents_for_slot(s)); }
  void add(Map* m) {
    if (m->can_have_dependents()) {
      add(((slotsMapDeps*) m)->add_slot_dependents());
    }
  }
  
  void remove();
  
  int32 length() { return this ? top - dependentsArrayS : 0; }
  
  bool isEmpty() { return length() == 0; }
  bool nonEmpty() { return ! isEmpty(); }
};


const int32 AssignableDependentsArraySize = 100;

struct assignableDependencyList: ResourceObj {
  static objectLookupTarget** dependentsArrayS;
  objectLookupTarget** top;
  
  assignableDependencyList() {
    if (dependentsArrayS == NULL)
      dependentsArrayS = (objectLookupTarget**)
        AllocateHeap(AssignableDependentsArraySize *
                     sizeof(objectLookupTarget*),
                     "assignable dependents buffer");
    top = dependentsArrayS; }
  
  objectLookupTarget** start() { return dependentsArrayS; }
  void add(objectLookupTarget* target);
  
  void remove() {}
  
  int32 length() { return this ? top - dependentsArrayS : 0; }
  
  bool isEmpty() { return length() == 0; }
  bool nonEmpty() { return ! isEmpty(); }
};

Generated at Tue Jun 27 12:12:35 2000 for SelfVM by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999