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

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

Issue 10209002: Progress toward inlined type checks for classes with type arguments: factor out code, optimize typ… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
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
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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 524
525 // If this class is parameterized, each instance has a type_arguments field. 525 // If this class is parameterized, each instance has a type_arguments field.
526 static const intptr_t kNoTypeArguments = -1; 526 static const intptr_t kNoTypeArguments = -1;
527 intptr_t type_arguments_instance_field_offset() const { 527 intptr_t type_arguments_instance_field_offset() const {
528 ASSERT(is_finalized() || is_prefinalized()); 528 ASSERT(is_finalized() || is_prefinalized());
529 return raw_ptr()->type_arguments_instance_field_offset_; 529 return raw_ptr()->type_arguments_instance_field_offset_;
530 } 530 }
531 void set_type_arguments_instance_field_offset(intptr_t value) const { 531 void set_type_arguments_instance_field_offset(intptr_t value) const {
532 raw_ptr()->type_arguments_instance_field_offset_ = value; 532 raw_ptr()->type_arguments_instance_field_offset_ = value;
533 } 533 }
534 static intptr_t type_arguments_instance_field_offset_offset() {
535 return OFFSET_OF(RawClass, type_arguments_instance_field_offset_);
536 }
534 537
535 // The super type of this class, Object type if not explicitly specified. 538 // The super type of this class, Object type if not explicitly specified.
536 RawType* super_type() const { return raw_ptr()->super_type_; } 539 RawType* super_type() const { return raw_ptr()->super_type_; }
537 void set_super_type(const Type& value) const; 540 void set_super_type(const Type& value) const;
538 static intptr_t super_type_offset() { 541 static intptr_t super_type_offset() {
539 return OFFSET_OF(RawClass, super_type_); 542 return OFFSET_OF(RawClass, super_type_);
540 } 543 }
541 544
542 // Asserts that the class of the super type has been resolved. 545 // Asserts that the class of the super type has been resolved.
543 RawClass* SuperClass() const; 546 RawClass* SuperClass() const;
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 public: 1038 public:
1036 virtual bool IsFinalized() const { return true; } 1039 virtual bool IsFinalized() const { return true; }
1037 virtual bool IsBeingFinalized() const { return false; } 1040 virtual bool IsBeingFinalized() const { return false; }
1038 virtual bool IsMalformed() const { return false; } 1041 virtual bool IsMalformed() const { return false; }
1039 virtual bool IsResolved() const { return true; } 1042 virtual bool IsResolved() const { return true; }
1040 virtual bool HasResolvedTypeClass() const { return true; } 1043 virtual bool HasResolvedTypeClass() const { return true; }
1041 virtual RawClass* type_class() const; 1044 virtual RawClass* type_class() const;
1042 virtual RawAbstractTypeArguments* arguments() const; 1045 virtual RawAbstractTypeArguments* arguments() const;
1043 virtual intptr_t token_index() const; 1046 virtual intptr_t token_index() const;
1044 virtual bool IsInstantiated() const { return true; } 1047 virtual bool IsInstantiated() const { return true; }
1048 virtual bool Equals(const AbstractType& other) const;
regis 2012/04/25 01:53:53 Why do you need this?
srdjan 2012/04/25 16:38:01 Canonicalization ... will try without.
1045 1049
1046 RawAbstractType* uninstantiated_type() const { 1050 RawAbstractType* uninstantiated_type() const {
1047 return raw_ptr()->uninstantiated_type_; 1051 return raw_ptr()->uninstantiated_type_;
1048 } 1052 }
1049 RawAbstractTypeArguments* instantiator_type_arguments() const { 1053 RawAbstractTypeArguments* instantiator_type_arguments() const {
1050 return raw_ptr()->instantiator_type_arguments_; 1054 return raw_ptr()->instantiator_type_arguments_;
1051 } 1055 }
1052 1056
1053 static intptr_t InstanceSize() { 1057 static intptr_t InstanceSize() {
1054 return RoundedAllocationSize(sizeof(RawInstantiatedType)); 1058 return RoundedAllocationSize(sizeof(RawInstantiatedType));
(...skipping 2945 matching lines...) Expand 10 before | Expand all | Expand 10 after
4000 } 4004 }
4001 4005
4002 4006
4003 intptr_t Stackmap::SizeInBits() const { 4007 intptr_t Stackmap::SizeInBits() const {
4004 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); 4008 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte);
4005 } 4009 }
4006 4010
4007 } // namespace dart 4011 } // namespace dart
4008 4012
4009 #endif // VM_OBJECT_H_ 4013 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698