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 6402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6413 __ movq(r9, FieldOperand(rbx, JSObject::kElementsOffset)); | 6413 __ movq(r9, FieldOperand(rbx, JSObject::kElementsOffset)); |
6414 __ SmiToInteger32(r11, rcx); | 6414 __ SmiToInteger32(r11, rcx); |
6415 __ StoreNumberToDoubleElements(rax, | 6415 __ StoreNumberToDoubleElements(rax, |
6416 r9, | 6416 r9, |
6417 r11, | 6417 r11, |
6418 xmm0, | 6418 xmm0, |
6419 &slow_elements); | 6419 &slow_elements); |
6420 __ ret(0); | 6420 __ ret(0); |
6421 } | 6421 } |
6422 | 6422 |
| 6423 |
| 6424 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
| 6425 if (entry_hook_ != NULL) { |
| 6426 ProfileEntryHookStub stub; |
| 6427 masm->CallStub(&stub); |
| 6428 } |
| 6429 } |
| 6430 |
| 6431 |
| 6432 void ProfileEntryHookStub::Generate(MacroAssembler* masm) { |
| 6433 // RCX is the only volatile register we must save. |
| 6434 __ push(rcx); |
| 6435 |
| 6436 // Calculate the original stack pointer and store it in RDX, the second arg. |
| 6437 __ lea(rdx, Operand(rsp, kPointerSize)); |
| 6438 |
| 6439 // Calculate the function address to RCX, the first arg. |
| 6440 __ movq(rcx, Operand(rdx, 0)); |
| 6441 __ subq(rcx, Immediate(Assembler::kShortCallInstructionLength)); |
| 6442 |
| 6443 // Reserve stack for the first 4 args. |
| 6444 __ subq(rsp, Immediate(4 * kPointerSize)); |
| 6445 |
| 6446 // Call the entry hook. |
| 6447 int64_t hook_location = reinterpret_cast<int64_t>(&entry_hook_); |
| 6448 __ movq(rax, hook_location, RelocInfo::NONE); |
| 6449 __ call(Operand(rax, 0)); |
| 6450 __ addq(rsp, Immediate(4 * kPointerSize)); |
| 6451 |
| 6452 // Restore RCX. |
| 6453 __ pop(rcx); |
| 6454 __ ret(0); |
| 6455 } |
| 6456 |
6423 #undef __ | 6457 #undef __ |
6424 | 6458 |
6425 } } // namespace v8::internal | 6459 } } // namespace v8::internal |
6426 | 6460 |
6427 #endif // V8_TARGET_ARCH_X64 | 6461 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |