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

Side by Side Diff: vm/raw_object.h

Issue 10386060: Speed up the Dart_IsBlah functions by checking the class index. This (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
« vm/dart_api_impl.cc ('K') | « vm/dart_api_impl.cc ('k') | no next file » | 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_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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 229
230 bool IsNewObject() const { 230 bool IsNewObject() const {
231 uword addr = reinterpret_cast<uword>(this); 231 uword addr = reinterpret_cast<uword>(this);
232 return (addr & kNewObjectAlignmentOffset) == kNewObjectAlignmentOffset; 232 return (addr & kNewObjectAlignmentOffset) == kNewObjectAlignmentOffset;
233 } 233 }
234 bool IsOldObject() const { 234 bool IsOldObject() const {
235 uword addr = reinterpret_cast<uword>(this); 235 uword addr = reinterpret_cast<uword>(this);
236 return (addr & kNewObjectAlignmentOffset) == kOldObjectAlignmentOffset; 236 return (addr & kNewObjectAlignmentOffset) == kOldObjectAlignmentOffset;
237 } 237 }
238 238
239 intptr_t GetClassTag() const {
Ivan Posva 2012/05/09 23:28:16 Should we make this private?
turnidge 2012/05/10 17:49:38 Done.
240 uword tags = ptr()->tags_;
241 return ClassTag::decode(tags);
242 }
243
239 // Support for GC marking bit. 244 // Support for GC marking bit.
240 bool IsMarked() const { 245 bool IsMarked() const {
241 return MarkBit::decode(ptr()->tags_); 246 return MarkBit::decode(ptr()->tags_);
242 } 247 }
243 void SetMarkBit() { 248 void SetMarkBit() {
244 ASSERT(!IsMarked()); 249 ASSERT(!IsMarked());
245 uword tags = ptr()->tags_; 250 uword tags = ptr()->tags_;
246 ptr()->tags_ = MarkBit::update(true, tags); 251 ptr()->tags_ = MarkBit::update(true, tags);
247 } 252 }
248 void ClearMarkBit() { 253 void ClearMarkBit() {
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 intptr_t type_; // Uninitialized, simple or complex. 1362 intptr_t type_; // Uninitialized, simple or complex.
1358 intptr_t flags_; // Represents global/local, case insensitive, multiline. 1363 intptr_t flags_; // Represents global/local, case insensitive, multiline.
1359 1364
1360 // Variable length data follows here. 1365 // Variable length data follows here.
1361 uint8_t data_[0]; 1366 uint8_t data_[0];
1362 }; 1367 };
1363 1368
1364 } // namespace dart 1369 } // namespace dart
1365 1370
1366 #endif // VM_RAW_OBJECT_H_ 1371 #endif // VM_RAW_OBJECT_H_
OLDNEW
« vm/dart_api_impl.cc ('K') | « vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698