| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/class_finalizer.h" | 5 #include "vm/class_finalizer.h" |
| 6 | 6 |
| 7 #include "vm/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/heap.h" | 8 #include "vm/heap.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 case kIntegerCid: // Class Integer, not int. | 1910 case kIntegerCid: // Class Integer, not int. |
| 1911 case kSmiCid: | 1911 case kSmiCid: |
| 1912 case kMintCid: | 1912 case kMintCid: |
| 1913 case kBigintCid: | 1913 case kBigintCid: |
| 1914 case kDoubleCid: // Class Double, not double. | 1914 case kDoubleCid: // Class Double, not double. |
| 1915 case kOneByteStringCid: | 1915 case kOneByteStringCid: |
| 1916 case kTwoByteStringCid: | 1916 case kTwoByteStringCid: |
| 1917 case kExternalOneByteStringCid: | 1917 case kExternalOneByteStringCid: |
| 1918 case kExternalTwoByteStringCid: | 1918 case kExternalTwoByteStringCid: |
| 1919 case kBoolCid: | 1919 case kBoolCid: |
| 1920 case kNullCid: |
| 1920 case kArrayCid: | 1921 case kArrayCid: |
| 1921 case kImmutableArrayCid: | 1922 case kImmutableArrayCid: |
| 1922 case kGrowableObjectArrayCid: | 1923 case kGrowableObjectArrayCid: |
| 1923 #define DO_NOT_EXTEND_TYPED_DATA_CLASSES(clazz) \ | 1924 #define DO_NOT_EXTEND_TYPED_DATA_CLASSES(clazz) \ |
| 1924 case kTypedData##clazz##Cid: \ | 1925 case kTypedData##clazz##Cid: \ |
| 1925 case kTypedData##clazz##ViewCid: \ | 1926 case kTypedData##clazz##ViewCid: \ |
| 1926 case kExternalTypedData##clazz##Cid: | 1927 case kExternalTypedData##clazz##Cid: |
| 1927 CLASS_LIST_TYPED_DATA(DO_NOT_EXTEND_TYPED_DATA_CLASSES) | 1928 CLASS_LIST_TYPED_DATA(DO_NOT_EXTEND_TYPED_DATA_CLASSES) |
| 1928 #undef DO_NOT_EXTEND_TYPED_DATA_CLASSES | 1929 #undef DO_NOT_EXTEND_TYPED_DATA_CLASSES |
| 1929 case kByteDataViewCid: | 1930 case kByteDataViewCid: |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 script, cls.token_pos(), | 1975 script, cls.token_pos(), |
| 1975 "function type alias '%s' may not be used as interface", | 1976 "function type alias '%s' may not be used as interface", |
| 1976 String::Handle(interface_class.Name()).ToCString()); | 1977 String::Handle(interface_class.Name()).ToCString()); |
| 1977 } | 1978 } |
| 1978 // Verify that unless cls belongs to core lib, it cannot extend or implement | 1979 // Verify that unless cls belongs to core lib, it cannot extend or implement |
| 1979 // any of bool, num, int, double, String, Function, dynamic. | 1980 // any of bool, num, int, double, String, Function, dynamic. |
| 1980 // The exception is signature classes, which are compiler generated and | 1981 // The exception is signature classes, which are compiler generated and |
| 1981 // represent a function type, therefore implementing the Function interface. | 1982 // represent a function type, therefore implementing the Function interface. |
| 1982 if (!cls_belongs_to_core_lib) { | 1983 if (!cls_belongs_to_core_lib) { |
| 1983 if (interface.IsBoolType() || | 1984 if (interface.IsBoolType() || |
| 1985 interface.IsNullType() || |
| 1984 interface.IsNumberType() || | 1986 interface.IsNumberType() || |
| 1985 interface.IsIntType() || | 1987 interface.IsIntType() || |
| 1986 interface.IsDoubleType() || | 1988 interface.IsDoubleType() || |
| 1987 interface.IsStringType() || | 1989 interface.IsStringType() || |
| 1988 (interface.IsFunctionType() && !cls.IsSignatureClass()) || | 1990 (interface.IsFunctionType() && !cls.IsSignatureClass()) || |
| 1989 interface.IsDynamicType()) { | 1991 interface.IsDynamicType()) { |
| 1990 const Script& script = Script::Handle(cls.script()); | 1992 const Script& script = Script::Handle(cls.script()); |
| 1991 ReportError(Error::Handle(), // No previous error. | 1993 ReportError(Error::Handle(), // No previous error. |
| 1992 script, cls.token_pos(), | 1994 script, cls.token_pos(), |
| 1993 "'%s' is not allowed to extend or implement '%s'", | 1995 "'%s' is not allowed to extend or implement '%s'", |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2224 expected_name ^= String::New("_offset"); | 2226 expected_name ^= String::New("_offset"); |
| 2225 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 2227 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
| 2226 field ^= fields_array.At(2); | 2228 field ^= fields_array.At(2); |
| 2227 ASSERT(field.Offset() == TypedDataView::length_offset()); | 2229 ASSERT(field.Offset() == TypedDataView::length_offset()); |
| 2228 name ^= field.name(); | 2230 name ^= field.name(); |
| 2229 ASSERT(name.Equals("length")); | 2231 ASSERT(name.Equals("length")); |
| 2230 #endif | 2232 #endif |
| 2231 } | 2233 } |
| 2232 | 2234 |
| 2233 } // namespace dart | 2235 } // namespace dart |
| OLD | NEW |