Index: src/ia32/builtins-ia32.cc |
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc |
index 9bc15e90986c54048aa950b7bac9b3391ba0c0be..01785bb53e25400eda7668ffd94fb3e12088a374 100644 |
--- a/src/ia32/builtins-ia32.cc |
+++ b/src/ia32/builtins-ia32.cc |
@@ -538,6 +538,42 @@ void Builtins::Generate_LazyRecompile(MacroAssembler* masm) { |
} |
+static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { |
+ // For now, we are relying on the fact that make_code_young doesn't do any |
+ // garbage collection which allows us to save/restore the registers without |
+ // worrying about which of them contain pointers. We also don't build an |
+ // internal frame to make the code faster, since we shouldn't have to do stack |
+ // crawls in MakeCodeYoung. This seems a bit fragile. |
+ |
+ // Re-execute the code that was patched back to the young age when |
+ // the stub returns. |
+ __ sub(Operand(esp, 0), Immediate(5)); |
+ __ pushad(); |
+ __ mov(eax, Operand(esp, 8 * kPointerSize)); |
+ { |
+ FrameScope scope(masm, StackFrame::MANUAL); |
+ __ PrepareCallCFunction(1, ebx); |
+ __ mov(Operand(esp, 0), eax); |
+ __ CallCFunction( |
+ ExternalReference::get_make_code_young_function(masm->isolate()), 1); |
+ } |
+ __ popad(); |
+ __ ret(0); |
+} |
+ |
+#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \ |
+void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \ |
+ MacroAssembler* masm) { \ |
+ GenerateMakeCodeYoungAgainCommon(masm); \ |
+} \ |
+void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \ |
+ MacroAssembler* masm) { \ |
+ GenerateMakeCodeYoungAgainCommon(masm); \ |
+} |
+CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) |
+#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR |
+ |
+ |
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
Deoptimizer::BailoutType type) { |
{ |