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 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 __ pop(r1); | 1219 __ pop(r1); |
1220 | 1220 |
1221 // Tear down internal frame. | 1221 // Tear down internal frame. |
1222 } | 1222 } |
1223 | 1223 |
1224 // Do a tail-call of the compiled function. | 1224 // Do a tail-call of the compiled function. |
1225 __ Jump(r2); | 1225 __ Jump(r2); |
1226 } | 1226 } |
1227 | 1227 |
1228 | 1228 |
| 1229 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { |
| 1230 // For now, we are relying on the fact that make_code_young doesn't do any |
| 1231 // garbage collection which allows us to save/restore the registers without |
| 1232 // worrying about which of them contain pointers. We also don't build an |
| 1233 // internal frame to make the code faster, since we shouldn't have to do stack |
| 1234 // crawls in MakeCodeYoung. This seems a bit fragile. |
| 1235 |
| 1236 // The following registers must be saved and restored when calling through to |
| 1237 // the runtime: |
| 1238 // r0 - contains return address (beginning of patch sequence) |
| 1239 // r1 - function object |
| 1240 FrameScope scope(masm, StackFrame::MANUAL); |
| 1241 __ stm(db_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); |
| 1242 __ PrepareCallCFunction(1, 0, r1); |
| 1243 __ CallCFunction( |
| 1244 ExternalReference::get_make_code_young_function(masm->isolate()), 1); |
| 1245 __ ldm(ia_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); |
| 1246 __ mov(pc, r0); |
| 1247 } |
| 1248 |
| 1249 #define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \ |
| 1250 void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \ |
| 1251 MacroAssembler* masm) { \ |
| 1252 GenerateMakeCodeYoungAgainCommon(masm); \ |
| 1253 } \ |
| 1254 void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \ |
| 1255 MacroAssembler* masm) { \ |
| 1256 GenerateMakeCodeYoungAgainCommon(masm); \ |
| 1257 } |
| 1258 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) |
| 1259 #undef DEFINE_CODE_AGE_BUILTIN_GENERATOR |
| 1260 |
| 1261 |
1229 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, | 1262 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
1230 Deoptimizer::BailoutType type) { | 1263 Deoptimizer::BailoutType type) { |
1231 { | 1264 { |
1232 FrameScope scope(masm, StackFrame::INTERNAL); | 1265 FrameScope scope(masm, StackFrame::INTERNAL); |
1233 // Pass the function and deoptimization type to the runtime system. | 1266 // Pass the function and deoptimization type to the runtime system. |
1234 __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); | 1267 __ mov(r0, Operand(Smi::FromInt(static_cast<int>(type)))); |
1235 __ push(r0); | 1268 __ push(r0); |
1236 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | 1269 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
1237 } | 1270 } |
1238 | 1271 |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 __ bind(&dont_adapt_arguments); | 1832 __ bind(&dont_adapt_arguments); |
1800 __ Jump(r3); | 1833 __ Jump(r3); |
1801 } | 1834 } |
1802 | 1835 |
1803 | 1836 |
1804 #undef __ | 1837 #undef __ |
1805 | 1838 |
1806 } } // namespace v8::internal | 1839 } } // namespace v8::internal |
1807 | 1840 |
1808 #endif // V8_TARGET_ARCH_ARM | 1841 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |