| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 // Check that function is a JSFunction. | 888 // Check that function is a JSFunction. |
| 889 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); | 889 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); |
| 890 __ j(not_equal, &non_function_call); | 890 __ j(not_equal, &non_function_call); |
| 891 | 891 |
| 892 // Jump to the function-specific construct stub. | 892 // Jump to the function-specific construct stub. |
| 893 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 893 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
| 894 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kConstructStubOffset)); | 894 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kConstructStubOffset)); |
| 895 __ lea(rbx, FieldOperand(rbx, Code::kHeaderSize)); | 895 __ lea(rbx, FieldOperand(rbx, Code::kHeaderSize)); |
| 896 __ jmp(rbx); | 896 __ jmp(rbx); |
| 897 | 897 |
| 898 // edi: called object | 898 // rdi: called object |
| 899 // eax: number of arguments | 899 // rax: number of arguments |
| 900 __ bind(&non_function_call); | 900 __ bind(&non_function_call); |
| 901 // CALL_NON_FUNCTION expects the non-function constructor as receiver | 901 // CALL_NON_FUNCTION expects the non-function constructor as receiver |
| 902 // (instead of the original receiver from the call site). The receiver is | 902 // (instead of the original receiver from the call site). The receiver is |
| 903 // stack element argc+1. | 903 // stack element argc+1. |
| 904 __ movq(Operand(rsp, rax, times_pointer_size, kPointerSize), rdi); | 904 __ movq(Operand(rsp, rax, times_pointer_size, kPointerSize), rdi); |
| 905 // Set expected number of arguments to zero (not changing rax). | 905 // Set expected number of arguments to zero (not changing rax). |
| 906 __ movq(rbx, Immediate(0)); | 906 __ movq(rbx, Immediate(0)); |
| 907 __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); | 907 __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); |
| 908 __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), | 908 __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), |
| 909 RelocInfo::CODE_TARGET); | 909 RelocInfo::CODE_TARGET); |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 | 1289 |
| 1290 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { | 1290 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { |
| 1291 Generate_JSEntryTrampolineHelper(masm, true); | 1291 Generate_JSEntryTrampolineHelper(masm, true); |
| 1292 } | 1292 } |
| 1293 | 1293 |
| 1294 } } // namespace v8::internal | 1294 } } // namespace v8::internal |
| 1295 | 1295 |
| 1296 #endif // V8_TARGET_ARCH_X64 | 1296 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |