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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 9643001: Inline functions that use arguments object in f.apply(o, arguments) pattern. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: regression test Created 8 years, 9 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after
2753 __ ldr(result, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 2753 __ ldr(result, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2754 __ ldr(result, 2754 __ ldr(result,
2755 MemOperand(result, ArgumentsAdaptorFrameConstants::kLengthOffset)); 2755 MemOperand(result, ArgumentsAdaptorFrameConstants::kLengthOffset));
2756 __ SmiUntag(result); 2756 __ SmiUntag(result);
2757 2757
2758 // Argument length is in result register. 2758 // Argument length is in result register.
2759 __ bind(&done); 2759 __ bind(&done);
2760 } 2760 }
2761 2761
2762 2762
2763 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { 2763 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) {
2764 Register receiver = ToRegister(instr->receiver()); 2764 Register receiver = ToRegister(instr->receiver());
2765 Register function = ToRegister(instr->function()); 2765 Register function = ToRegister(instr->function());
2766 Register length = ToRegister(instr->length());
2767 Register elements = ToRegister(instr->elements());
2768 Register scratch = scratch0(); 2766 Register scratch = scratch0();
2769 ASSERT(receiver.is(r0)); // Used for parameter count.
2770 ASSERT(function.is(r1)); // Required by InvokeFunction.
2771 ASSERT(ToRegister(instr->result()).is(r0));
2772 2767
2773 // If the receiver is null or undefined, we have to pass the global 2768 // If the receiver is null or undefined, we have to pass the global
2774 // object as a receiver to normal functions. Values have to be 2769 // object as a receiver to normal functions. Values have to be
2775 // passed unchanged to builtins and strict-mode functions. 2770 // passed unchanged to builtins and strict-mode functions.
2776 Label global_object, receiver_ok; 2771 Label global_object, receiver_ok;
2777 2772
2778 // Do not transform the receiver to object for strict mode 2773 // Do not transform the receiver to object for strict mode
2779 // functions. 2774 // functions.
2780 __ ldr(scratch, 2775 __ ldr(scratch,
2781 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); 2776 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset));
(...skipping 20 matching lines...) Expand all
2802 DeoptimizeIf(eq, instr->environment()); 2797 DeoptimizeIf(eq, instr->environment());
2803 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); 2798 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE);
2804 DeoptimizeIf(lt, instr->environment()); 2799 DeoptimizeIf(lt, instr->environment());
2805 __ jmp(&receiver_ok); 2800 __ jmp(&receiver_ok);
2806 2801
2807 __ bind(&global_object); 2802 __ bind(&global_object);
2808 __ ldr(receiver, GlobalObjectOperand()); 2803 __ ldr(receiver, GlobalObjectOperand());
2809 __ ldr(receiver, 2804 __ ldr(receiver,
2810 FieldMemOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); 2805 FieldMemOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
2811 __ bind(&receiver_ok); 2806 __ bind(&receiver_ok);
2807 }
2808
2809
2810 void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
2811 Register receiver = ToRegister(instr->receiver());
2812 Register function = ToRegister(instr->function());
2813 Register length = ToRegister(instr->length());
2814 Register elements = ToRegister(instr->elements());
2815 Register scratch = scratch0();
2816 ASSERT(receiver.is(r0)); // Used for parameter count.
2817 ASSERT(function.is(r1)); // Required by InvokeFunction.
2818 ASSERT(ToRegister(instr->result()).is(r0));
2812 2819
2813 // Copy the arguments to this function possibly from the 2820 // Copy the arguments to this function possibly from the
2814 // adaptor frame below it. 2821 // adaptor frame below it.
2815 const uint32_t kArgumentsLimit = 1 * KB; 2822 const uint32_t kArgumentsLimit = 1 * KB;
2816 __ cmp(length, Operand(kArgumentsLimit)); 2823 __ cmp(length, Operand(kArgumentsLimit));
2817 DeoptimizeIf(hi, instr->environment()); 2824 DeoptimizeIf(hi, instr->environment());
2818 2825
2819 // Push the receiver and use the register to keep the original 2826 // Push the receiver and use the register to keep the original
2820 // number of arguments. 2827 // number of arguments.
2821 __ push(receiver); 2828 __ push(receiver);
(...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
5066 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5073 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5067 __ ldr(result, FieldMemOperand(scratch, 5074 __ ldr(result, FieldMemOperand(scratch,
5068 FixedArray::kHeaderSize - kPointerSize)); 5075 FixedArray::kHeaderSize - kPointerSize));
5069 __ bind(&done); 5076 __ bind(&done);
5070 } 5077 }
5071 5078
5072 5079
5073 #undef __ 5080 #undef __
5074 5081
5075 } } // namespace v8::internal 5082 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698