Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: runtime/vm/deferred_objects.cc

Issue 246303004: Fixes bug where we would occasionally materialize a corrupted object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/deferred_objects.h" 5 #include "vm/deferred_objects.h"
6 6
7 #include "vm/deopt_instructions.h" 7 #include "vm/deopt_instructions.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 Field& field = Field::Handle(); 120 Field& field = Field::Handle();
121 Object& value = Object::Handle(); 121 Object& value = Object::Handle();
122 const Array& offset_map = Array::Handle(cls.OffsetToFieldMap()); 122 const Array& offset_map = Array::Handle(cls.OffsetToFieldMap());
123 123
124 for (intptr_t i = 0; i < field_count_; i++) { 124 for (intptr_t i = 0; i < field_count_; i++) {
125 offset ^= GetFieldOffset(i); 125 offset ^= GetFieldOffset(i);
126 field ^= offset_map.At(offset.Value() / kWordSize); 126 field ^= offset_map.At(offset.Value() / kWordSize);
127 value = GetValue(i); 127 value = GetValue(i);
128 if (!field.IsNull()) { 128 if (!field.IsNull()) {
129 obj.SetField(field, value); 129 obj.SetField(field, value);
130 if (FLAG_trace_deoptimization_verbose) {
131 OS::PrintErr(" %s <- %s\n",
132 String::Handle(field.name()).ToCString(),
133 value.ToCString());
134 }
130 } else { 135 } else {
131 ASSERT(cls.IsSignatureClass() || 136 ASSERT(cls.IsSignatureClass() ||
132 (offset.Value() == cls.type_arguments_field_offset())); 137 (offset.Value() == cls.type_arguments_field_offset()));
133 obj.SetFieldAtOffset(offset.Value(), value); 138 obj.SetFieldAtOffset(offset.Value(), value);
134 } 139 if (FLAG_trace_deoptimization_verbose) {
135 140 OS::PrintErr(" null Field @ offset(%" Pd ") <- %s\n",
136 if (FLAG_trace_deoptimization_verbose) { 141 offset.Value(),
137 OS::PrintErr(" %s <- %s\n", 142 value.ToCString());
138 String::Handle(field.name()).ToCString(), 143 }
139 value.ToCString());
140 } 144 }
141 } 145 }
142 146
143 object_ = &obj; 147 object_ = &obj;
144 } 148 }
145 149
146 } // namespace dart 150 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698