Index: src/arm/builtins-arm.cc |
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
index 2d1d7b1199712556880ac857eec03ab7facc2aa6..24d14e8c8a1efb62bbea08e366f4f1816bbd9d1f 100644 |
--- a/src/arm/builtins-arm.cc |
+++ b/src/arm/builtins-arm.cc |
@@ -1226,6 +1226,39 @@ 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. |
+ |
+ // The following registers must be saved and restored when calling through to |
+ // the runtime: |
+ // r0 - contains return address (beginning of patch sequence) |
+ // r1 - function object |
+ FrameScope scope(masm, StackFrame::MANUAL); |
+ __ stm(db_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); |
+ __ PrepareCallCFunction(1, 0, r1); |
+ __ CallCFunction( |
+ ExternalReference::get_make_code_young_function(masm->isolate()), 1); |
+ __ ldm(ia_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); |
+ __ mov(pc, r0); |
+} |
+ |
+#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) { |
{ |