a59c00c448
Review URL: https://chromiumcodereview.appspot.com//10311006 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7235 260f80e4-7a28-3924-810f-c04153c831b5
49 lines
958 B
C++
49 lines
958 B
C++
// Copyright (c) 2012, 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_CLASS_TABLE_H_
|
|
#define VM_CLASS_TABLE_H_
|
|
|
|
#include "platform/assert.h"
|
|
#include "platform/globals.h"
|
|
|
|
namespace dart {
|
|
|
|
class Class;
|
|
class ObjectPointerVisitor;
|
|
class RawClass;
|
|
|
|
class ClassTable {
|
|
public:
|
|
ClassTable();
|
|
~ClassTable();
|
|
|
|
RawClass* At(intptr_t index) const {
|
|
ASSERT(index > 0);
|
|
ASSERT(index < top_);
|
|
return table_[index];
|
|
}
|
|
|
|
void Register(const Class& cls);
|
|
|
|
void VisitObjectPointers(ObjectPointerVisitor* visitor);
|
|
|
|
void Print();
|
|
|
|
private:
|
|
static const int initial_capacity_ = 512;
|
|
static const int capacity_increment_ = 256;
|
|
|
|
intptr_t top_;
|
|
intptr_t capacity_;
|
|
|
|
RawClass** table_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(ClassTable);
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // VM_CLASS_TABLE_H_
|