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

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

Issue 547703002: Rework how types work in the VM Service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 3 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/vm/json_test.cc ('k') | runtime/vm/object.cc » ('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_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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 ASSERT(Object::Handle(raw).Is##object()); \ 129 ASSERT(Object::Handle(raw).Is##object()); \
130 return reinterpret_cast<Raw##object*>(raw); \ 130 return reinterpret_cast<Raw##object*>(raw); \
131 } \ 131 } \
132 static Raw##object* null() { \ 132 static Raw##object* null() { \
133 return reinterpret_cast<Raw##object*>(Object::null()); \ 133 return reinterpret_cast<Raw##object*>(Object::null()); \
134 } \ 134 } \
135 virtual const char* ToCString() const; \ 135 virtual const char* ToCString() const; \
136 /* Object is printed as JSON into stream. If ref is true only a header */ \ 136 /* Object is printed as JSON into stream. If ref is true only a header */ \
137 /* with an object id is printed. If ref is false the object is fully */ \ 137 /* with an object id is printed. If ref is false the object is fully */ \
138 /* printed. */ \ 138 /* printed. */ \
139 virtual const char* JSONType(bool ref) const { \ 139 virtual const char* JSONType() const { \
140 return ref ? "@"#object : ""#object; \ 140 return ""#object; \
141 } \ 141 } \
142 static const ClassId kClassId = k##object##Cid; \ 142 static const ClassId kClassId = k##object##Cid; \
143 protected: /* NOLINT */ \ 143 protected: /* NOLINT */ \
144 virtual void PrintJSONImpl(JSONStream* stream, bool ref) const; \ 144 virtual void PrintJSONImpl(JSONStream* stream, bool ref) const; \
145 private: /* NOLINT */ \ 145 private: /* NOLINT */ \
146 /* Initialize the handle based on the raw_ptr in the presence of null. */ \ 146 /* Initialize the handle based on the raw_ptr in the presence of null. */ \
147 static void initializeHandle(object* obj, RawObject* raw_ptr) { \ 147 static void initializeHandle(object* obj, RawObject* raw_ptr) { \
148 if (raw_ptr != Object::null()) { \ 148 if (raw_ptr != Object::null()) { \
149 obj->SetRaw(raw_ptr); \ 149 obj->SetRaw(raw_ptr); \
150 } else { \ 150 } else { \
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 virtual const char* ToCString() const { 274 virtual const char* ToCString() const {
275 if (IsNull()) { 275 if (IsNull()) {
276 return "null"; 276 return "null";
277 } else { 277 } else {
278 return "Object"; 278 return "Object";
279 } 279 }
280 } 280 }
281 281
282 void PrintJSON(JSONStream* stream, bool ref = true) const; 282 void PrintJSON(JSONStream* stream, bool ref = true) const;
283 283
284 virtual const char* JSONType(bool ref) const { 284 virtual const char* JSONType() const {
285 return IsNull() ? "null" : "Object"; 285 return IsNull() ? "null" : "Object";
286 } 286 }
287 287
288 // Returns the name that is used to identify an object in the 288 // Returns the name that is used to identify an object in the
289 // namespace dictionary. 289 // namespace dictionary.
290 // Object::DictionaryName() returns String::null(). Only subclasses 290 // Object::DictionaryName() returns String::null(). Only subclasses
291 // of Object that need to be entered in the library and library prefix 291 // of Object that need to be entered in the library and library prefix
292 // namespaces need to provide an implementation. 292 // namespaces need to provide an implementation.
293 virtual RawString* DictionaryName() const; 293 virtual RawString* DictionaryName() const;
294 294
(...skipping 7122 matching lines...) Expand 10 before | Expand all | Expand 10 after
7417 7417
7418 7418
7419 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7419 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7420 intptr_t index) { 7420 intptr_t index) {
7421 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7421 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7422 } 7422 }
7423 7423
7424 } // namespace dart 7424 } // namespace dart
7425 7425
7426 #endif // VM_OBJECT_H_ 7426 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/json_test.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698