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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 __ pop(a1); | 1248 __ pop(a1); |
1249 | 1249 |
1250 // Tear down temporary frame. | 1250 // Tear down temporary frame. |
1251 } | 1251 } |
1252 | 1252 |
1253 // Do a tail-call of the compiled function. | 1253 // Do a tail-call of the compiled function. |
1254 __ Jump(t9); | 1254 __ Jump(t9); |
1255 } | 1255 } |
1256 | 1256 |
1257 | 1257 |
1258 // Just a dummy for now, so snapshot generation works. | |
1259 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { | 1258 static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) { |
1260 __ Ret(); | 1259 // For now, we are relying on the fact that make_code_young doesn't do any |
| 1260 // garbage collection which allows us to save/restore the registers without |
| 1261 // worrying about which of them contain pointers. We also don't build an |
| 1262 // internal frame to make the code faster, since we shouldn't have to do stack |
| 1263 // crawls in MakeCodeYoung. This seems a bit fragile. |
| 1264 |
| 1265 __ mov(a0, ra); |
| 1266 // Adjust a0 to point to the head of the PlatformCodeAge sequence |
| 1267 __ Subu(a0, a0, |
| 1268 Operand((kNoCodeAgeSequenceLength - 1) * Assembler::kInstrSize)); |
| 1269 // Restore the original return address of the function |
| 1270 __ mov(ra, at); |
| 1271 |
| 1272 // The following registers must be saved and restored when calling through to |
| 1273 // the runtime: |
| 1274 // a0 - contains return address (beginning of patch sequence) |
| 1275 // a1 - function object |
| 1276 RegList saved_regs = |
| 1277 (a0.bit() | a1.bit() | ra.bit() | fp.bit()) & ~sp.bit(); |
| 1278 FrameScope scope(masm, StackFrame::MANUAL); |
| 1279 __ MultiPush(saved_regs); |
| 1280 __ PrepareCallCFunction(1, 0, a1); |
| 1281 __ CallCFunction( |
| 1282 ExternalReference::get_make_code_young_function(masm->isolate()), 1); |
| 1283 __ MultiPop(saved_regs); |
| 1284 __ Jump(a0); |
1261 } | 1285 } |
1262 | 1286 |
1263 | |
1264 #define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \ | 1287 #define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \ |
1265 void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \ | 1288 void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \ |
1266 MacroAssembler* masm) { \ | 1289 MacroAssembler* masm) { \ |
1267 GenerateMakeCodeYoungAgainCommon(masm); \ | 1290 GenerateMakeCodeYoungAgainCommon(masm); \ |
1268 } \ | 1291 } \ |
1269 void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \ | 1292 void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \ |
1270 MacroAssembler* masm) { \ | 1293 MacroAssembler* masm) { \ |
1271 GenerateMakeCodeYoungAgainCommon(masm); \ | 1294 GenerateMakeCodeYoungAgainCommon(masm); \ |
1272 } | 1295 } |
1273 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) | 1296 CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR) |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1855 __ bind(&dont_adapt_arguments); | 1878 __ bind(&dont_adapt_arguments); |
1856 __ Jump(a3); | 1879 __ Jump(a3); |
1857 } | 1880 } |
1858 | 1881 |
1859 | 1882 |
1860 #undef __ | 1883 #undef __ |
1861 | 1884 |
1862 } } // namespace v8::internal | 1885 } } // namespace v8::internal |
1863 | 1886 |
1864 #endif // V8_TARGET_ARCH_MIPS | 1887 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |