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()) - | |
| 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 | |
| 70 source_frame_size_ = | 78 source_frame_size_ = |
| 71 + kDartFrameFixedSize // For saved values below sp. | 79 + kDartFrameFixedSize // For saved values below sp. |
| 72 #if !defined(TARGET_ARCH_DBC) | 80 + 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. | |
|
zra
2016/06/07 22:31:28
For some reason sp() is < fp() ? Moved around to a
Vyacheslav Egorov (Google)
2016/06/08 11:58:53
If SP is less then FP on DBC then this is bug some
zra
2016/06/08 17:46:30
Added ASSERT.
| |
| 76 #endif // !defined(TARGET_ARCH_DBC) | |
| 77 + 1 // For fp. | 81 + 1 // For fp. |
| 78 + kParamEndSlotFromFp // For saved values above fp. | 82 + kParamEndSlotFromFp // For saved values above fp. |
| 79 + num_args_; // For arguments. | 83 + num_args_; // For arguments. |
| 80 | 84 |
| 81 source_frame_ = FrameBase(frame); | 85 source_frame_ = FrameBase(frame); |
| 82 | 86 |
| 83 if (dest_options == kDestIsOriginalFrame) { | 87 if (dest_options == kDestIsOriginalFrame) { |
| 84 // Work from a copy of the source frame. | 88 // Work from a copy of the source frame. |
| 85 intptr_t* original_frame = source_frame_; | 89 intptr_t* original_frame = source_frame_; |
| 86 source_frame_ = new intptr_t[source_frame_size_]; | 90 source_frame_ = new intptr_t[source_frame_size_]; |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1338 Smi* offset, | 1342 Smi* offset, |
| 1339 TypedData* info, | 1343 TypedData* info, |
| 1340 Smi* reason) { | 1344 Smi* reason) { |
| 1341 intptr_t i = index * kEntrySize; | 1345 intptr_t i = index * kEntrySize; |
| 1342 *offset ^= table.At(i); | 1346 *offset ^= table.At(i); |
| 1343 *info ^= table.At(i + 1); | 1347 *info ^= table.At(i + 1); |
| 1344 *reason ^= table.At(i + 2); | 1348 *reason ^= table.At(i + 2); |
| 1345 } | 1349 } |
| 1346 | 1350 |
| 1347 } // namespace dart | 1351 } // namespace dart |
| OLD | NEW |