| 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 7748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7759 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { | 7759 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
| 7760 if (entry_hook_ != NULL) { | 7760 if (entry_hook_ != NULL) { |
| 7761 ProfileEntryHookStub stub; | 7761 ProfileEntryHookStub stub; |
| 7762 masm->CallStub(&stub); | 7762 masm->CallStub(&stub); |
| 7763 } | 7763 } |
| 7764 } | 7764 } |
| 7765 | 7765 |
| 7766 | 7766 |
| 7767 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { | 7767 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { |
| 7768 // Ecx is the only volatile register we must save. | 7768 // Ecx is the only volatile register we must save. |
| 7769 const int kNumSavedRegisters = 1; |
| 7769 __ push(ecx); | 7770 __ push(ecx); |
| 7770 | 7771 |
| 7771 // Calculate and push the original stack pointer. | 7772 // Calculate and push the original stack pointer. |
| 7772 __ lea(eax, Operand(esp, kPointerSize)); | 7773 __ lea(eax, Operand(esp, (kNumSavedRegisters + 1) * kPointerSize)); |
| 7773 __ push(eax); | 7774 __ push(eax); |
| 7774 | 7775 |
| 7775 // Calculate and push the function address. | 7776 // Retrieve our return address and use it to calculate the calling |
| 7776 __ mov(eax, Operand(eax, 0)); | 7777 // function's address. |
| 7778 __ mov(eax, Operand(esp, (kNumSavedRegisters + 1) * kPointerSize)); |
| 7777 __ sub(eax, Immediate(Assembler::kCallInstructionLength)); | 7779 __ sub(eax, Immediate(Assembler::kCallInstructionLength)); |
| 7778 __ push(eax); | 7780 __ push(eax); |
| 7779 | 7781 |
| 7780 // Call the entry hook. | 7782 // Call the entry hook. |
| 7781 int32_t hook_location = reinterpret_cast<int32_t>(&entry_hook_); | 7783 int32_t hook_location = reinterpret_cast<int32_t>(&entry_hook_); |
| 7782 __ call(Operand(hook_location, RelocInfo::NONE32)); | 7784 __ call(Operand(hook_location, RelocInfo::NONE32)); |
| 7783 __ add(esp, Immediate(2 * kPointerSize)); | 7785 __ add(esp, Immediate(2 * kPointerSize)); |
| 7784 | 7786 |
| 7785 // Restore ecx. | 7787 // Restore ecx. |
| 7786 __ pop(ecx); | 7788 __ pop(ecx); |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8089 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 8091 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 8090 } | 8092 } |
| 8091 } | 8093 } |
| 8092 | 8094 |
| 8093 | 8095 |
| 8094 #undef __ | 8096 #undef __ |
| 8095 | 8097 |
| 8096 } } // namespace v8::internal | 8098 } } // namespace v8::internal |
| 8097 | 8099 |
| 8098 #endif // V8_TARGET_ARCH_IA32 | 8100 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |