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 3016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3027 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 3027 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
3028 field ^= fields_array.At(1); | 3028 field ^= fields_array.At(1); |
3029 ASSERT(field.Offset() == TypedDataView::offset_in_bytes_offset()); | 3029 ASSERT(field.Offset() == TypedDataView::offset_in_bytes_offset()); |
3030 name ^= field.name(); | 3030 name ^= field.name(); |
3031 expected_name ^= String::New("_offset"); | 3031 expected_name ^= String::New("_offset"); |
3032 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 3032 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
3033 field ^= fields_array.At(2); | 3033 field ^= fields_array.At(2); |
3034 ASSERT(field.Offset() == TypedDataView::length_offset()); | 3034 ASSERT(field.Offset() == TypedDataView::length_offset()); |
3035 name ^= field.name(); | 3035 name ^= field.name(); |
3036 ASSERT(name.Equals("length")); | 3036 ASSERT(name.Equals("length")); |
| 3037 |
| 3038 // Now verify field offsets of '_ByteBuffer' class. |
| 3039 cls = class_table.At(kByteBufferCid); |
| 3040 error = cls.EnsureIsFinalized(isolate); |
| 3041 ASSERT(error.IsNull()); |
| 3042 fields_array ^= cls.fields(); |
| 3043 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); |
| 3044 field ^= fields_array.At(0); |
| 3045 ASSERT(field.Offset() == ByteBuffer::data_offset()); |
| 3046 name ^= field.name(); |
| 3047 expected_name ^= String::New("_data"); |
| 3048 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
3037 #endif | 3049 #endif |
3038 } | 3050 } |
3039 | 3051 |
3040 } // namespace dart | 3052 } // namespace dart |
OLD | NEW |