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

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

Issue 10444091: Avoid reading RawObject::class_ directly in the runtime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 RawObject* ptr() const { 328 RawObject* ptr() const {
329 ASSERT(IsHeapObject()); 329 ASSERT(IsHeapObject());
330 return reinterpret_cast<RawObject*>( 330 return reinterpret_cast<RawObject*>(
331 reinterpret_cast<uword>(this) - kHeapObjectTag); 331 reinterpret_cast<uword>(this) - kHeapObjectTag);
332 } 332 }
333 333
334 intptr_t SizeFromClass() const; 334 intptr_t SizeFromClass() const;
335 335
336 intptr_t GetClassIndex() const { 336 intptr_t GetClassIndex() const {
337 uword tags = ptr()->tags_; 337 uword tags = ptr()->tags_;
338 ASSERT(!FreeBit::decode(tags));
Ivan Posva 2012/06/01 16:31:06 Please mark this with a TODO that we need to revis
338 return ClassTag::decode(tags); 339 return ClassTag::decode(tags);
339 } 340 }
340 341
341 friend class Api; 342 friend class Api;
342 friend class Array; 343 friend class Array;
343 friend class Heap; 344 friend class Heap;
344 friend class MarkingVisitor; 345 friend class MarkingVisitor;
345 friend class Object; 346 friend class Object;
346 friend class RawInstructions; 347 friend class RawInstructions;
348 friend class RawInstance;
347 friend class SnapshotReader; 349 friend class SnapshotReader;
348 friend class SnapshotWriter; 350 friend class SnapshotWriter;
349 351
350 DISALLOW_ALLOCATION(); 352 DISALLOW_ALLOCATION();
351 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); 353 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject);
352 }; 354 };
353 355
354 356
355 class RawClass : public RawObject { 357 class RawClass : public RawObject {
356 public: 358 public:
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 kExternalUint64Array == kByteArray + 18 && 1497 kExternalUint64Array == kByteArray + 18 &&
1496 kExternalFloat32Array == kByteArray + 19 && 1498 kExternalFloat32Array == kByteArray + 19 &&
1497 kExternalFloat64Array == kByteArray + 20 && 1499 kExternalFloat64Array == kByteArray + 20 &&
1498 kClosure == kByteArray + 21); 1500 kClosure == kByteArray + 21);
1499 return (index >= kByteArray && index <= kClosure); 1501 return (index >= kByteArray && index <= kClosure);
1500 } 1502 }
1501 1503
1502 } // namespace dart 1504 } // namespace dart
1503 1505
1504 #endif // VM_RAW_OBJECT_H_ 1506 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | runtime/vm/raw_object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698