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 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 ASSERT(ToRegister(instr->key()).is(rax)); | 2490 ASSERT(ToRegister(instr->key()).is(rax)); |
2491 | 2491 |
2492 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 2492 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
2493 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2493 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2494 } | 2494 } |
2495 | 2495 |
2496 | 2496 |
2497 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2497 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
2498 Register result = ToRegister(instr->result()); | 2498 Register result = ToRegister(instr->result()); |
2499 | 2499 |
2500 if (instr->from_inlined()) { | 2500 // Check for arguments adapter frame. |
2501 __ lea(result, Operand(rsp, -2 * kPointerSize)); | 2501 Label done, adapted; |
2502 } else { | 2502 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
2503 // Check for arguments adapter frame. | 2503 __ Cmp(Operand(result, StandardFrameConstants::kContextOffset), |
2504 Label done, adapted; | 2504 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
2505 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | 2505 __ j(equal, &adapted, Label::kNear); |
2506 __ Cmp(Operand(result, StandardFrameConstants::kContextOffset), | |
2507 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | |
2508 __ j(equal, &adapted, Label::kNear); | |
2509 | 2506 |
2510 // No arguments adaptor frame. | 2507 // No arguments adaptor frame. |
2511 __ movq(result, rbp); | 2508 __ movq(result, rbp); |
2512 __ jmp(&done, Label::kNear); | 2509 __ jmp(&done, Label::kNear); |
2513 | 2510 |
2514 // Arguments adaptor frame present. | 2511 // Arguments adaptor frame present. |
2515 __ bind(&adapted); | 2512 __ bind(&adapted); |
2516 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | 2513 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
2517 | 2514 |
2518 // Result is the frame pointer for the frame if not adapted and for the real | 2515 // Result is the frame pointer for the frame if not adapted and for the real |
2519 // frame below the adaptor frame if adapted. | 2516 // frame below the adaptor frame if adapted. |
2520 __ bind(&done); | 2517 __ bind(&done); |
2521 } | |
2522 } | 2518 } |
2523 | 2519 |
2524 | 2520 |
2525 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 2521 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
2526 Register result = ToRegister(instr->result()); | 2522 Register result = ToRegister(instr->result()); |
2527 | 2523 |
2528 Label done; | 2524 Label done; |
2529 | 2525 |
2530 // If no arguments adaptor frame the number of arguments is fixed. | 2526 // If no arguments adaptor frame the number of arguments is fixed. |
2531 if (instr->InputAt(0)->IsRegister()) { | 2527 if (instr->InputAt(0)->IsRegister()) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2637 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 2633 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
2638 } | 2634 } |
2639 | 2635 |
2640 | 2636 |
2641 void LCodeGen::DoPushArgument(LPushArgument* instr) { | 2637 void LCodeGen::DoPushArgument(LPushArgument* instr) { |
2642 LOperand* argument = instr->InputAt(0); | 2638 LOperand* argument = instr->InputAt(0); |
2643 EmitPushTaggedOperand(argument); | 2639 EmitPushTaggedOperand(argument); |
2644 } | 2640 } |
2645 | 2641 |
2646 | 2642 |
2647 void LCodeGen::DoPop(LPop* instr) { | |
2648 __ Drop(instr->count()); | |
2649 } | |
2650 | |
2651 | |
2652 void LCodeGen::DoThisFunction(LThisFunction* instr) { | 2643 void LCodeGen::DoThisFunction(LThisFunction* instr) { |
2653 Register result = ToRegister(instr->result()); | 2644 Register result = ToRegister(instr->result()); |
2654 __ LoadHeapObject(result, instr->hydrogen()->closure()); | 2645 __ LoadHeapObject(result, instr->hydrogen()->closure()); |
2655 } | 2646 } |
2656 | 2647 |
2657 | 2648 |
2658 void LCodeGen::DoContext(LContext* instr) { | 2649 void LCodeGen::DoContext(LContext* instr) { |
2659 Register result = ToRegister(instr->result()); | 2650 Register result = ToRegister(instr->result()); |
2660 __ movq(result, rsi); | 2651 __ movq(result, rsi); |
2661 } | 2652 } |
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4763 FixedArray::kHeaderSize - kPointerSize)); | 4754 FixedArray::kHeaderSize - kPointerSize)); |
4764 __ bind(&done); | 4755 __ bind(&done); |
4765 } | 4756 } |
4766 | 4757 |
4767 | 4758 |
4768 #undef __ | 4759 #undef __ |
4769 | 4760 |
4770 } } // namespace v8::internal | 4761 } } // namespace v8::internal |
4771 | 4762 |
4772 #endif // V8_TARGET_ARCH_X64 | 4763 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |