OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 1149 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
1150 } | 1150 } |
1151 | 1151 |
1152 | 1152 |
1153 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { | 1153 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { |
1154 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 1154 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
1155 } | 1155 } |
1156 | 1156 |
1157 | 1157 |
1158 void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { | 1158 void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { |
1159 __ stop("builtins-arm.cc: NotifyOSR"); | 1159 // For now, we are relying on the fact that Runtime::NotifyOSR |
| 1160 // doesn't do any garbage collection which allows us to save/restore |
| 1161 // the registers without worrying about which of them contain |
| 1162 // pointers. This seems a bit fragile. |
| 1163 __ stm(db_w, sp, kJSCallerSaved | kCalleeSaved | lr.bit() | fp.bit()); |
| 1164 __ EnterInternalFrame(); |
| 1165 __ CallRuntime(Runtime::kNotifyOSR, 0); |
| 1166 __ LeaveInternalFrame(); |
| 1167 __ ldm(ia_w, sp, kJSCallerSaved | kCalleeSaved | lr.bit() | fp.bit()); |
| 1168 __ Ret(); |
1160 } | 1169 } |
1161 | 1170 |
1162 | 1171 |
1163 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { | 1172 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
1164 __ stop("builtins-arm.cc: OnStackReplacement"); | 1173 // Probe the CPU to set the supported features, because this builtin |
| 1174 // may be called before the initialization performs CPU setup. |
| 1175 CpuFeatures::Probe(false); |
| 1176 |
| 1177 // Lookup the function in the JavaScript frame and push it as an |
| 1178 // argument to the on-stack replacement function. |
| 1179 __ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1180 __ EnterInternalFrame(); |
| 1181 __ push(r0); |
| 1182 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); |
| 1183 __ LeaveInternalFrame(); |
| 1184 |
| 1185 // If the result was -1 it means that we couldn't optimize the |
| 1186 // function. Just return and continue in the unoptimized version. |
| 1187 Label skip; |
| 1188 __ cmp(r0, Operand(Smi::FromInt(-1))); |
| 1189 __ b(ne, &skip); |
| 1190 __ Ret(); |
| 1191 |
| 1192 __ bind(&skip); |
| 1193 // Untag the AST id and push it on the stack. |
| 1194 __ SmiUntag(r0); |
| 1195 __ push(r0); |
| 1196 |
| 1197 // Generate the code for doing the frame-to-frame translation using |
| 1198 // the deoptimizer infrastructure. |
| 1199 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1200 generator.Generate(); |
1165 } | 1201 } |
1166 | 1202 |
1167 | 1203 |
1168 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { | 1204 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { |
1169 // 1. Make sure we have at least one argument. | 1205 // 1. Make sure we have at least one argument. |
1170 // r0: actual number of arguments | 1206 // r0: actual number of arguments |
1171 { Label done; | 1207 { Label done; |
1172 __ tst(r0, Operand(r0)); | 1208 __ tst(r0, Operand(r0)); |
1173 __ b(ne, &done); | 1209 __ b(ne, &done); |
1174 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | 1210 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 __ bind(&dont_adapt_arguments); | 1601 __ bind(&dont_adapt_arguments); |
1566 __ Jump(r3); | 1602 __ Jump(r3); |
1567 } | 1603 } |
1568 | 1604 |
1569 | 1605 |
1570 #undef __ | 1606 #undef __ |
1571 | 1607 |
1572 } } // namespace v8::internal | 1608 } } // namespace v8::internal |
1573 | 1609 |
1574 #endif // V8_TARGET_ARCH_ARM | 1610 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |