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 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2644 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 2644 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
2645 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2645 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2646 } | 2646 } |
2647 | 2647 |
2648 | 2648 |
2649 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2649 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
2650 Register scratch = scratch0(); | 2650 Register scratch = scratch0(); |
2651 Register temp = scratch1(); | 2651 Register temp = scratch1(); |
2652 Register result = ToRegister(instr->result()); | 2652 Register result = ToRegister(instr->result()); |
2653 | 2653 |
2654 // Check if the calling frame is an arguments adaptor frame. | 2654 if (instr->from_inlined()) { |
2655 Label done, adapted; | 2655 __ Subu(result, sp, 2 * kPointerSize); |
2656 __ lw(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2656 } else { |
2657 __ lw(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); | 2657 // Check if the calling frame is an arguments adaptor frame. |
2658 __ Xor(temp, result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 2658 Label done, adapted; |
| 2659 __ lw(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 2660 __ lw(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); |
| 2661 __ Xor(temp, result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
2659 | 2662 |
2660 // Result is the frame pointer for the frame if not adapted and for the real | 2663 // Result is the frame pointer for the frame if not adapted and for the real |
2661 // frame below the adaptor frame if adapted. | 2664 // frame below the adaptor frame if adapted. |
2662 __ Movn(result, fp, temp); // Move only if temp is not equal to zero (ne). | 2665 __ Movn(result, fp, temp); // Move only if temp is not equal to zero (ne). |
2663 __ Movz(result, scratch, temp); // Move only if temp is equal to zero (eq). | 2666 __ Movz(result, scratch, temp); // Move only if temp is equal to zero (eq). |
| 2667 } |
2664 } | 2668 } |
2665 | 2669 |
2666 | 2670 |
2667 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 2671 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
2668 Register elem = ToRegister(instr->InputAt(0)); | 2672 Register elem = ToRegister(instr->InputAt(0)); |
2669 Register result = ToRegister(instr->result()); | 2673 Register result = ToRegister(instr->result()); |
2670 | 2674 |
2671 Label done; | 2675 Label done; |
2672 | 2676 |
2673 // If no arguments adaptor frame the number of arguments is fixed. | 2677 // If no arguments adaptor frame the number of arguments is fixed. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2786 LOperand* argument = instr->InputAt(0); | 2790 LOperand* argument = instr->InputAt(0); |
2787 if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { | 2791 if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { |
2788 Abort("DoPushArgument not implemented for double type."); | 2792 Abort("DoPushArgument not implemented for double type."); |
2789 } else { | 2793 } else { |
2790 Register argument_reg = EmitLoadRegister(argument, at); | 2794 Register argument_reg = EmitLoadRegister(argument, at); |
2791 __ push(argument_reg); | 2795 __ push(argument_reg); |
2792 } | 2796 } |
2793 } | 2797 } |
2794 | 2798 |
2795 | 2799 |
| 2800 void LCodeGen::DoPop(LPop* instr) { |
| 2801 __ Drop(instr->count()); |
| 2802 } |
| 2803 |
| 2804 |
2796 void LCodeGen::DoThisFunction(LThisFunction* instr) { | 2805 void LCodeGen::DoThisFunction(LThisFunction* instr) { |
2797 Register result = ToRegister(instr->result()); | 2806 Register result = ToRegister(instr->result()); |
2798 __ LoadHeapObject(result, instr->hydrogen()->closure()); | 2807 __ LoadHeapObject(result, instr->hydrogen()->closure()); |
2799 } | 2808 } |
2800 | 2809 |
2801 | 2810 |
2802 void LCodeGen::DoContext(LContext* instr) { | 2811 void LCodeGen::DoContext(LContext* instr) { |
2803 Register result = ToRegister(instr->result()); | 2812 Register result = ToRegister(instr->result()); |
2804 __ mov(result, cp); | 2813 __ mov(result, cp); |
2805 } | 2814 } |
(...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5047 __ Subu(scratch, result, scratch); | 5056 __ Subu(scratch, result, scratch); |
5048 __ lw(result, FieldMemOperand(scratch, | 5057 __ lw(result, FieldMemOperand(scratch, |
5049 FixedArray::kHeaderSize - kPointerSize)); | 5058 FixedArray::kHeaderSize - kPointerSize)); |
5050 __ bind(&done); | 5059 __ bind(&done); |
5051 } | 5060 } |
5052 | 5061 |
5053 | 5062 |
5054 #undef __ | 5063 #undef __ |
5055 | 5064 |
5056 } } // namespace v8::internal | 5065 } } // namespace v8::internal |
OLD | NEW |