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

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

Issue 78283002: Restore saved caller FP registers on stub failure (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Port to ia32, arm, and mips Created 7 years, 1 month 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/deoptimizer.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // Jump to point after the code-age stub. 594 // Jump to point after the code-age stub.
595 __ ret(0); 595 __ ret(0);
596 } 596 }
597 597
598 598
599 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { 599 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
600 GenerateMakeCodeYoungAgainCommon(masm); 600 GenerateMakeCodeYoungAgainCommon(masm);
601 } 601 }
602 602
603 603
604 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { 604 static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
605 SaveFPRegsMode save_doubles) {
605 // Enter an internal frame. 606 // Enter an internal frame.
606 { 607 {
607 FrameScope scope(masm, StackFrame::INTERNAL); 608 FrameScope scope(masm, StackFrame::INTERNAL);
608 609
609 // Preserve registers across notification, this is important for compiled 610 // Preserve registers across notification, this is important for compiled
610 // stubs that tail call the runtime on deopts passing their parameters in 611 // stubs that tail call the runtime on deopts passing their parameters in
611 // registers. 612 // registers.
612 __ pushad(); 613 __ pushad();
613 __ CallRuntime(Runtime::kNotifyStubFailure, 0); 614 __ CallRuntime(Runtime::kNotifyStubFailure, 0, save_doubles);
614 __ popad(); 615 __ popad();
615 // Tear down internal frame. 616 // Tear down internal frame.
616 } 617 }
617 618
618 __ pop(MemOperand(esp, 0)); // Ignore state offset 619 __ pop(MemOperand(esp, 0)); // Ignore state offset
619 __ ret(0); // Return to IC Miss stub, continuation still on stack. 620 __ ret(0); // Return to IC Miss stub, continuation still on stack.
620 } 621 }
621 622
622 623
624 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
625 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
626 }
627
628
629 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
630 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
631 }
632
633
623 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, 634 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
624 Deoptimizer::BailoutType type) { 635 Deoptimizer::BailoutType type) {
625 { 636 {
626 FrameScope scope(masm, StackFrame::INTERNAL); 637 FrameScope scope(masm, StackFrame::INTERNAL);
627 638
628 // Pass deoptimization type to the runtime system. 639 // Pass deoptimization type to the runtime system.
629 __ push(Immediate(Smi::FromInt(static_cast<int>(type)))); 640 __ push(Immediate(Smi::FromInt(static_cast<int>(type))));
630 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); 641 __ CallRuntime(Runtime::kNotifyDeoptimized, 1);
631 642
632 // Tear down internal frame. 643 // Tear down internal frame.
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 1372
1362 __ bind(&ok); 1373 __ bind(&ok);
1363 __ ret(0); 1374 __ ret(0);
1364 } 1375 }
1365 1376
1366 #undef __ 1377 #undef __
1367 } 1378 }
1368 } // namespace v8::internal 1379 } // namespace v8::internal
1369 1380
1370 #endif // V8_TARGET_ARCH_IA32 1381 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698