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 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 } else { | 1431 } else { |
1432 ASSERT(type.IsInstantiated()); | 1432 ASSERT(type.IsInstantiated()); |
1433 } | 1433 } |
1434 const Instance& const_value = Instance::Handle(zone, field.StaticValue()); | 1434 const Instance& const_value = Instance::Handle(zone, field.StaticValue()); |
1435 if (!error.IsNull() || | 1435 if (!error.IsNull() || |
1436 (!type.IsDynamicType() && | 1436 (!type.IsDynamicType() && |
1437 !const_value.IsInstanceOf(type, Object::null_type_arguments(), | 1437 !const_value.IsInstanceOf(type, Object::null_type_arguments(), |
1438 &error))) { | 1438 &error))) { |
1439 if (Isolate::Current()->error_on_bad_type()) { | 1439 if (Isolate::Current()->error_on_bad_type()) { |
1440 const AbstractType& const_value_type = | 1440 const AbstractType& const_value_type = |
1441 AbstractType::Handle(zone, const_value.GetType()); | 1441 AbstractType::Handle(zone, const_value.GetType(Heap::kNew)); |
1442 const String& const_value_type_name = | 1442 const String& const_value_type_name = |
1443 String::Handle(zone, const_value_type.UserVisibleName()); | 1443 String::Handle(zone, const_value_type.UserVisibleName()); |
1444 const String& type_name = | 1444 const String& type_name = |
1445 String::Handle(zone, type.UserVisibleName()); | 1445 String::Handle(zone, type.UserVisibleName()); |
1446 ReportErrors(error, cls, field.token_pos(), | 1446 ReportErrors(error, cls, field.token_pos(), |
1447 "error initializing static %s field '%s': " | 1447 "error initializing static %s field '%s': " |
1448 "type '%s' is not a subtype of type '%s'", | 1448 "type '%s' is not a subtype of type '%s'", |
1449 field.is_const() ? "const" : "final", name.ToCString(), | 1449 field.is_const() ? "const" : "final", name.ToCString(), |
1450 const_value_type_name.ToCString(), | 1450 const_value_type_name.ToCString(), |
1451 type_name.ToCString()); | 1451 type_name.ToCString()); |
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); | 3320 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); |
3321 field ^= fields_array.At(0); | 3321 field ^= fields_array.At(0); |
3322 ASSERT(field.Offset() == ByteBuffer::data_offset()); | 3322 ASSERT(field.Offset() == ByteBuffer::data_offset()); |
3323 name ^= field.name(); | 3323 name ^= field.name(); |
3324 expected_name ^= String::New("_data"); | 3324 expected_name ^= String::New("_data"); |
3325 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 3325 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
3326 #endif | 3326 #endif |
3327 } | 3327 } |
3328 | 3328 |
3329 } // namespace dart | 3329 } // namespace dart |
OLD | NEW |