Chromium Code Reviews| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 554 __ LeaveInternalFrame(); | 554 __ LeaveInternalFrame(); |
| 555 | 555 |
| 556 // Do a tail-call of the compiled function. | 556 // Do a tail-call of the compiled function. |
| 557 __ lea(rcx, FieldOperand(rax, Code::kHeaderSize)); | 557 __ lea(rcx, FieldOperand(rax, Code::kHeaderSize)); |
| 558 __ jmp(rcx); | 558 __ jmp(rcx); |
| 559 } | 559 } |
| 560 | 560 |
| 561 | 561 |
| 562 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, | 562 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
| 563 Deoptimizer::BailoutType type) { | 563 Deoptimizer::BailoutType type) { |
| 564 __ int3(); | 564 // Enter an internal frame. |
| 565 __ EnterInternalFrame(); | |
| 566 | |
| 567 // Pass the function and deoptimization type to the runtime system. | |
|
Kevin Millikin (Chromium)
2011/01/24 13:52:21
This comment isn't correct. We grab the function
Rico
2011/01/25 07:48:16
Done.
| |
| 568 __ Push(Smi::FromInt(static_cast<int>(type))); | |
| 569 | |
| 570 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | |
| 571 // Tear down temporary frame. | |
| 572 __ LeaveInternalFrame(); | |
| 573 | |
| 574 // Get the full codegen state from the stack and untag it. | |
| 575 __ movq(rcx, Operand(rsp, 1 * kPointerSize)); | |
| 576 __ SmiToInteger32(rcx, rcx); | |
|
Lasse Reichstein
2011/01/24 13:24:21
You can use
SmiToInteger32(rcx, Operand(rsp, 1 *
Rico
2011/01/24 13:40:14
Done.
| |
| 577 | |
| 578 // Switch on the state. | |
| 579 NearLabel not_no_registers, not_tos_eax; | |
|
Lasse Reichstein
2011/01/24 13:24:21
eax->rax
Rico
2011/01/24 13:40:14
Done.
| |
| 580 __ cmpq(rcx, Immediate(FullCodeGenerator::NO_REGISTERS)); | |
| 581 __ j(not_equal, ¬_no_registers); | |
| 582 __ ret(1 * kPointerSize); // Remove state. | |
| 583 | |
| 584 __ bind(¬_no_registers); | |
| 585 __ movq(rax, Operand(rsp, 2 * kPointerSize)); | |
| 586 __ cmpq(rcx, Immediate(FullCodeGenerator::TOS_REG)); | |
| 587 __ j(not_equal, ¬_tos_eax); | |
| 588 __ ret(2 * kPointerSize); // Remove state, eax. | |
| 589 | |
| 590 __ bind(¬_tos_eax); | |
| 591 __ Abort("no cases left"); | |
| 565 } | 592 } |
| 566 | 593 |
| 567 void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { | 594 void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { |
| 568 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 595 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
| 569 } | 596 } |
| 570 | 597 |
| 571 | 598 |
| 572 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { | 599 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { |
| 573 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 600 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
| 574 } | 601 } |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1382 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { | 1409 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
| 1383 __ int3(); | 1410 __ int3(); |
| 1384 } | 1411 } |
| 1385 | 1412 |
| 1386 | 1413 |
| 1387 #undef __ | 1414 #undef __ |
| 1388 | 1415 |
| 1389 } } // namespace v8::internal | 1416 } } // namespace v8::internal |
| 1390 | 1417 |
| 1391 #endif // V8_TARGET_ARCH_X64 | 1418 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |