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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 dest_frame_is_allocated_ = true; | 94 dest_frame_is_allocated_ = true; |
95 } | 95 } |
96 | 96 |
97 if (dest_options != kDestIsAllocated) { | 97 if (dest_options != kDestIsAllocated) { |
98 // kDestIsAllocated is used by the debugger to generate a stack trace | 98 // kDestIsAllocated is used by the debugger to generate a stack trace |
99 // and does not signal a real deopt. | 99 // and does not signal a real deopt. |
100 Isolate* isolate = Isolate::Current(); | 100 Isolate* isolate = Isolate::Current(); |
101 TimelineStream* compiler_stream = isolate->GetCompilerStream(); | 101 TimelineStream* compiler_stream = isolate->GetCompilerStream(); |
102 ASSERT(compiler_stream != NULL); | 102 ASSERT(compiler_stream != NULL); |
103 timeline_event_ = compiler_stream->RecordEvent(); | 103 timeline_event_ = compiler_stream->StartEvent(); |
104 if (timeline_event_ != NULL) { | 104 if (timeline_event_ != NULL) { |
105 timeline_event_->DurationBegin(compiler_stream, "Deoptimize"); | 105 timeline_event_->DurationBegin("Deoptimize"); |
106 timeline_event_->SetNumArguments(3); | 106 timeline_event_->SetNumArguments(3); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { | 110 if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) { |
111 OS::PrintErr( | 111 OS::PrintErr( |
112 "Deoptimizing (reason %d '%s') at pc %#" Px " '%s' (count %d)\n", | 112 "Deoptimizing (reason %d '%s') at pc %#" Px " '%s' (count %d)\n", |
113 deopt_reason(), | 113 deopt_reason(), |
114 DeoptReasonToCString(deopt_reason()), | 114 DeoptReasonToCString(deopt_reason()), |
115 frame->pc(), | 115 frame->pc(), |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 timeline_event_->CopyArgument( | 151 timeline_event_->CopyArgument( |
152 1, | 152 1, |
153 "reason", | 153 "reason", |
154 const_cast<char*>(DeoptReasonToCString(deopt_reason()))); | 154 const_cast<char*>(DeoptReasonToCString(deopt_reason()))); |
155 timeline_event_->FormatArgument( | 155 timeline_event_->FormatArgument( |
156 2, | 156 2, |
157 "deoptimizationCount", | 157 "deoptimizationCount", |
158 "%d", | 158 "%d", |
159 function.deoptimization_counter()); | 159 function.deoptimization_counter()); |
160 timeline_event_->DurationEnd(); | 160 timeline_event_->DurationEnd(); |
| 161 timeline_event_->Complete(); |
161 } | 162 } |
162 } | 163 } |
163 | 164 |
164 | 165 |
165 void DeoptContext::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 166 void DeoptContext::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
166 visitor->VisitPointer(reinterpret_cast<RawObject**>(&object_pool_)); | 167 visitor->VisitPointer(reinterpret_cast<RawObject**>(&object_pool_)); |
167 visitor->VisitPointer(reinterpret_cast<RawObject**>(&deopt_info_)); | 168 visitor->VisitPointer(reinterpret_cast<RawObject**>(&deopt_info_)); |
168 | 169 |
169 // Visit any object pointers on the destination stack. | 170 // Visit any object pointers on the destination stack. |
170 if (dest_frame_is_allocated_) { | 171 if (dest_frame_is_allocated_) { |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 Smi* offset, | 1294 Smi* offset, |
1294 TypedData* info, | 1295 TypedData* info, |
1295 Smi* reason) { | 1296 Smi* reason) { |
1296 intptr_t i = index * kEntrySize; | 1297 intptr_t i = index * kEntrySize; |
1297 *offset ^= table.At(i); | 1298 *offset ^= table.At(i); |
1298 *info ^= table.At(i + 1); | 1299 *info ^= table.At(i + 1); |
1299 *reason ^= table.At(i + 2); | 1300 *reason ^= table.At(i + 2); |
1300 } | 1301 } |
1301 | 1302 |
1302 } // namespace dart | 1303 } // namespace dart |
OLD | NEW |