Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: runtime/vm/class_table.h

Issue 10407071: Introduce remote objects in Debugger protocol (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/include/dart_debugger_api.h ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_CLASS_TABLE_H_ 5 #ifndef VM_CLASS_TABLE_H_
6 #define VM_CLASS_TABLE_H_ 6 #define VM_CLASS_TABLE_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 class Class; 13 class Class;
14 class ObjectPointerVisitor; 14 class ObjectPointerVisitor;
15 class RawClass; 15 class RawClass;
16 16
17 class ClassTable { 17 class ClassTable {
18 public: 18 public:
19 ClassTable(); 19 ClassTable();
20 ~ClassTable(); 20 ~ClassTable();
21 21
22 RawClass* At(intptr_t index) const { 22 RawClass* At(intptr_t index) const {
23 ASSERT(index > 0); 23 ASSERT(IsValidIndex(index));
24 ASSERT(index < top_);
25 return table_[index]; 24 return table_[index];
26 } 25 }
27 26
27 intptr_t IsValidIndex(intptr_t index) const {
28 return (index > 0) && (index < top_);
29 }
30
28 void Register(const Class& cls); 31 void Register(const Class& cls);
29 32
30 void VisitObjectPointers(ObjectPointerVisitor* visitor); 33 void VisitObjectPointers(ObjectPointerVisitor* visitor);
31 34
32 void Print(); 35 void Print();
33 36
34 private: 37 private:
35 static const int initial_capacity_ = 512; 38 static const int initial_capacity_ = 512;
36 static const int capacity_increment_ = 256; 39 static const int capacity_increment_ = 256;
37 40
38 intptr_t top_; 41 intptr_t top_;
39 intptr_t capacity_; 42 intptr_t capacity_;
40 43
41 RawClass** table_; 44 RawClass** table_;
42 45
43 DISALLOW_COPY_AND_ASSIGN(ClassTable); 46 DISALLOW_COPY_AND_ASSIGN(ClassTable);
44 }; 47 };
45 48
46 } // namespace dart 49 } // namespace dart
47 50
48 #endif // VM_CLASS_TABLE_H_ 51 #endif // VM_CLASS_TABLE_H_
OLDNEW
« no previous file with comments | « runtime/include/dart_debugger_api.h ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698