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

Side by Side Diff: src/ia32/builtins-ia32.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, 3 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/arm/full-codegen-arm.cc ('k') | src/ia32/codegen-ia32.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 // Jump to the function-specific construct stub. 89 // Jump to the function-specific construct stub.
90 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); 90 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
91 __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kConstructStubOffset)); 91 __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kConstructStubOffset));
92 __ lea(ebx, FieldOperand(ebx, Code::kHeaderSize)); 92 __ lea(ebx, FieldOperand(ebx, Code::kHeaderSize));
93 __ jmp(Operand(ebx)); 93 __ jmp(Operand(ebx));
94 94
95 // edi: called object 95 // edi: called object
96 // eax: number of arguments 96 // eax: number of arguments
97 __ bind(&non_function_call); 97 __ bind(&non_function_call);
98 // CALL_NON_FUNCTION expects the non-function constructor as receiver
99 // (instead of the original receiver from the call site). The receiver is
100 // stack element argc+1.
101 __ mov(Operand(esp, eax, times_4, kPointerSize), edi);
102 // Set expected number of arguments to zero (not changing eax). 98 // Set expected number of arguments to zero (not changing eax).
103 __ Set(ebx, Immediate(0)); 99 __ Set(ebx, Immediate(0));
104 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); 100 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
105 __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), 101 __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
106 RelocInfo::CODE_TARGET); 102 RelocInfo::CODE_TARGET);
107 } 103 }
108 104
109 105
110 static void Generate_JSConstructStubHelper(MacroAssembler* masm, 106 static void Generate_JSConstructStubHelper(MacroAssembler* masm,
111 bool is_api_function) { 107 bool is_api_function) {
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 __ bind(&dont_adapt_arguments); 1267 __ bind(&dont_adapt_arguments);
1272 __ jmp(Operand(edx)); 1268 __ jmp(Operand(edx));
1273 } 1269 }
1274 1270
1275 1271
1276 #undef __ 1272 #undef __
1277 1273
1278 } } // namespace v8::internal 1274 } } // namespace v8::internal
1279 1275
1280 #endif // V8_TARGET_ARCH_IA32 1276 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698