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/disassembler.h" |
10 #include "vm/intermediate_language.h" | 11 #include "vm/intermediate_language.h" |
11 #include "vm/locations.h" | 12 #include "vm/locations.h" |
12 #include "vm/parser.h" | 13 #include "vm/parser.h" |
13 #include "vm/stack_frame.h" | 14 #include "vm/stack_frame.h" |
14 #include "vm/thread.h" | 15 #include "vm/thread.h" |
15 #include "vm/timeline.h" | 16 #include "vm/timeline.h" |
16 | 17 |
17 namespace dart { | 18 namespace dart { |
18 | 19 |
19 DEFINE_FLAG(bool, compress_deopt_info, true, | 20 DEFINE_FLAG(bool, compress_deopt_info, true, |
(...skipping 25 matching lines...) Expand all Loading... |
45 deopt_flags_(0), | 46 deopt_flags_(0), |
46 thread_(Thread::Current()), | 47 thread_(Thread::Current()), |
47 deopt_start_micros_(0), | 48 deopt_start_micros_(0), |
48 deferred_slots_(NULL), | 49 deferred_slots_(NULL), |
49 deferred_objects_count_(0), | 50 deferred_objects_count_(0), |
50 deferred_objects_(NULL), | 51 deferred_objects_(NULL), |
51 is_lazy_deopt_(is_lazy_deopt), | 52 is_lazy_deopt_(is_lazy_deopt), |
52 deoptimizing_code_(deoptimizing_code) { | 53 deoptimizing_code_(deoptimizing_code) { |
53 const TypedData& deopt_info = TypedData::Handle( | 54 const TypedData& deopt_info = TypedData::Handle( |
54 code.GetDeoptInfoAtPc(frame->pc(), &deopt_reason_, &deopt_flags_)); | 55 code.GetDeoptInfoAtPc(frame->pc(), &deopt_reason_, &deopt_flags_)); |
| 56 #if defined(DEBUG) |
| 57 if (deopt_info.IsNull()) { |
| 58 OS::PrintErr("Missing deopt info for pc %" Px "\n", frame->pc()); |
| 59 DisassembleToStdout formatter; |
| 60 code.Disassemble(&formatter); |
| 61 } |
| 62 #endif |
55 ASSERT(!deopt_info.IsNull()); | 63 ASSERT(!deopt_info.IsNull()); |
56 deopt_info_ = deopt_info.raw(); | 64 deopt_info_ = deopt_info.raw(); |
57 | 65 |
58 const Function& function = Function::Handle(code.function()); | 66 const Function& function = Function::Handle(code.function()); |
59 | 67 |
60 // Do not include incoming arguments if there are optional arguments | 68 // Do not include incoming arguments if there are optional arguments |
61 // (they are copied into local space at method entry). | 69 // (they are copied into local space at method entry). |
62 num_args_ = | 70 num_args_ = |
63 function.HasOptionalParameters() ? 0 : function.num_fixed_parameters(); | 71 function.HasOptionalParameters() ? 0 : function.num_fixed_parameters(); |
64 | 72 |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 Smi* offset, | 1354 Smi* offset, |
1347 TypedData* info, | 1355 TypedData* info, |
1348 Smi* reason) { | 1356 Smi* reason) { |
1349 intptr_t i = index * kEntrySize; | 1357 intptr_t i = index * kEntrySize; |
1350 *offset ^= table.At(i); | 1358 *offset ^= table.At(i); |
1351 *info ^= table.At(i + 1); | 1359 *info ^= table.At(i + 1); |
1352 *reason ^= table.At(i + 2); | 1360 *reason ^= table.At(i + 2); |
1353 } | 1361 } |
1354 | 1362 |
1355 } // namespace dart | 1363 } // namespace dart |
OLD | NEW |