| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 __ neg(edx); | 543 __ neg(edx); |
| 544 | 544 |
| 545 // Allocate a new deoptimizer object. | 545 // Allocate a new deoptimizer object. |
| 546 __ PrepareCallCFunction(5, eax); | 546 __ PrepareCallCFunction(5, eax); |
| 547 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 547 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 548 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. | 548 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. |
| 549 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. | 549 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. |
| 550 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. | 550 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. |
| 551 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. | 551 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. |
| 552 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. | 552 __ mov(Operand(esp, 4 * kPointerSize), edx); // Fp-to-sp delta. |
| 553 __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5); | 553 __ CallCFunction( |
| 554 ExternalReference::new_deoptimizer_function(masm()->isolate()), |
| 555 5); |
| 554 | 556 |
| 555 // Preserve deoptimizer object in register eax and get the input | 557 // Preserve deoptimizer object in register eax and get the input |
| 556 // frame descriptor pointer. | 558 // frame descriptor pointer. |
| 557 __ mov(ebx, Operand(eax, Deoptimizer::input_offset())); | 559 __ mov(ebx, Operand(eax, Deoptimizer::input_offset())); |
| 558 | 560 |
| 559 // Fill in the input registers. | 561 // Fill in the input registers. |
| 560 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { | 562 for (int i = kNumberOfRegisters - 1; i >= 0; i--) { |
| 561 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 563 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
| 562 __ pop(Operand(ebx, offset)); | 564 __ pop(Operand(ebx, offset)); |
| 563 } | 565 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 591 __ bind(&pop_loop); | 593 __ bind(&pop_loop); |
| 592 __ pop(Operand(edx, 0)); | 594 __ pop(Operand(edx, 0)); |
| 593 __ add(Operand(edx), Immediate(sizeof(uint32_t))); | 595 __ add(Operand(edx), Immediate(sizeof(uint32_t))); |
| 594 __ cmp(ecx, Operand(esp)); | 596 __ cmp(ecx, Operand(esp)); |
| 595 __ j(not_equal, &pop_loop); | 597 __ j(not_equal, &pop_loop); |
| 596 | 598 |
| 597 // Compute the output frame in the deoptimizer. | 599 // Compute the output frame in the deoptimizer. |
| 598 __ push(eax); | 600 __ push(eax); |
| 599 __ PrepareCallCFunction(1, ebx); | 601 __ PrepareCallCFunction(1, ebx); |
| 600 __ mov(Operand(esp, 0 * kPointerSize), eax); | 602 __ mov(Operand(esp, 0 * kPointerSize), eax); |
| 601 __ CallCFunction(ExternalReference::compute_output_frames_function(), 1); | 603 __ CallCFunction( |
| 604 ExternalReference::compute_output_frames_function(masm()->isolate()), |
| 605 1); |
| 602 __ pop(eax); | 606 __ pop(eax); |
| 603 | 607 |
| 604 // Replace the current frame with the output frames. | 608 // Replace the current frame with the output frames. |
| 605 Label outer_push_loop, inner_push_loop; | 609 Label outer_push_loop, inner_push_loop; |
| 606 // Outer loop state: eax = current FrameDescription**, edx = one past the | 610 // Outer loop state: eax = current FrameDescription**, edx = one past the |
| 607 // last FrameDescription**. | 611 // last FrameDescription**. |
| 608 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); | 612 __ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); |
| 609 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); | 613 __ mov(eax, Operand(eax, Deoptimizer::output_offset())); |
| 610 __ lea(edx, Operand(eax, edx, times_4, 0)); | 614 __ lea(edx, Operand(eax, edx, times_4, 0)); |
| 611 __ bind(&outer_push_loop); | 615 __ bind(&outer_push_loop); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 } | 668 } |
| 665 __ bind(&done); | 669 __ bind(&done); |
| 666 } | 670 } |
| 667 | 671 |
| 668 #undef __ | 672 #undef __ |
| 669 | 673 |
| 670 | 674 |
| 671 } } // namespace v8::internal | 675 } } // namespace v8::internal |
| 672 | 676 |
| 673 #endif // V8_TARGET_ARCH_IA32 | 677 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |