Chromium Code Reviews| 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/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/intermediate_language.h" | 10 #include "vm/intermediate_language.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 // Do not include incoming arguments if there are optional arguments | 60 // Do not include incoming arguments if there are optional arguments |
| 61 // (they are copied into local space at method entry). | 61 // (they are copied into local space at method entry). |
| 62 num_args_ = | 62 num_args_ = |
| 63 function.HasOptionalParameters() ? 0 : function.num_fixed_parameters(); | 63 function.HasOptionalParameters() ? 0 : function.num_fixed_parameters(); |
| 64 | 64 |
| 65 // The fixed size section of the (fake) Dart frame called via a stub by the | 65 // The fixed size section of the (fake) Dart frame called via a stub by the |
| 66 // optimized function contains FP, PP (ARM and MIPS only), PC-marker and | 66 // optimized function contains FP, PP (ARM and MIPS only), PC-marker and |
| 67 // return-address. This section is copied as well, so that its contained | 67 // return-address. This section is copied as well, so that its contained |
| 68 // values can be updated before returning to the deoptimized function. | 68 // values can be updated before returning to the deoptimized function. |
| 69 // Note: on DBC stack grows upwards unlike on all other architectures. | 69 // Note: on DBC stack grows upwards unlike on all other architectures. |
| 70 const intptr_t frame_size = | |
| 71 #if defined(TARGET_ARCH_DBC) | |
| 72 (static_cast<intptr_t>(frame->sp()) - | |
|
Vyacheslav Egorov (Google)
2016/06/09 15:09:06
I don't think these casts are needed really, they
zra
2016/06/09 16:42:23
Done.
| |
| 73 static_cast<intptr_t>(frame->fp())) / kWordSize; | |
| 74 #else | |
| 75 (static_cast<intptr_t>(frame->fp()) - | |
| 76 static_cast<intptr_t>(frame->sp())) / kWordSize; | |
| 77 #endif | |
| 78 ASSERT(frame_size >= 0); | |
| 79 | |
| 70 source_frame_size_ = | 80 source_frame_size_ = |
| 71 + kDartFrameFixedSize // For saved values below sp. | 81 + kDartFrameFixedSize // For saved values below sp. |
| 72 #if !defined(TARGET_ARCH_DBC) | 82 + frame_size // For frame size incl. sp. |
| 73 + ((frame->fp() - frame->sp()) / kWordSize) // For frame size incl. sp. | |
| 74 #else | |
| 75 + ((frame->sp() - frame->fp()) / kWordSize) // For frame size incl. sp. | |
| 76 #endif // !defined(TARGET_ARCH_DBC) | |
| 77 + 1 // For fp. | 83 + 1 // For fp. |
| 78 + kParamEndSlotFromFp // For saved values above fp. | 84 + kParamEndSlotFromFp // For saved values above fp. |
| 79 + num_args_; // For arguments. | 85 + num_args_; // For arguments. |
| 80 | 86 |
| 81 source_frame_ = FrameBase(frame); | 87 source_frame_ = FrameBase(frame); |
| 82 | 88 |
| 83 if (dest_options == kDestIsOriginalFrame) { | 89 if (dest_options == kDestIsOriginalFrame) { |
| 84 // Work from a copy of the source frame. | 90 // Work from a copy of the source frame. |
| 85 intptr_t* original_frame = source_frame_; | 91 intptr_t* original_frame = source_frame_; |
| 86 source_frame_ = new intptr_t[source_frame_size_]; | 92 source_frame_ = new intptr_t[source_frame_size_]; |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1338 Smi* offset, | 1344 Smi* offset, |
| 1339 TypedData* info, | 1345 TypedData* info, |
| 1340 Smi* reason) { | 1346 Smi* reason) { |
| 1341 intptr_t i = index * kEntrySize; | 1347 intptr_t i = index * kEntrySize; |
| 1342 *offset ^= table.At(i); | 1348 *offset ^= table.At(i); |
| 1343 *info ^= table.At(i + 1); | 1349 *info ^= table.At(i + 1); |
| 1344 *reason ^= table.At(i + 2); | 1350 *reason ^= table.At(i + 2); |
| 1345 } | 1351 } |
| 1346 | 1352 |
| 1347 } // namespace dart | 1353 } // namespace dart |
| OLD | NEW |