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

Side by Side Diff: src/a64/deoptimizer-a64.cc

Issue 151373004: A64: Restore FP registers in Deoptimizer::EntryGenerator::Generate (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | « src/a64/assembler-a64.h ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 // Compute the output frame in the deoptimizer. 479 // Compute the output frame in the deoptimizer.
480 __ Push(x0); // Preserve deoptimizer object across call. 480 __ Push(x0); // Preserve deoptimizer object across call.
481 481
482 { 482 {
483 // Call Deoptimizer::ComputeOutputFrames(). 483 // Call Deoptimizer::ComputeOutputFrames().
484 AllowExternalCallThatCantCauseGC scope(masm()); 484 AllowExternalCallThatCantCauseGC scope(masm());
485 __ CallCFunction( 485 __ CallCFunction(
486 ExternalReference::compute_output_frames_function(isolate()), 1); 486 ExternalReference::compute_output_frames_function(isolate()), 1);
487 } 487 }
488 __ Pop(x0); // Restore deoptimizer object (class Deoptimizer). 488 __ Pop(x0); // Restore deoptimizer object (class Deoptimizer).
489 __ Mov(x4, x0);
Rodolph Perfetta (ARM) 2014/01/31 14:50:28 Pop directly into x4 and update the two loads belo
489 490
490 // Replace the current (input) frame with the output frames. 491 // Replace the current (input) frame with the output frames.
491 Label outer_push_loop, inner_push_loop, 492 Label outer_push_loop, inner_push_loop,
492 outer_loop_header, inner_loop_header; 493 outer_loop_header, inner_loop_header;
493 __ Ldrsw(x1, MemOperand(x0, Deoptimizer::output_count_offset())); 494 __ Ldrsw(x1, MemOperand(x0, Deoptimizer::output_count_offset()));
494 __ Ldr(x0, MemOperand(x0, Deoptimizer::output_offset())); 495 __ Ldr(x0, MemOperand(x0, Deoptimizer::output_offset()));
495 __ Add(x1, x0, Operand(x1, LSL, kPointerSizeLog2)); 496 __ Add(x1, x0, Operand(x1, LSL, kPointerSizeLog2));
496 __ B(&outer_loop_header); 497 __ B(&outer_loop_header);
497 498
498 __ Bind(&outer_push_loop); 499 __ Bind(&outer_push_loop);
499 Register current_frame = x2; 500 Register current_frame = x2;
500 __ Ldr(current_frame, MemOperand(x0, 0)); 501 __ Ldr(current_frame, MemOperand(x0, 0));
501 __ Ldr(x3, MemOperand(current_frame, FrameDescription::frame_size_offset())); 502 __ Ldr(x3, MemOperand(current_frame, FrameDescription::frame_size_offset()));
502 __ B(&inner_loop_header); 503 __ B(&inner_loop_header);
503 504
504 __ Bind(&inner_push_loop); 505 __ Bind(&inner_push_loop);
505 __ Sub(x3, x3, kPointerSize); 506 __ Sub(x3, x3, kPointerSize);
506 __ Add(x6, current_frame, x3); 507 __ Add(x6, current_frame, x3);
507 __ Ldr(x7, MemOperand(x6, FrameDescription::frame_content_offset())); 508 __ Ldr(x7, MemOperand(x6, FrameDescription::frame_content_offset()));
508 __ Push(x7); 509 __ Push(x7);
509 __ Bind(&inner_loop_header); 510 __ Bind(&inner_loop_header);
510 __ Cbnz(x3, &inner_push_loop); 511 __ Cbnz(x3, &inner_push_loop);
511 512
512 __ Add(x0, x0, kPointerSize); 513 __ Add(x0, x0, kPointerSize);
513 __ Bind(&outer_loop_header); 514 __ Bind(&outer_loop_header);
514 __ Cmp(x0, x1); 515 __ Cmp(x0, x1);
515 __ B(lt, &outer_push_loop); 516 __ B(lt, &outer_push_loop);
516 517
517 // TODO(jbramley): The ARM code restores FP registers here. 518 __ Ldr(x1, MemOperand(x4, Deoptimizer::input_offset()));
518 TODO_UNIMPLEMENTED("EntryGenerator::Generate: Restore FP registers."); 519 int src_offset = FrameDescription::double_registers_offset();
520 for (unsigned i = 0; i < kNumberOfFPRegisters; ++i) {
Rodolph Perfetta (ARM) 2014/01/31 14:50:28 This loop could be rewritten with CPURegList: CPU
521 if (i == crankshaft_fp_scratch.code()) continue;
522 if (i == fp_zero.code()) continue;
523 if (i == fp_scratch.code()) continue;
524
525 const FPRegister reg = FPRegister::from_code(i);
Rodolph Perfetta (ARM) 2014/01/31 14:50:28 const FPRegister&
526 __ Ldr(reg, MemOperand(x1, src_offset));
Rodolph Perfetta (ARM) 2014/01/31 14:50:28 maybe add a todo to insider ldp later on.
527 src_offset += kDoubleSize;
528 }
519 529
520 // Push state, pc, and continuation from the last output frame. 530 // Push state, pc, and continuation from the last output frame.
521 if (type() != OSR) { 531 if (type() != OSR) {
522 __ Ldr(x6, MemOperand(current_frame, FrameDescription::state_offset())); 532 __ Ldr(x6, MemOperand(current_frame, FrameDescription::state_offset()));
523 __ Push(x6); 533 __ Push(x6);
524 } 534 }
525 535
526 // TODO(all): This code needs to be revisited, We probably don't need to 536 // TODO(all): This code needs to be revisited, We probably don't need to
527 // restore all the registers as fullcodegen does not keep live values in 537 // restore all the registers as fullcodegen does not keep live values in
528 // registers (note that at least fp must be restored though). 538 // registers (note that at least fp must be restored though).
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 604
595 605
596 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) { 606 void FrameDescription::SetCallerFp(unsigned offset, intptr_t value) {
597 SetFrameSlot(offset, value); 607 SetFrameSlot(offset, value);
598 } 608 }
599 609
600 610
601 #undef __ 611 #undef __
602 612
603 } } // namespace v8::internal 613 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/assembler-a64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698