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 7838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7849 // Goto slow case if we do not have a function. | 7849 // Goto slow case if we do not have a function. |
7850 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); | 7850 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); |
7851 __ j(not_equal, &slow); | 7851 __ j(not_equal, &slow); |
7852 | 7852 |
7853 // Fast-case: Just invoke the function. | 7853 // Fast-case: Just invoke the function. |
7854 ParameterCount actual(argc_); | 7854 ParameterCount actual(argc_); |
7855 __ InvokeFunction(rdi, actual, JUMP_FUNCTION); | 7855 __ InvokeFunction(rdi, actual, JUMP_FUNCTION); |
7856 | 7856 |
7857 // Slow-case: Non-function called. | 7857 // Slow-case: Non-function called. |
7858 __ bind(&slow); | 7858 __ bind(&slow); |
| 7859 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead |
| 7860 // of the original receiver from the call site). |
| 7861 __ movq(Operand(rsp, (argc_ + 1) * kPointerSize), rdi); |
7859 __ Set(rax, argc_); | 7862 __ Set(rax, argc_); |
7860 __ Set(rbx, 0); | 7863 __ Set(rbx, 0); |
7861 __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION); | 7864 __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION); |
7862 Handle<Code> adaptor(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)); | 7865 Handle<Code> adaptor(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)); |
7863 __ Jump(adaptor, RelocInfo::CODE_TARGET); | 7866 __ Jump(adaptor, RelocInfo::CODE_TARGET); |
7864 } | 7867 } |
7865 | 7868 |
7866 | 7869 |
7867 void CEntryStub::Generate(MacroAssembler* masm) { | 7870 void CEntryStub::Generate(MacroAssembler* masm) { |
7868 // rax: number of arguments including receiver | 7871 // rax: number of arguments including receiver |
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9472 // Call the function from C++. | 9475 // Call the function from C++. |
9473 return FUNCTION_CAST<ModuloFunction>(buffer); | 9476 return FUNCTION_CAST<ModuloFunction>(buffer); |
9474 } | 9477 } |
9475 | 9478 |
9476 #endif | 9479 #endif |
9477 | 9480 |
9478 | 9481 |
9479 #undef __ | 9482 #undef __ |
9480 | 9483 |
9481 } } // namespace v8::internal | 9484 } } // namespace v8::internal |
OLD | NEW |