OLD | NEW |
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 Loading... |
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 if (instr->from_inlined()) { | 2767 // Check if the calling frame is an arguments adaptor frame. |
2768 __ add(result, sp, Operand(-2 * kPointerSize)); | 2768 Label done, adapted; |
2769 } else { | 2769 __ ldr(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
2770 // Check if the calling frame is an arguments adaptor frame. | 2770 __ ldr(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); |
2771 Label done, adapted; | 2771 __ cmp(result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
2772 __ ldr(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | |
2773 __ ldr(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); | |
2774 __ cmp(result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | |
2775 | 2772 |
2776 // Result is the frame pointer for the frame if not adapted and for the real | 2773 // Result is the frame pointer for the frame if not adapted and for the real |
2777 // frame below the adaptor frame if adapted. | 2774 // frame below the adaptor frame if adapted. |
2778 __ mov(result, fp, LeaveCC, ne); | 2775 __ mov(result, fp, LeaveCC, ne); |
2779 __ mov(result, scratch, LeaveCC, eq); | 2776 __ mov(result, scratch, LeaveCC, eq); |
2780 } | |
2781 } | 2777 } |
2782 | 2778 |
2783 | 2779 |
2784 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 2780 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
2785 Register elem = ToRegister(instr->InputAt(0)); | 2781 Register elem = ToRegister(instr->InputAt(0)); |
2786 Register result = ToRegister(instr->result()); | 2782 Register result = ToRegister(instr->result()); |
2787 | 2783 |
2788 Label done; | 2784 Label done; |
2789 | 2785 |
2790 // If no arguments adaptor frame the number of arguments is fixed. | 2786 // If no arguments adaptor frame the number of arguments is fixed. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2904 LOperand* argument = instr->InputAt(0); | 2900 LOperand* argument = instr->InputAt(0); |
2905 if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { | 2901 if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { |
2906 Abort("DoPushArgument not implemented for double type."); | 2902 Abort("DoPushArgument not implemented for double type."); |
2907 } else { | 2903 } else { |
2908 Register argument_reg = EmitLoadRegister(argument, ip); | 2904 Register argument_reg = EmitLoadRegister(argument, ip); |
2909 __ push(argument_reg); | 2905 __ push(argument_reg); |
2910 } | 2906 } |
2911 } | 2907 } |
2912 | 2908 |
2913 | 2909 |
2914 void LCodeGen::DoPop(LPop* instr) { | |
2915 __ Drop(instr->count()); | |
2916 } | |
2917 | |
2918 | |
2919 void LCodeGen::DoThisFunction(LThisFunction* instr) { | 2910 void LCodeGen::DoThisFunction(LThisFunction* instr) { |
2920 Register result = ToRegister(instr->result()); | 2911 Register result = ToRegister(instr->result()); |
2921 __ LoadHeapObject(result, instr->hydrogen()->closure()); | 2912 __ LoadHeapObject(result, instr->hydrogen()->closure()); |
2922 } | 2913 } |
2923 | 2914 |
2924 | 2915 |
2925 void LCodeGen::DoContext(LContext* instr) { | 2916 void LCodeGen::DoContext(LContext* instr) { |
2926 Register result = ToRegister(instr->result()); | 2917 Register result = ToRegister(instr->result()); |
2927 __ mov(result, cp); | 2918 __ mov(result, cp); |
2928 } | 2919 } |
(...skipping 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5138 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5129 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5139 __ ldr(result, FieldMemOperand(scratch, | 5130 __ ldr(result, FieldMemOperand(scratch, |
5140 FixedArray::kHeaderSize - kPointerSize)); | 5131 FixedArray::kHeaderSize - kPointerSize)); |
5141 __ bind(&done); | 5132 __ bind(&done); |
5142 } | 5133 } |
5143 | 5134 |
5144 | 5135 |
5145 #undef __ | 5136 #undef __ |
5146 | 5137 |
5147 } } // namespace v8::internal | 5138 } } // namespace v8::internal |
OLD | NEW |