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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 | 650 |
651 static int Offset(ExternalReference ref0, ExternalReference ref1) { | 651 static int Offset(ExternalReference ref0, ExternalReference ref1) { |
652 int64_t offset = (ref0.address() - ref1.address()); | 652 int64_t offset = (ref0.address() - ref1.address()); |
653 // Check that fits into int. | 653 // Check that fits into int. |
654 ASSERT(static_cast<int>(offset) == offset); | 654 ASSERT(static_cast<int>(offset) == offset); |
655 return static_cast<int>(offset); | 655 return static_cast<int>(offset); |
656 } | 656 } |
657 | 657 |
658 | 658 |
659 void MacroAssembler::PrepareCallApiFunction(int arg_stack_space) { | 659 void MacroAssembler::PrepareCallApiFunction(int arg_stack_space) { |
660 #ifdef _WIN64 | 660 #if defined(_WIN64) && !defined(__MINGW64__) |
661 // We need to prepare a slot for result handle on stack and put | 661 // We need to prepare a slot for result handle on stack and put |
662 // a pointer to it into 1st arg register. | 662 // a pointer to it into 1st arg register. |
663 EnterApiExitFrame(arg_stack_space + 1); | 663 EnterApiExitFrame(arg_stack_space + 1); |
664 | 664 |
665 // rcx must be used to pass the pointer to the return value slot. | 665 // rcx must be used to pass the pointer to the return value slot. |
666 lea(rcx, StackSpaceOperand(arg_stack_space)); | 666 lea(rcx, StackSpaceOperand(arg_stack_space)); |
667 #else | 667 #else |
668 EnterApiExitFrame(arg_stack_space); | 668 EnterApiExitFrame(arg_stack_space); |
669 #endif | 669 #endif |
670 } | 670 } |
(...skipping 27 matching lines...) Expand all Loading... |
698 Register base_reg = r15; | 698 Register base_reg = r15; |
699 movq(base_reg, next_address); | 699 movq(base_reg, next_address); |
700 movq(prev_next_address_reg, Operand(base_reg, kNextOffset)); | 700 movq(prev_next_address_reg, Operand(base_reg, kNextOffset)); |
701 movq(prev_limit_reg, Operand(base_reg, kLimitOffset)); | 701 movq(prev_limit_reg, Operand(base_reg, kLimitOffset)); |
702 addl(Operand(base_reg, kLevelOffset), Immediate(1)); | 702 addl(Operand(base_reg, kLevelOffset), Immediate(1)); |
703 // Call the api function! | 703 // Call the api function! |
704 movq(rax, reinterpret_cast<int64_t>(function_address), | 704 movq(rax, reinterpret_cast<int64_t>(function_address), |
705 RelocInfo::RUNTIME_ENTRY); | 705 RelocInfo::RUNTIME_ENTRY); |
706 call(rax); | 706 call(rax); |
707 | 707 |
708 #ifdef _WIN64 | 708 #if defined(_WIN64) && !defined(__MINGW64__) |
709 // rax keeps a pointer to v8::Handle, unpack it. | 709 // rax keeps a pointer to v8::Handle, unpack it. |
710 movq(rax, Operand(rax, 0)); | 710 movq(rax, Operand(rax, 0)); |
711 #endif | 711 #endif |
712 // Check if the result handle holds 0. | 712 // Check if the result handle holds 0. |
713 testq(rax, rax); | 713 testq(rax, rax); |
714 j(zero, &empty_result); | 714 j(zero, &empty_result); |
715 // It was non-zero. Dereference to get the result value. | 715 // It was non-zero. Dereference to get the result value. |
716 movq(rax, Operand(rax, 0)); | 716 movq(rax, Operand(rax, 0)); |
717 bind(&prologue); | 717 bind(&prologue); |
718 | 718 |
(...skipping 3703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4422 bind(&check_prototype); | 4422 bind(&check_prototype); |
4423 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); | 4423 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); |
4424 cmpq(rcx, null_value); | 4424 cmpq(rcx, null_value); |
4425 j(not_equal, &next); | 4425 j(not_equal, &next); |
4426 } | 4426 } |
4427 | 4427 |
4428 | 4428 |
4429 } } // namespace v8::internal | 4429 } } // namespace v8::internal |
4430 | 4430 |
4431 #endif // V8_TARGET_ARCH_X64 | 4431 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |