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

Side by Side Diff: vm/object.h

Issue 10807078: Address review comments from a previous CL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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
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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 OBJECT_IMPLEMENTATION(object, super); \ 135 OBJECT_IMPLEMENTATION(object, super); \
136 Raw##object* raw_ptr() const { \ 136 Raw##object* raw_ptr() const { \
137 ASSERT(raw() != null()); \ 137 ASSERT(raw() != null()); \
138 return raw()->ptr(); \ 138 return raw()->ptr(); \
139 } \ 139 } \
140 SNAPSHOT_READER_SUPPORT(object) \ 140 SNAPSHOT_READER_SUPPORT(object) \
141 friend class StackFrame; \ 141 friend class StackFrame; \
142 142
143 class Object { 143 class Object {
144 public: 144 public:
145 // Index for Singleton internal VM classes, 145 // Index for Singleton internal objects,
146 // this index is used in snapshots to refer to these classes directly. 146 // this index is used in snapshots to refer to these objects directly.
147 enum { 147 enum {
148 kNullObject = 0, 148 kNullObject = kNumPredefinedKinds,
149 kSentinelObject, 149 kSentinelObject,
150 kClassClass,
151 kNullClass,
152 kDynamicClass,
153 kVoidClass,
154 kUnresolvedClassClass,
155 kTypeClass,
156 kTypeParameterClass,
157 kTypeArgumentsClass,
158 kInstantiatedTypeArgumentsClass,
159 kFunctionClass,
160 kFieldClass,
161 kLiteralTokenClass,
162 kTokenStreamClass,
163 kScriptClass,
164 kLibraryClass,
165 kLibraryPrefixClass,
166 kCodeClass,
167 kInstructionsClass,
168 kPcDescriptorsClass,
169 kStackmapClass,
170 kLocalVarDescriptorsClass,
171 kExceptionHandlersClass,
172 kContextClass,
173 kContextScopeClass,
174 kICDataClass,
175 kSubtypeTestCacheClass,
176 kApiErrorClass,
177 kLanguageErrorClass,
178 kUnhandledExceptionClass,
179 kUnwindErrorClass,
180 kMaxId, 150 kMaxId,
181 kInvalidIndex = -1, 151 kInvalidIndex = -1,
182 }; 152 };
183 153
184 virtual ~Object() { } 154 virtual ~Object() { }
185 155
186 RawObject* raw() const { return raw_; } 156 RawObject* raw() const { return raw_; }
187 void operator=(RawObject* value) { SetRaw(value); } 157 void operator=(RawObject* value) { SetRaw(value); }
188 158
189 void set_tags(intptr_t value) const { 159 void set_tags(intptr_t value) const {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 static RawClass* context_scope_class() { return context_scope_class_; } 282 static RawClass* context_scope_class() { return context_scope_class_; }
313 static RawClass* api_error_class() { return api_error_class_; } 283 static RawClass* api_error_class() { return api_error_class_; }
314 static RawClass* language_error_class() { return language_error_class_; } 284 static RawClass* language_error_class() { return language_error_class_; }
315 static RawClass* unhandled_exception_class() { 285 static RawClass* unhandled_exception_class() {
316 return unhandled_exception_class_; 286 return unhandled_exception_class_;
317 } 287 }
318 static RawClass* unwind_error_class() { return unwind_error_class_; } 288 static RawClass* unwind_error_class() { return unwind_error_class_; }
319 static RawClass* icdata_class() { return icdata_class_; } 289 static RawClass* icdata_class() { return icdata_class_; }
320 static RawClass* subtypetestcache_class() { return subtypetestcache_class_; } 290 static RawClass* subtypetestcache_class() { return subtypetestcache_class_; }
321 291
322 static int GetSingletonClassIndex(const RawClass* raw_class); 292 static int GetSingletonClassIndex(const RawObject* raw_object);
323 static RawClass* GetSingletonClass(int index);
324 static const char* GetSingletonClassName(int index); 293 static const char* GetSingletonClassName(int index);
325 294
326 static RawClass* CreateAndRegisterInterface(const char* cname, 295 static RawClass* CreateAndRegisterInterface(const char* cname,
327 const Script& script, 296 const Script& script,
328 const Library& lib); 297 const Library& lib);
329 static void RegisterClass(const Class& cls, 298 static void RegisterClass(const Class& cls,
330 const char* cname, 299 const char* cname,
331 const Script& script, 300 const Script& script,
332 const Library& lib); 301 const Library& lib);
333 302
(...skipping 4876 matching lines...) Expand 10 before | Expand all | Expand 10 after
5210 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5179 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5211 return false; 5180 return false;
5212 } 5181 }
5213 } 5182 }
5214 return true; 5183 return true;
5215 } 5184 }
5216 5185
5217 } // namespace dart 5186 } // namespace dart
5218 5187
5219 #endif // VM_OBJECT_H_ 5188 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698