| 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/deopt_instructions.h" | 5 #include "vm/deopt_instructions.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 #include "vm/locations.h" | 10 #include "vm/locations.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 const bool objects_only = dest_frame_is_allocated_; | 255 const bool objects_only = dest_frame_is_allocated_; |
| 256 | 256 |
| 257 // All kMaterializeObject instructions are emitted before the instructions | 257 // All kMaterializeObject instructions are emitted before the instructions |
| 258 // that describe stack frames. Skip them and defer materialization of | 258 // that describe stack frames. Skip them and defer materialization of |
| 259 // objects until the frame is fully reconstructed and it is safe to perform | 259 // objects until the frame is fully reconstructed and it is safe to perform |
| 260 // GC. | 260 // GC. |
| 261 // Arguments (class of the instance to allocate and field-value pairs) are | 261 // Arguments (class of the instance to allocate and field-value pairs) are |
| 262 // described as part of the expression stack for the bottom-most deoptimized | 262 // described as part of the expression stack for the bottom-most deoptimized |
| 263 // frame. They will be used during materialization and removed from the stack | 263 // frame. They will be used during materialization and removed from the stack |
| 264 // right before control switches to the unoptimized code. | 264 // right before control switches to the unoptimized code. |
| 265 const intptr_t num_materializations = len - frame_size; | 265 const intptr_t num_materializations = deopt_info.NumMaterializations(); |
| 266 PrepareForDeferredMaterialization(num_materializations); | 266 PrepareForDeferredMaterialization(num_materializations); |
| 267 for (intptr_t from_index = 0, to_index = kDartFrameFixedSize; | 267 for (intptr_t from_index = 0, to_index = kDartFrameFixedSize; |
| 268 from_index < num_materializations; | 268 from_index < num_materializations; |
| 269 from_index++) { | 269 from_index++) { |
| 270 const intptr_t field_count = | 270 const intptr_t field_count = |
| 271 DeoptInstr::GetFieldCount(deopt_instructions[from_index]); | 271 DeoptInstr::GetFieldCount(deopt_instructions[from_index]); |
| 272 intptr_t* args = GetDestFrameAddressAt(to_index); | 272 intptr_t* args = GetDestFrameAddressAt(to_index); |
| 273 DeferredObject* obj = new DeferredObject(field_count, args); | 273 DeferredObject* obj = new DeferredObject(field_count, args); |
| 274 SetDeferredObjectAt(from_index, obj); | 274 SetDeferredObjectAt(from_index, obj); |
| 275 to_index += obj->ArgumentCount(); | 275 to_index += obj->ArgumentCount(); |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 Smi* offset, | 1415 Smi* offset, |
| 1416 DeoptInfo* info, | 1416 DeoptInfo* info, |
| 1417 Smi* reason) { | 1417 Smi* reason) { |
| 1418 intptr_t i = index * kEntrySize; | 1418 intptr_t i = index * kEntrySize; |
| 1419 *offset ^= table.At(i); | 1419 *offset ^= table.At(i); |
| 1420 *info ^= table.At(i + 1); | 1420 *info ^= table.At(i + 1); |
| 1421 *reason ^= table.At(i + 2); | 1421 *reason ^= table.At(i + 2); |
| 1422 } | 1422 } |
| 1423 | 1423 |
| 1424 } // namespace dart | 1424 } // namespace dart |
| OLD | NEW |