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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 7024047: [Arguments] Port fast arguments creation stubs to X64 and ARM. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Addres comments. Created 9 years, 6 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/objects-printer.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2900 matching lines...) Expand 10 before | Expand all | Expand 10 after
2911 __ cmp(Operand(ecx), Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 2911 __ cmp(Operand(ecx), Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
2912 __ j(not_equal, &runtime, Label::kNear); 2912 __ j(not_equal, &runtime, Label::kNear);
2913 2913
2914 // Patch the arguments.length and the parameters pointer. 2914 // Patch the arguments.length and the parameters pointer.
2915 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); 2915 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset));
2916 __ mov(Operand(esp, 1 * kPointerSize), ecx); 2916 __ mov(Operand(esp, 1 * kPointerSize), ecx);
2917 __ lea(edx, Operand(edx, ecx, times_2, 2917 __ lea(edx, Operand(edx, ecx, times_2,
2918 StandardFrameConstants::kCallerSPOffset)); 2918 StandardFrameConstants::kCallerSPOffset));
2919 __ mov(Operand(esp, 2 * kPointerSize), edx); 2919 __ mov(Operand(esp, 2 * kPointerSize), edx);
2920 2920
2921 // Try the new space allocation. Start out with computing the size of
2922 // the arguments object and the elements array.
2923 __ bind(&runtime); 2921 __ bind(&runtime);
2924 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); 2922 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
2925 } 2923 }
2926 2924
2927 2925
2928 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { 2926 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) {
2929 // esp[0] : return address 2927 // esp[0] : return address
2930 // esp[4] : number of parameters (tagged) 2928 // esp[4] : number of parameters (tagged)
2931 // esp[8] : receiver displacement 2929 // esp[8] : receiver displacement
2932 // esp[12] : function 2930 // esp[12] : function
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
3115 __ mov(FieldOperand(edi, FixedArray::kMapOffset), 3113 __ mov(FieldOperand(edi, FixedArray::kMapOffset),
3116 Immediate(FACTORY->fixed_array_map())); 3114 Immediate(FACTORY->fixed_array_map()));
3117 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), ecx); 3115 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), ecx);
3118 3116
3119 Label arguments_loop, arguments_test; 3117 Label arguments_loop, arguments_test;
3120 __ mov(ebx, Operand(esp, 1 * kPointerSize)); 3118 __ mov(ebx, Operand(esp, 1 * kPointerSize));
3121 __ mov(edx, Operand(esp, 4 * kPointerSize)); 3119 __ mov(edx, Operand(esp, 4 * kPointerSize));
3122 __ sub(Operand(edx), ebx); // Is there a smarter way to do negative scaling? 3120 __ sub(Operand(edx), ebx); // Is there a smarter way to do negative scaling?
3123 __ sub(Operand(edx), ebx); 3121 __ sub(Operand(edx), ebx);
3124 __ jmp(&arguments_test, Label::kNear); 3122 __ jmp(&arguments_test, Label::kNear);
3123
3125 __ bind(&arguments_loop); 3124 __ bind(&arguments_loop);
3126 __ sub(Operand(edx), Immediate(kPointerSize)); 3125 __ sub(Operand(edx), Immediate(kPointerSize));
3127 __ mov(eax, Operand(edx, 0)); 3126 __ mov(eax, Operand(edx, 0));
3128 __ mov(FieldOperand(edi, ebx, times_2, FixedArray::kHeaderSize), eax); 3127 __ mov(FieldOperand(edi, ebx, times_2, FixedArray::kHeaderSize), eax);
3129 __ add(Operand(ebx), Immediate(Smi::FromInt(1))); 3128 __ add(Operand(ebx), Immediate(Smi::FromInt(1)));
3129
3130 __ bind(&arguments_test); 3130 __ bind(&arguments_test);
3131 __ cmp(ebx, Operand(ecx)); 3131 __ cmp(ebx, Operand(ecx));
3132 __ j(less, &arguments_loop, Label::kNear); 3132 __ j(less, &arguments_loop, Label::kNear);
3133 3133
3134 // Restore. 3134 // Restore.
3135 __ pop(eax); // Address of arguments object. 3135 __ pop(eax); // Address of arguments object.
3136 __ pop(ebx); // Parameter count. 3136 __ pop(ebx); // Parameter count.
3137 3137
3138 // Return and remove the on-stack parameters. 3138 // Return and remove the on-stack parameters.
3139 __ ret(3 * kPointerSize); 3139 __ ret(3 * kPointerSize);
(...skipping 3272 matching lines...) Expand 10 before | Expand all | Expand 10 after
6412 __ Drop(1); 6412 __ Drop(1);
6413 __ ret(2 * kPointerSize); 6413 __ ret(2 * kPointerSize);
6414 } 6414 }
6415 6415
6416 6416
6417 #undef __ 6417 #undef __
6418 6418
6419 } } // namespace v8::internal 6419 } } // namespace v8::internal
6420 6420
6421 #endif // V8_TARGET_ARCH_IA32 6421 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698