OLD | NEW |
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 | 531 |
532 // Tear down internal frame. | 532 // Tear down internal frame. |
533 } | 533 } |
534 | 534 |
535 // Do a tail-call of the compiled function. | 535 // Do a tail-call of the compiled function. |
536 __ lea(eax, FieldOperand(eax, Code::kHeaderSize)); | 536 __ lea(eax, FieldOperand(eax, Code::kHeaderSize)); |
537 __ jmp(eax); | 537 __ jmp(eax); |
538 } | 538 } |
539 | 539 |
540 | 540 |
| 541 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { |
| 542 // For now, we are relying on the fact that make_code_young doesn't do any |
| 543 // garbage collection which allows us to save/restore the registers without |
| 544 // worrying about which of them contain pointers. We also don't build an |
| 545 // internal frame to make the code faster, since we shouldn't have to do stack |
| 546 // crawls in MakeCodeYoung. This seems a bit fragile. |
| 547 |
| 548 // Re-execute the code that was patched back to the young age when |
| 549 // the stub returns. |
| 550 __ sub(Operand(esp, 0), Immediate(5)); |
| 551 __ pushad(); |
| 552 __ mov(eax, Operand(esp, 8 * kPointerSize)); |
| 553 { |
| 554 FrameScope scope(masm, StackFrame::MANUAL); |
| 555 __ PrepareCallCFunction(1, ebx); |
| 556 __ mov(Operand(esp, 0), eax); |
| 557 __ CallCFunction( |
| 558 ExternalReference::get_make_code_young_function(masm->isolate()), 1); |
| 559 } |
| 560 __ popad(); |
| 561 __ ret(0); |
| 562 } |
| 563 |
| 564 #define DECLARE_CODE_AGE_BUILTIN_GENERATOR(C) \ |
| 565 void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \ |
| 566 MacroAssembler* masm) { \ |
| 567 GenerateMakeCodeYoungAgainCommon(masm); \ |
| 568 } \ |
| 569 void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \ |
| 570 MacroAssembler* masm) { \ |
| 571 GenerateMakeCodeYoungAgainCommon(masm); \ |
| 572 } |
| 573 CODE_AGE_LIST(DECLARE_CODE_AGE_BUILTIN_GENERATOR) |
| 574 #undef DECLARE_CODE_AGE_BUILTIN_GENERATOR |
| 575 |
| 576 |
541 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, | 577 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
542 Deoptimizer::BailoutType type) { | 578 Deoptimizer::BailoutType type) { |
543 { | 579 { |
544 FrameScope scope(masm, StackFrame::INTERNAL); | 580 FrameScope scope(masm, StackFrame::INTERNAL); |
545 | 581 |
546 // Pass deoptimization type to the runtime system. | 582 // Pass deoptimization type to the runtime system. |
547 __ push(Immediate(Smi::FromInt(static_cast<int>(type)))); | 583 __ push(Immediate(Smi::FromInt(static_cast<int>(type)))); |
548 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | 584 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
549 | 585 |
550 // Tear down internal frame. | 586 // Tear down internal frame. |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1803 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1768 generator.Generate(); | 1804 generator.Generate(); |
1769 } | 1805 } |
1770 | 1806 |
1771 | 1807 |
1772 #undef __ | 1808 #undef __ |
1773 } | 1809 } |
1774 } // namespace v8::internal | 1810 } // namespace v8::internal |
1775 | 1811 |
1776 #endif // V8_TARGET_ARCH_IA32 | 1812 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |