Files
sdk/runtime/vm/visitor.h
T
asiva@google.com 2d3775a1b1 Resubmit change 6302 after fixing the compiler warning on older GCC compiler versions:
Change 6302 description:
- Wire the stack frame iterator to use stack maps for traversing objects if
there are stack maps in the code object. If there are no stack maps it still
does the old style stack frame traversal between fp and sp looking for tagged
pointers.
- Added a mechanism to be able to iterate over the code space and look for a
particular object.
Review URL: https://chromiumcodereview.appspot.com//10030001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6331 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-09 18:20:23 +00:00

44 lines
1.1 KiB
C++

// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef VM_VISITOR_H_
#define VM_VISITOR_H_
#include "vm/globals.h"
namespace dart {
// Forward declarations.
class RawObject;
// An object pointer visitor interface.
class ObjectPointerVisitor {
public:
virtual ~ObjectPointerVisitor() {}
// Range of pointers to visit 'first' <= pointer <= 'last'.
virtual void VisitPointers(RawObject** first, RawObject** last) = 0;
// len argument is the number of pointers to visit starting from 'p'.
void VisitPointers(RawObject** p, intptr_t len) {
VisitPointers(p, (p + len - 1));
}
void VisitPointer(RawObject** p) { VisitPointers(p , p); }
};
// An object finder visitor interface.
class FindObjectVisitor {
public:
virtual ~FindObjectVisitor() {}
// Check if object matches find condition.
virtual bool FindObject(RawObject* obj) = 0;
};
} // namespace dart
#endif // VM_VISITOR_H_