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

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

Issue 8329005: Replace calls to Class::IsParameterized() by either (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 2 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/dart.h" 9 #include "vm/dart.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 418
419 // If this class is parameterized, each instance has a type_arguments field. 419 // If this class is parameterized, each instance has a type_arguments field.
420 intptr_t NumTypeArguments() const; 420 intptr_t NumTypeArguments() const;
421 static const intptr_t kNoTypeArguments = -1; 421 static const intptr_t kNoTypeArguments = -1;
422 intptr_t type_arguments_instance_field_offset() const { 422 intptr_t type_arguments_instance_field_offset() const {
423 ASSERT(is_finalized() || is_prefinalized()); 423 ASSERT(is_finalized() || is_prefinalized());
424 return raw_ptr()->type_arguments_instance_field_offset_; 424 return raw_ptr()->type_arguments_instance_field_offset_;
425 } 425 }
426 void set_type_arguments_instance_field_offset(intptr_t value) const { 426 void set_type_arguments_instance_field_offset(intptr_t value) const {
427 raw_ptr()->type_arguments_instance_field_offset_ = value; 427 raw_ptr()->type_arguments_instance_field_offset_ = value;
428 } 428 }
siva 2011/10/18 05:06:19 The old comment says IsParametrized is more effici
regis 2011/10/18 17:28:21 Yes, I think I should reintroduce a helper functio
429 bool IsParameterized() const {
430 if (is_finalized() || is_prefinalized()) {
431 // More efficient than calling NumTypeArguments().
432 return type_arguments_instance_field_offset() != kNoTypeArguments;
433 } else {
434 return NumTypeArguments() > 0;
435 }
436 }
437 429
438 // The super type of this class, Object type if not explicitly specified. 430 // The super type of this class, Object type if not explicitly specified.
439 RawType* super_type() const { return raw_ptr()->super_type_; } 431 RawType* super_type() const { return raw_ptr()->super_type_; }
440 void set_super_type(const Type& value) const; 432 void set_super_type(const Type& value) const;
441 433
442 // Asserts that the class of the super type has been resolved. 434 // Asserts that the class of the super type has been resolved.
443 RawClass* SuperClass() const; 435 RawClass* SuperClass() const;
444 436
445 // The factory type of this interface, null if not specified. 437 // The factory type of this interface, null if not specified.
446 RawType* factory_type() const { return raw_ptr()->factory_type_; } 438 RawType* factory_type() const { return raw_ptr()->factory_type_; }
(...skipping 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 } 2868 }
2877 2869
2878 2870
2879 void Context::SetAt(intptr_t index, const Instance& value) const { 2871 void Context::SetAt(intptr_t index, const Instance& value) const {
2880 StorePointer(InstanceAddr(index), value.raw()); 2872 StorePointer(InstanceAddr(index), value.raw());
2881 } 2873 }
2882 2874
2883 } // namespace dart 2875 } // namespace dart
2884 2876
2885 #endif // VM_OBJECT_H_ 2877 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698