Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: src/x64/builtins-x64.cc

Issue 3136032: Simplify the way constructors are called and avoid pushing... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/virtual-frame-ia32.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 890
891 // Jump to the function-specific construct stub. 891 // Jump to the function-specific construct stub.
892 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); 892 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
893 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kConstructStubOffset)); 893 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kConstructStubOffset));
894 __ lea(rbx, FieldOperand(rbx, Code::kHeaderSize)); 894 __ lea(rbx, FieldOperand(rbx, Code::kHeaderSize));
895 __ jmp(rbx); 895 __ jmp(rbx);
896 896
897 // rdi: called object 897 // rdi: called object
898 // rax: number of arguments 898 // rax: number of arguments
899 __ bind(&non_function_call); 899 __ bind(&non_function_call);
900 // CALL_NON_FUNCTION expects the non-function constructor as receiver
901 // (instead of the original receiver from the call site). The receiver is
902 // stack element argc+1.
903 __ movq(Operand(rsp, rax, times_pointer_size, kPointerSize), rdi);
904 // Set expected number of arguments to zero (not changing rax). 900 // Set expected number of arguments to zero (not changing rax).
905 __ movq(rbx, Immediate(0)); 901 __ movq(rbx, Immediate(0));
906 __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); 902 __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
907 __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), 903 __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
908 RelocInfo::CODE_TARGET); 904 RelocInfo::CODE_TARGET);
909 } 905 }
910 906
911 907
912 static void Generate_JSConstructStubHelper(MacroAssembler* masm, 908 static void Generate_JSConstructStubHelper(MacroAssembler* masm,
913 bool is_api_function) { 909 bool is_api_function) {
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 __ LeaveInternalFrame(); 1302 __ LeaveInternalFrame();
1307 1303
1308 // Do a tail-call of the compiled function. 1304 // Do a tail-call of the compiled function.
1309 __ lea(rcx, FieldOperand(rax, Code::kHeaderSize)); 1305 __ lea(rcx, FieldOperand(rax, Code::kHeaderSize));
1310 __ jmp(rcx); 1306 __ jmp(rcx);
1311 } 1307 }
1312 1308
1313 } } // namespace v8::internal 1309 } } // namespace v8::internal
1314 1310
1315 #endif // V8_TARGET_ARCH_X64 1311 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/virtual-frame-ia32.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698