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

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

Issue 10832401: Gentle start with removing explicit interfaces (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 867
868 // Check if this type represents the 'bool' interface. 868 // Check if this type represents the 'bool' interface.
869 bool IsBoolInterface() const; 869 bool IsBoolInterface() const;
870 870
871 // Check if this type represents the 'int' interface. 871 // Check if this type represents the 'int' interface.
872 bool IsIntInterface() const; 872 bool IsIntInterface() const;
873 873
874 // Check if this type represents the 'double' interface. 874 // Check if this type represents the 'double' interface.
875 bool IsDoubleInterface() const; 875 bool IsDoubleInterface() const;
876 876
877 // Check if this type represents the 'num' interface. 877 // Check if this type represents the 'num' interface.
regis 2012/08/23 03:53:10 s/interface/type/
hausner 2012/08/23 18:34:10 Done.
878 bool IsNumberInterface() const; 878 bool IsNumberType() const;
879 879
880 // Check if this type represents the 'String' interface. 880 // Check if this type represents the 'String' interface.
881 bool IsStringInterface() const; 881 bool IsStringInterface() const;
882 882
883 // Check if this type represents the 'Function' interface. 883 // Check if this type represents the 'Function' type.
884 bool IsFunctionInterface() const; 884 bool IsFunctionType() const;
885 885
886 // Check if this type represents the 'List' interface. 886 // Check if this type represents the 'List' interface.
887 bool IsListInterface() const; 887 bool IsListInterface() const;
888 888
889 // Check if this type is an interface type. 889 // Check if this type is an interface type.
890 bool IsInterfaceType() const { 890 bool IsInterfaceType() const {
891 if (!HasResolvedTypeClass()) { 891 if (!HasResolvedTypeClass()) {
892 return false; 892 return false;
893 } 893 }
894 const Class& cls = Class::Handle(type_class()); 894 const Class& cls = Class::Handle(type_class());
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 // The 'bool' interface type. 986 // The 'bool' interface type.
987 static RawType* BoolInterface(); 987 static RawType* BoolInterface();
988 988
989 // The 'int' interface type. 989 // The 'int' interface type.
990 static RawType* IntInterface(); 990 static RawType* IntInterface();
991 991
992 // The 'double' interface type. 992 // The 'double' interface type.
993 static RawType* DoubleInterface(); 993 static RawType* DoubleInterface();
994 994
995 // The 'num' interface type. 995 // The 'num' interface type.
996 static RawType* NumberInterface(); 996 static RawType* Number();
997 997
998 // The 'String' interface type. 998 // The 'String' interface type.
999 static RawType* StringInterface(); 999 static RawType* StringInterface();
1000 1000
1001 // The 'Function' interface type. 1001 // The 'Function' interface type.
1002 static RawType* FunctionInterface(); 1002 static RawType* Function();
1003 1003
1004 // The 'List' interface type. 1004 // The 'List' interface type.
1005 static RawType* ListInterface(); 1005 static RawType* ListInterface();
1006 1006
1007 // The finalized type of the given non-parameterized class. 1007 // The finalized type of the given non-parameterized class.
1008 static RawType* NewNonParameterizedType(const Class& type_class); 1008 static RawType* NewNonParameterizedType(const Class& type_class);
1009 1009
1010 static RawType* New(const Object& clazz, 1010 static RawType* New(const Object& clazz,
1011 const AbstractTypeArguments& arguments, 1011 const AbstractTypeArguments& arguments,
1012 intptr_t token_pos, 1012 intptr_t token_pos,
(...skipping 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after
3135 // Number is an abstract class. 3135 // Number is an abstract class.
3136 UNREACHABLE(); 3136 UNREACHABLE();
3137 return false; 3137 return false;
3138 } 3138 }
3139 virtual bool IsNegative() const { 3139 virtual bool IsNegative() const {
3140 // Number is an abstract class. 3140 // Number is an abstract class.
3141 UNREACHABLE(); 3141 UNREACHABLE();
3142 return false; 3142 return false;
3143 } 3143 }
3144 OBJECT_IMPLEMENTATION(Number, Instance); 3144 OBJECT_IMPLEMENTATION(Number, Instance);
3145 friend class Class;
3145 }; 3146 };
3146 3147
3147 3148
3148 class Integer : public Number { 3149 class Integer : public Number {
3149 public: 3150 public:
3150 static RawInteger* New(const String& str, Heap::Space space = Heap::kNew); 3151 static RawInteger* New(const String& str, Heap::Space space = Heap::kNew);
3151 static RawInteger* New(int64_t value, Heap::Space space = Heap::kNew); 3152 static RawInteger* New(int64_t value, Heap::Space space = Heap::kNew);
3152 3153
3153 virtual double AsDoubleValue() const; 3154 virtual double AsDoubleValue() const;
3154 virtual int64_t AsInt64Value() const; 3155 virtual int64_t AsInt64Value() const;
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after
5220 void SetExternalData(ExternalByteArrayData<double>* data) { 5221 void SetExternalData(ExternalByteArrayData<double>* data) {
5221 raw_ptr()->external_data_ = data; 5222 raw_ptr()->external_data_ = data;
5222 } 5223 }
5223 5224
5224 HEAP_OBJECT_IMPLEMENTATION(ExternalFloat64Array, ByteArray); 5225 HEAP_OBJECT_IMPLEMENTATION(ExternalFloat64Array, ByteArray);
5225 friend class ByteArray; 5226 friend class ByteArray;
5226 friend class Class; 5227 friend class Class;
5227 }; 5228 };
5228 5229
5229 5230
5231 // DartFunction represents the abstract Dart class 'Function'.
5232 class DartFunction : public Instance {
5233 private:
5234 HEAP_OBJECT_IMPLEMENTATION(DartFunction, Instance);
5235 friend class Class;
5236 friend class Instance;
5237 };
5238
5239
5230 class Closure : public Instance { 5240 class Closure : public Instance {
5231 public: 5241 public:
5232 RawFunction* function() const { return raw_ptr()->function_; } 5242 RawFunction* function() const { return raw_ptr()->function_; }
5233 static intptr_t function_offset() { 5243 static intptr_t function_offset() {
5234 return OFFSET_OF(RawClosure, function_); 5244 return OFFSET_OF(RawClosure, function_);
5235 } 5245 }
5236 5246
5237 RawContext* context() const { return raw_ptr()->context_; } 5247 RawContext* context() const { return raw_ptr()->context_; }
5238 static intptr_t context_offset() { return OFFSET_OF(RawClosure, context_); } 5248 static intptr_t context_offset() { return OFFSET_OF(RawClosure, context_); }
5239 5249
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
5516 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5526 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5517 return false; 5527 return false;
5518 } 5528 }
5519 } 5529 }
5520 return true; 5530 return true;
5521 } 5531 }
5522 5532
5523 } // namespace dart 5533 } // namespace dart
5524 5534
5525 #endif // VM_OBJECT_H_ 5535 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698