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 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 __ lea(rax, Operand(rax, rbx, times_1, Code::kHeaderSize - kHeapObjectTag)); | 1394 __ lea(rax, Operand(rax, rbx, times_1, Code::kHeaderSize - kHeapObjectTag)); |
1395 | 1395 |
1396 // Overwrite the return address on the stack. | 1396 // Overwrite the return address on the stack. |
1397 __ movq(Operand(rsp, 0), rax); | 1397 __ movq(Operand(rsp, 0), rax); |
1398 | 1398 |
1399 // And "return" to the OSR entry point of the function. | 1399 // And "return" to the OSR entry point of the function. |
1400 __ ret(0); | 1400 __ ret(0); |
1401 } | 1401 } |
1402 | 1402 |
1403 | 1403 |
| 1404 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
| 1405 // We check the stack limit as indicator that recompilation might be done. |
| 1406 Label ok; |
| 1407 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); |
| 1408 __ j(above_equal, &ok); |
| 1409 { |
| 1410 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1411 __ CallRuntime(Runtime::kStackGuard, 0); |
| 1412 } |
| 1413 __ jmp(masm->isolate()->builtins()->OnStackReplacement(), |
| 1414 RelocInfo::CODE_TARGET); |
| 1415 |
| 1416 __ bind(&ok); |
| 1417 __ ret(0); |
| 1418 } |
| 1419 |
| 1420 |
1404 #undef __ | 1421 #undef __ |
1405 | 1422 |
1406 } } // namespace v8::internal | 1423 } } // namespace v8::internal |
1407 | 1424 |
1408 #endif // V8_TARGET_ARCH_X64 | 1425 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |