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 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 __ movp(rbx, Operand(rax, Code::kDeoptimizationDataOffset - kHeapObjectTag)); | 1405 __ movp(rbx, Operand(rax, Code::kDeoptimizationDataOffset - kHeapObjectTag)); |
1406 | 1406 |
1407 // Load the OSR entrypoint offset from the deoptimization data. | 1407 // Load the OSR entrypoint offset from the deoptimization data. |
1408 __ SmiToInteger32(rbx, Operand(rbx, FixedArray::OffsetOfElementAt( | 1408 __ SmiToInteger32(rbx, Operand(rbx, FixedArray::OffsetOfElementAt( |
1409 DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag)); | 1409 DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag)); |
1410 | 1410 |
1411 // Compute the target address = code_obj + header_size + osr_offset | 1411 // Compute the target address = code_obj + header_size + osr_offset |
1412 __ lea(rax, Operand(rax, rbx, times_1, Code::kHeaderSize - kHeapObjectTag)); | 1412 __ lea(rax, Operand(rax, rbx, times_1, Code::kHeaderSize - kHeapObjectTag)); |
1413 | 1413 |
1414 // Overwrite the return address on the stack. | 1414 // Overwrite the return address on the stack. |
1415 __ movq(Operand(rsp, 0), rax); | 1415 __ movq(StackOperandForReturnAddress(0), rax); |
1416 | 1416 |
1417 // And "return" to the OSR entry point of the function. | 1417 // And "return" to the OSR entry point of the function. |
1418 __ ret(0); | 1418 __ ret(0); |
1419 } | 1419 } |
1420 | 1420 |
1421 | 1421 |
1422 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { | 1422 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
1423 // We check the stack limit as indicator that recompilation might be done. | 1423 // We check the stack limit as indicator that recompilation might be done. |
1424 Label ok; | 1424 Label ok; |
1425 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); | 1425 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); |
1426 __ j(above_equal, &ok); | 1426 __ j(above_equal, &ok); |
1427 { | 1427 { |
1428 FrameScope scope(masm, StackFrame::INTERNAL); | 1428 FrameScope scope(masm, StackFrame::INTERNAL); |
1429 __ CallRuntime(Runtime::kStackGuard, 0); | 1429 __ CallRuntime(Runtime::kStackGuard, 0); |
1430 } | 1430 } |
1431 __ jmp(masm->isolate()->builtins()->OnStackReplacement(), | 1431 __ jmp(masm->isolate()->builtins()->OnStackReplacement(), |
1432 RelocInfo::CODE_TARGET); | 1432 RelocInfo::CODE_TARGET); |
1433 | 1433 |
1434 __ bind(&ok); | 1434 __ bind(&ok); |
1435 __ ret(0); | 1435 __ ret(0); |
1436 } | 1436 } |
1437 | 1437 |
1438 | 1438 |
1439 #undef __ | 1439 #undef __ |
1440 | 1440 |
1441 } } // namespace v8::internal | 1441 } } // namespace v8::internal |
1442 | 1442 |
1443 #endif // V8_TARGET_ARCH_X64 | 1443 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |