Chromium Code Reviews| 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 // 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)); |
|
Kevin Millikin (Chromium)
2012/04/11 11:49:18
add? sub?
I think it's weird to have this off-by
Vyacheslav Egorov (Chromium)
2012/04/11 12:47:28
Off by one is there to avoid changing access code.
| |
| 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 Loading... | |
| 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 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5145 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5154 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5146 __ ldr(result, FieldMemOperand(scratch, | 5155 __ ldr(result, FieldMemOperand(scratch, |
| 5147 FixedArray::kHeaderSize - kPointerSize)); | 5156 FixedArray::kHeaderSize - kPointerSize)); |
| 5148 __ bind(&done); | 5157 __ bind(&done); |
| 5149 } | 5158 } |
| 5150 | 5159 |
| 5151 | 5160 |
| 5152 #undef __ | 5161 #undef __ |
| 5153 | 5162 |
| 5154 } } // namespace v8::internal | 5163 } } // namespace v8::internal |
| OLD | NEW |