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

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

Issue 9837002: Support arguments object access from inlined functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: revert heap.cc 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 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 2757
2758 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 2758 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
2759 CallCode(ic, RelocInfo::CODE_TARGET, instr); 2759 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2760 } 2760 }
2761 2761
2762 2762
2763 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 2763 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
2764 Register scratch = scratch0(); 2764 Register scratch = scratch0();
2765 Register result = ToRegister(instr->result()); 2765 Register result = ToRegister(instr->result());
2766 2766
2767 // Check if the calling frame is an arguments adaptor frame. 2767 if (instr->from_inlined()) {
2768 Label done, adapted; 2768 __ add(result, sp, Operand(-2 * kPointerSize));
2769 __ ldr(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 2769 } else {
2770 __ ldr(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); 2770 // Check if the calling frame is an arguments adaptor frame.
2771 __ cmp(result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 2771 Label done, adapted;
2772 __ ldr(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2773 __ ldr(result, MemOperand(scratch, StandardFrameConstants::kContextOffset));
2774 __ cmp(result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
2772 2775
2773 // Result is the frame pointer for the frame if not adapted and for the real 2776 // Result is the frame pointer for the frame if not adapted and for the real
2774 // frame below the adaptor frame if adapted. 2777 // frame below the adaptor frame if adapted.
2775 __ mov(result, fp, LeaveCC, ne); 2778 __ mov(result, fp, LeaveCC, ne);
2776 __ mov(result, scratch, LeaveCC, eq); 2779 __ mov(result, scratch, LeaveCC, eq);
2780 }
2777 } 2781 }
2778 2782
2779 2783
2780 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { 2784 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
2781 Register elem = ToRegister(instr->InputAt(0)); 2785 Register elem = ToRegister(instr->InputAt(0));
2782 Register result = ToRegister(instr->result()); 2786 Register result = ToRegister(instr->result());
2783 2787
2784 Label done; 2788 Label done;
2785 2789
2786 // If no arguments adaptor frame the number of arguments is fixed. 2790 // If no arguments adaptor frame the number of arguments is fixed.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2900 LOperand* argument = instr->InputAt(0); 2904 LOperand* argument = instr->InputAt(0);
2901 if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { 2905 if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) {
2902 Abort("DoPushArgument not implemented for double type."); 2906 Abort("DoPushArgument not implemented for double type.");
2903 } else { 2907 } else {
2904 Register argument_reg = EmitLoadRegister(argument, ip); 2908 Register argument_reg = EmitLoadRegister(argument, ip);
2905 __ push(argument_reg); 2909 __ push(argument_reg);
2906 } 2910 }
2907 } 2911 }
2908 2912
2909 2913
2914 void LCodeGen::DoPop(LPop* instr) {
2915 __ Drop(instr->count());
2916 }
2917
2918
2910 void LCodeGen::DoThisFunction(LThisFunction* instr) { 2919 void LCodeGen::DoThisFunction(LThisFunction* instr) {
2911 Register result = ToRegister(instr->result()); 2920 Register result = ToRegister(instr->result());
2912 __ LoadHeapObject(result, instr->hydrogen()->closure()); 2921 __ LoadHeapObject(result, instr->hydrogen()->closure());
2913 } 2922 }
2914 2923
2915 2924
2916 void LCodeGen::DoContext(LContext* instr) { 2925 void LCodeGen::DoContext(LContext* instr) {
2917 Register result = ToRegister(instr->result()); 2926 Register result = ToRegister(instr->result());
2918 __ mov(result, cp); 2927 __ mov(result, cp);
2919 } 2928 }
(...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after
5112 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5121 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5113 __ ldr(result, FieldMemOperand(scratch, 5122 __ ldr(result, FieldMemOperand(scratch,
5114 FixedArray::kHeaderSize - kPointerSize)); 5123 FixedArray::kHeaderSize - kPointerSize));
5115 __ bind(&done); 5124 __ bind(&done);
5116 } 5125 }
5117 5126
5118 5127
5119 #undef __ 5128 #undef __
5120 5129
5121 } } // namespace v8::internal 5130 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.h » ('j') | src/ia32/lithium-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698