Chromium Code Reviews| 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/code_generator.h" | 7 #include "vm/code_generator.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 838 instantiated_bound.Equals(declared_bound))) { | 838 instantiated_bound.Equals(declared_bound))) { |
| 839 // If type_arg is a type parameter, its declared bound may not be | 839 // If type_arg is a type parameter, its declared bound may not be |
| 840 // resolved yet. | 840 // resolved yet. |
| 841 if (type_arg.IsTypeParameter()) { | 841 if (type_arg.IsTypeParameter()) { |
| 842 const Class& type_arg_cls = Class::Handle( | 842 const Class& type_arg_cls = Class::Handle( |
| 843 TypeParameter::Cast(type_arg).parameterized_class()); | 843 TypeParameter::Cast(type_arg).parameterized_class()); |
| 844 const AbstractType& bound = AbstractType::Handle( | 844 const AbstractType& bound = AbstractType::Handle( |
| 845 TypeParameter::Cast(type_arg).bound()); | 845 TypeParameter::Cast(type_arg).bound()); |
| 846 ResolveType(type_arg_cls, bound); | 846 ResolveType(type_arg_cls, bound); |
| 847 } | 847 } |
| 848 if (!type_param.CheckBound(type_arg, instantiated_bound, &error) && | 848 // This may be called only if type needs to be finalized, therefore |
| 849 error.IsNull()) { | 849 // seems OK to allocate temporary type in old space. |
|
regis
2015/09/25 20:55:23
The comment is hard to read. I am not sure what is
srdjan
2015/09/25 21:15:59
Done.
| |
| 850 if (!type_param.CheckBound(type_arg, instantiated_bound, | |
| 851 &error, Heap::kOld) && error.IsNull()) { | |
| 850 // The bound cannot be checked at compile time; postpone to run time. | 852 // The bound cannot be checked at compile time; postpone to run time. |
| 851 type_arg = BoundedType::New(type_arg, instantiated_bound, type_param); | 853 type_arg = BoundedType::New(type_arg, instantiated_bound, type_param); |
| 852 arguments.SetTypeAt(offset + i, type_arg); | 854 arguments.SetTypeAt(offset + i, type_arg); |
| 853 } | 855 } |
| 854 } | 856 } |
| 855 if (!error.IsNull() && bound_error->IsNull()) { | 857 if (!error.IsNull() && bound_error->IsNull()) { |
| 856 *bound_error = error.raw(); | 858 *bound_error = error.raw(); |
| 857 } | 859 } |
| 858 } | 860 } |
| 859 } | 861 } |
| (...skipping 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3218 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); | 3220 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); |
| 3219 field ^= fields_array.At(0); | 3221 field ^= fields_array.At(0); |
| 3220 ASSERT(field.Offset() == ByteBuffer::data_offset()); | 3222 ASSERT(field.Offset() == ByteBuffer::data_offset()); |
| 3221 name ^= field.name(); | 3223 name ^= field.name(); |
| 3222 expected_name ^= String::New("_data"); | 3224 expected_name ^= String::New("_data"); |
| 3223 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 3225 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
| 3224 #endif | 3226 #endif |
| 3225 } | 3227 } |
| 3226 | 3228 |
| 3227 } // namespace dart | 3229 } // namespace dart |
| OLD | NEW |