Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: runtime/vm/deopt_instructions.cc

Issue 658773002: Fix crash with --trace-deoptimization-verbose and tweak formatting. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/deferred_objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (!objects_only || IsObjectInstruction(instr->kind())) { 260 if (!objects_only || IsObjectInstruction(instr->kind())) {
261 instr->Execute(this, to_addr); 261 instr->Execute(this, to_addr);
262 } else { 262 } else {
263 *reinterpret_cast<RawObject**>(to_addr) = Object::null(); 263 *reinterpret_cast<RawObject**>(to_addr) = Object::null();
264 } 264 }
265 } 265 }
266 266
267 if (FLAG_trace_deoptimization_verbose) { 267 if (FLAG_trace_deoptimization_verbose) {
268 intptr_t* start = dest_frame_; 268 intptr_t* start = dest_frame_;
269 for (intptr_t i = 0; i < frame_size; i++) { 269 for (intptr_t i = 0; i < frame_size; i++) {
270 OS::PrintErr("*%" Pd ". [%" Px "] %#014" Px " [%s]\n", 270 OS::PrintErr("*%" Pd ". [0x%" Px "] 0x%" Px " [%s]\n",
271 i, 271 i,
272 reinterpret_cast<uword>(&start[i]), 272 reinterpret_cast<uword>(&start[i]),
273 start[i], 273 start[i],
274 deopt_instructions[i + (len - frame_size)]->ToCString()); 274 deopt_instructions[i + (len - frame_size)]->ToCString());
275 } 275 }
276 } 276 }
277 } 277 }
278 278
279 279
280 static void FillDeferredSlots(DeoptContext* deopt_context, 280 static void FillDeferredSlots(DeoptContext* deopt_context,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 StackFrame* top_frame = iterator.NextFrame(); 316 StackFrame* top_frame = iterator.NextFrame();
317 ASSERT(top_frame != NULL); 317 ASSERT(top_frame != NULL);
318 const Code& code = Code::Handle(top_frame->LookupDartCode()); 318 const Code& code = Code::Handle(top_frame->LookupDartCode());
319 const Function& top_function = Function::Handle(code.function()); 319 const Function& top_function = Function::Handle(code.function());
320 const Script& script = Script::Handle(top_function.script()); 320 const Script& script = Script::Handle(top_function.script());
321 const intptr_t token_pos = code.GetTokenIndexOfPC(top_frame->pc()); 321 const intptr_t token_pos = code.GetTokenIndexOfPC(top_frame->pc());
322 intptr_t line, column; 322 intptr_t line, column;
323 script.GetTokenLocation(token_pos, &line, &column); 323 script.GetTokenLocation(token_pos, &line, &column);
324 String& line_string = String::Handle(script.GetLine(line)); 324 String& line_string = String::Handle(script.GetLine(line));
325 OS::PrintErr(" Function: %s\n", top_function.ToFullyQualifiedCString()); 325 OS::PrintErr(" Function: %s\n", top_function.ToFullyQualifiedCString());
326 OS::PrintErr(" Line %" Pd ": '%s'\n", line, line_string.ToCString()); 326 char line_buffer[80];
327 OS::SNPrint(line_buffer, sizeof(line_buffer), " Line %" Pd ": '%s'",
328 line, line_string.ToCString());
329 OS::PrintErr("%s\n", line_buffer);
327 OS::PrintErr(" Deopt args: %" Pd "\n", deopt_arg_count); 330 OS::PrintErr(" Deopt args: %" Pd "\n", deopt_arg_count);
328 } 331 }
329 332
330 return deopt_arg_count; 333 return deopt_arg_count;
331 } 334 }
332 335
333 336
334 RawArray* DeoptContext::DestFrameAsArray() { 337 RawArray* DeoptContext::DestFrameAsArray() {
335 ASSERT(dest_frame_ != NULL && dest_frame_is_allocated_); 338 ASSERT(dest_frame_ != NULL && dest_frame_is_allocated_);
336 const Array& dest_array = 339 const Array& dest_array =
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 Smi* offset, 1342 Smi* offset,
1340 DeoptInfo* info, 1343 DeoptInfo* info,
1341 Smi* reason) { 1344 Smi* reason) {
1342 intptr_t i = index * kEntrySize; 1345 intptr_t i = index * kEntrySize;
1343 *offset ^= table.At(i); 1346 *offset ^= table.At(i);
1344 *info ^= table.At(i + 1); 1347 *info ^= table.At(i + 1);
1345 *reason ^= table.At(i + 2); 1348 *reason ^= table.At(i + 2);
1346 } 1349 }
1347 1350
1348 } // namespace dart 1351 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/deferred_objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698