| OLD | NEW |
| 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 #include "vm/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1845 if (!orig_field.IsNull()) { | 1845 if (!orig_field.IsNull()) { |
| 1846 return FormatPatchError("duplicate field: %s", member_name); | 1846 return FormatPatchError("duplicate field: %s", member_name); |
| 1847 } | 1847 } |
| 1848 new_list.SetAt(i, field); | 1848 new_list.SetAt(i, field); |
| 1849 } | 1849 } |
| 1850 for (intptr_t i = 0; i < orig_len; i++) { | 1850 for (intptr_t i = 0; i < orig_len; i++) { |
| 1851 field ^= orig_list.At(i); | 1851 field ^= orig_list.At(i); |
| 1852 new_list.SetAt(patch_len + i, field); | 1852 new_list.SetAt(patch_len + i, field); |
| 1853 } | 1853 } |
| 1854 SetFields(new_list); | 1854 SetFields(new_list); |
| 1855 |
| 1856 // The functions and fields in the patch class are no longer needed. |
| 1857 patch.SetFunctions(Object::empty_array()); |
| 1858 patch.SetFields(Object::empty_array()); |
| 1855 return NULL; | 1859 return NULL; |
| 1856 } | 1860 } |
| 1857 | 1861 |
| 1858 | 1862 |
| 1859 void Class::SetFields(const Array& value) const { | 1863 void Class::SetFields(const Array& value) const { |
| 1860 ASSERT(!value.IsNull()); | 1864 ASSERT(!value.IsNull()); |
| 1861 #if defined(DEBUG) | 1865 #if defined(DEBUG) |
| 1862 // Verify that all the fields in the array have this class as owner. | 1866 // Verify that all the fields in the array have this class as owner. |
| 1863 Field& field = Field::Handle(); | 1867 Field& field = Field::Handle(); |
| 1864 intptr_t len = value.Length(); | 1868 intptr_t len = value.Length(); |
| (...skipping 10928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12793 } | 12797 } |
| 12794 return result.raw(); | 12798 return result.raw(); |
| 12795 } | 12799 } |
| 12796 | 12800 |
| 12797 | 12801 |
| 12798 const char* WeakProperty::ToCString() const { | 12802 const char* WeakProperty::ToCString() const { |
| 12799 return "_WeakProperty"; | 12803 return "_WeakProperty"; |
| 12800 } | 12804 } |
| 12801 | 12805 |
| 12802 } // namespace dart | 12806 } // namespace dart |
| OLD | NEW |