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

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

Issue 7084032: Add asserts and state tracking to ensure that we do not call (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 6 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 // Allocate a new deoptimizer object. 643 // Allocate a new deoptimizer object.
644 __ PrepareCallCFunction(6, eax); 644 __ PrepareCallCFunction(6, eax);
645 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 645 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
646 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. 646 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function.
647 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. 647 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type.
648 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. 648 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id.
649 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. 649 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0.
650 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. 650 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta.
651 __ mov(Operand(esp, 5 * kPointerSize), 651 __ mov(Operand(esp, 5 * kPointerSize),
652 Immediate(ExternalReference::isolate_address())); 652 Immediate(ExternalReference::isolate_address()));
653 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6); 653 {
654 // The new deoptimizer function cannot cause a GC so it's OK to call it
655 // without having a real frame on the stack. This scoped object will
656 // avoid an assert caused by the frame not being in place when we call into
657 // C++.
658 FrameScope scope(masm(), StackFrame::NONE);
659 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate), 6);
660 }
654 661
655 // Preserve deoptimizer object in register eax and get the input 662 // Preserve deoptimizer object in register eax and get the input
656 // frame descriptor pointer. 663 // frame descriptor pointer.
657 __ mov(ebx, Operand(eax, Deoptimizer::input_offset())); 664 __ mov(ebx, Operand(eax, Deoptimizer::input_offset()));
658 665
659 // Fill in the input registers. 666 // Fill in the input registers.
660 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { 667 for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
661 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); 668 int offset = (i * kPointerSize) + FrameDescription::registers_offset();
662 __ pop(Operand(ebx, offset)); 669 __ pop(Operand(ebx, offset));
663 } 670 }
(...skipping 27 matching lines...) Expand all
691 __ bind(&pop_loop); 698 __ bind(&pop_loop);
692 __ pop(Operand(edx, 0)); 699 __ pop(Operand(edx, 0));
693 __ add(Operand(edx), Immediate(sizeof(uint32_t))); 700 __ add(Operand(edx), Immediate(sizeof(uint32_t)));
694 __ cmp(ecx, Operand(esp)); 701 __ cmp(ecx, Operand(esp));
695 __ j(not_equal, &pop_loop); 702 __ j(not_equal, &pop_loop);
696 703
697 // Compute the output frame in the deoptimizer. 704 // Compute the output frame in the deoptimizer.
698 __ push(eax); 705 __ push(eax);
699 __ PrepareCallCFunction(1, ebx); 706 __ PrepareCallCFunction(1, ebx);
700 __ mov(Operand(esp, 0 * kPointerSize), eax); 707 __ mov(Operand(esp, 0 * kPointerSize), eax);
701 __ CallCFunction( 708 {
702 ExternalReference::compute_output_frames_function(isolate), 1); 709 // The compute output frames function cannot cause a GC so it's OK to call
710 // it without having a real frame on the stack. This scoped object will
711 // avoid an assert caused by the frame not being in place when we call into
712 // C++.
713 FrameScope scope(masm(), StackFrame::NONE);
714 __ CallCFunction(
715 ExternalReference::compute_output_frames_function(isolate), 1);
716 }
703 __ pop(eax); 717 __ pop(eax);
704 718
705 // Replace the current frame with the output frames. 719 // Replace the current frame with the output frames.
706 Label outer_push_loop, inner_push_loop; 720 Label outer_push_loop, inner_push_loop;
707 // Outer loop state: eax = current FrameDescription**, edx = one past the 721 // Outer loop state: eax = current FrameDescription**, edx = one past the
708 // last FrameDescription**. 722 // last FrameDescription**.
709 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); 723 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset()));
710 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); 724 __ mov(eax, Operand(eax, Deoptimizer::output_offset()));
711 __ lea(edx, Operand(eax, edx, times_4, 0)); 725 __ lea(edx, Operand(eax, edx, times_4, 0));
712 __ bind(&outer_push_loop); 726 __ bind(&outer_push_loop);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 } 779 }
766 __ bind(&done); 780 __ bind(&done);
767 } 781 }
768 782
769 #undef __ 783 #undef __
770 784
771 785
772 } } // namespace v8::internal 786 } } // namespace v8::internal
773 787
774 #endif // V8_TARGET_ARCH_IA32 788 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698