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: vm/raw_object.cc

Issue 9965042: - Add a class index to the classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 | « vm/raw_object.h ('k') | vm/snapshot.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 #include "vm/raw_object.h" 5 #include "vm/raw_object.h"
6 6
7 #include "vm/freelist.h" 7 #include "vm/freelist.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 // Validate that the class_ field is sensible. 25 // Validate that the class_ field is sensible.
26 RawClass* raw_class = ptr()->class_; 26 RawClass* raw_class = ptr()->class_;
27 ASSERT(raw_class->IsHeapObject()); 27 ASSERT(raw_class->IsHeapObject());
28 RawClass* raw_class_class = raw_class->ptr()->class_; 28 RawClass* raw_class_class = raw_class->ptr()->class_;
29 ASSERT(raw_class_class->IsHeapObject()); 29 ASSERT(raw_class_class->IsHeapObject());
30 ASSERT(raw_class_class->ptr()->instance_kind_ == kClass); 30 ASSERT(raw_class_class->ptr()->instance_kind_ == kClass);
31 31
32 // Validate that the tags_ field is sensible. 32 // Validate that the tags_ field is sensible.
33 intptr_t tags = ptr()->tags_; 33 intptr_t tags = ptr()->tags_;
34 ASSERT((tags & 0xffff00f0) == 0); 34 ASSERT((tags & 0x000000f0) == 0);
siva 2012/04/30 23:47:20 We could add an assertion here that the class inde
Ivan Posva 2012/05/01 15:11:17 Will do: See https://chromiumcodereview.appspot.co
35 } 35 }
36 36
37 37
38 intptr_t RawObject::SizeFromClass() const { 38 intptr_t RawObject::SizeFromClass() const {
39 NoHandleScope no_handles(Isolate::Current()); 39 NoHandleScope no_handles(Isolate::Current());
40 40
41 // Only reasonable to be called on heap objects. 41 // Only reasonable to be called on heap objects.
42 ASSERT(IsHeapObject()); 42 ASSERT(IsHeapObject());
43 43
44 RawClass* raw_class = ptr()->class_; 44 RawClass* raw_class = ptr()->class_;
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, 693 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj,
694 ObjectPointerVisitor* visitor) { 694 ObjectPointerVisitor* visitor) {
695 // Make sure that we got here with the tagged pointer as this. 695 // Make sure that we got here with the tagged pointer as this.
696 ASSERT(raw_obj->IsHeapObject()); 696 ASSERT(raw_obj->IsHeapObject());
697 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); 697 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_);
698 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 698 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
699 return JSRegExp::InstanceSize(length); 699 return JSRegExp::InstanceSize(length);
700 } 700 }
701 701
702 } // namespace dart 702 } // namespace dart
OLDNEW
« no previous file with comments | « vm/raw_object.h ('k') | vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698