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

Side by Side Diff: src/x64/lithium-codegen-x64.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 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Check for arguments adapter frame. 2500 if (instr->from_inlined()) {
2501 Label done, adapted; 2501 __ lea(result, Operand(rsp, -2 * kPointerSize));
2502 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); 2502 } else {
2503 __ Cmp(Operand(result, StandardFrameConstants::kContextOffset), 2503 // Check for arguments adapter frame.
2504 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); 2504 Label done, adapted;
2505 __ j(equal, &adapted, Label::kNear); 2505 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
2506 __ Cmp(Operand(result, StandardFrameConstants::kContextOffset),
2507 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2508 __ j(equal, &adapted, Label::kNear);
2506 2509
2507 // No arguments adaptor frame. 2510 // No arguments adaptor frame.
2508 __ movq(result, rbp); 2511 __ movq(result, rbp);
2509 __ jmp(&done, Label::kNear); 2512 __ jmp(&done, Label::kNear);
2510 2513
2511 // Arguments adaptor frame present. 2514 // Arguments adaptor frame present.
2512 __ bind(&adapted); 2515 __ bind(&adapted);
2513 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); 2516 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
2514 2517
2515 // Result is the frame pointer for the frame if not adapted and for the real 2518 // Result is the frame pointer for the frame if not adapted and for the real
2516 // frame below the adaptor frame if adapted. 2519 // frame below the adaptor frame if adapted.
2517 __ bind(&done); 2520 __ bind(&done);
2521 }
2518 } 2522 }
2519 2523
2520 2524
2521 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { 2525 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) {
2522 Register result = ToRegister(instr->result()); 2526 Register result = ToRegister(instr->result());
2523 2527
2524 Label done; 2528 Label done;
2525 2529
2526 // If no arguments adaptor frame the number of arguments is fixed. 2530 // If no arguments adaptor frame the number of arguments is fixed.
2527 if (instr->InputAt(0)->IsRegister()) { 2531 if (instr->InputAt(0)->IsRegister()) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2633 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 2637 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
2634 } 2638 }
2635 2639
2636 2640
2637 void LCodeGen::DoPushArgument(LPushArgument* instr) { 2641 void LCodeGen::DoPushArgument(LPushArgument* instr) {
2638 LOperand* argument = instr->InputAt(0); 2642 LOperand* argument = instr->InputAt(0);
2639 EmitPushTaggedOperand(argument); 2643 EmitPushTaggedOperand(argument);
2640 } 2644 }
2641 2645
2642 2646
2647 void LCodeGen::DoPop(LPop* instr) {
2648 __ Drop(instr->count());
2649 }
2650
2651
2643 void LCodeGen::DoThisFunction(LThisFunction* instr) { 2652 void LCodeGen::DoThisFunction(LThisFunction* instr) {
2644 Register result = ToRegister(instr->result()); 2653 Register result = ToRegister(instr->result());
2645 __ LoadHeapObject(result, instr->hydrogen()->closure()); 2654 __ LoadHeapObject(result, instr->hydrogen()->closure());
2646 } 2655 }
2647 2656
2648 2657
2649 void LCodeGen::DoContext(LContext* instr) { 2658 void LCodeGen::DoContext(LContext* instr) {
2650 Register result = ToRegister(instr->result()); 2659 Register result = ToRegister(instr->result());
2651 __ movq(result, rsi); 2660 __ movq(result, rsi);
2652 } 2661 }
(...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after
4742 FixedArray::kHeaderSize - kPointerSize)); 4751 FixedArray::kHeaderSize - kPointerSize));
4743 __ bind(&done); 4752 __ bind(&done);
4744 } 4753 }
4745 4754
4746 4755
4747 #undef __ 4756 #undef __
4748 4757
4749 } } // namespace v8::internal 4758 } } // namespace v8::internal
4750 4759
4751 #endif // V8_TARGET_ARCH_X64 4760 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698