| 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/snapshot.h" | 5 #include "vm/snapshot.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 if (objref->IsType()) { | 1130 if (objref->IsType()) { |
| 1131 typeobj ^= objref->raw(); | 1131 typeobj ^= objref->raw(); |
| 1132 newobj = typeobj.Canonicalize(); | 1132 newobj = typeobj.Canonicalize(); |
| 1133 } else { | 1133 } else { |
| 1134 ASSERT(objref->IsTypeArguments()); | 1134 ASSERT(objref->IsTypeArguments()); |
| 1135 typeargs ^= objref->raw(); | 1135 typeargs ^= objref->raw(); |
| 1136 newobj = typeargs.Canonicalize(); | 1136 newobj = typeargs.Canonicalize(); |
| 1137 } | 1137 } |
| 1138 if (newobj.raw() != objref->raw()) { | 1138 if (newobj.raw() != objref->raw()) { |
| 1139 ZoneGrowableArray<intptr_t>* patches = backref.patch_records(); | 1139 ZoneGrowableArray<intptr_t>* patches = backref.patch_records(); |
| 1140 ASSERT(newobj.IsCanonical()); | 1140 ASSERT(newobj.IsNull() || newobj.IsCanonical()); |
| 1141 ASSERT(patches != NULL); | 1141 ASSERT(patches != NULL); |
| 1142 // First we replace the back ref table with the canonical object. | 1142 // First we replace the back ref table with the canonical object. |
| 1143 *objref = newobj.raw(); | 1143 *objref = newobj.raw(); |
| 1144 // Now we go over all the patch records and patch the canonical object. | 1144 // Now we go over all the patch records and patch the canonical object. |
| 1145 for (intptr_t j = 0; j < patches->length(); j += 2) { | 1145 for (intptr_t j = 0; j < patches->length(); j += 2) { |
| 1146 NoSafepointScope no_safepoint; | 1146 NoSafepointScope no_safepoint; |
| 1147 intptr_t patch_object_id = (*patches)[j]; | 1147 intptr_t patch_object_id = (*patches)[j]; |
| 1148 intptr_t patch_offset = (*patches)[j + 1]; | 1148 intptr_t patch_offset = (*patches)[j + 1]; |
| 1149 Object* target = GetBackRef(patch_object_id); | 1149 Object* target = GetBackRef(patch_object_id); |
| 1150 // We should not backpatch an object that is canonical. | 1150 // We should not backpatch an object that is canonical. |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1956 if (setjmp(*jump.Set()) == 0) { | 1956 if (setjmp(*jump.Set()) == 0) { |
| 1957 NoSafepointScope no_safepoint; | 1957 NoSafepointScope no_safepoint; |
| 1958 WriteObject(obj.raw()); | 1958 WriteObject(obj.raw()); |
| 1959 } else { | 1959 } else { |
| 1960 ThrowException(exception_type(), exception_msg()); | 1960 ThrowException(exception_type(), exception_msg()); |
| 1961 } | 1961 } |
| 1962 } | 1962 } |
| 1963 | 1963 |
| 1964 | 1964 |
| 1965 } // namespace dart | 1965 } // namespace dart |
| OLD | NEW |