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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 10855098: Deoptimization support for accessors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tiny test changes. Rebased. Created 8 years, 4 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
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/builtins.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2697 matching lines...) Expand 10 before | Expand all | Expand 10 after
2708 // Handle store cache miss. 2708 // Handle store cache miss.
2709 __ bind(&miss); 2709 __ bind(&miss);
2710 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); 2710 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2711 __ Jump(ic, RelocInfo::CODE_TARGET); 2711 __ Jump(ic, RelocInfo::CODE_TARGET);
2712 2712
2713 // Return the generated code. 2713 // Return the generated code.
2714 return GetCode(Code::CALLBACKS, name); 2714 return GetCode(Code::CALLBACKS, name);
2715 } 2715 }
2716 2716
2717 2717
2718 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( 2718 #undef __
2719 Handle<String> name, 2719 #define __ ACCESS_MASM(masm)
2720 Handle<JSObject> receiver, 2720
2721 Handle<JSObject> holder, 2721
2722 void StoreStubCompiler::GenerateStoreViaSetter(
2723 MacroAssembler* masm,
2722 Handle<JSFunction> setter) { 2724 Handle<JSFunction> setter) {
2723 // ----------- S t a t e ------------- 2725 // ----------- S t a t e -------------
2724 // -- r0 : value 2726 // -- r0 : value
2725 // -- r1 : receiver 2727 // -- r1 : receiver
2726 // -- r2 : name 2728 // -- r2 : name
2727 // -- lr : return address 2729 // -- lr : return address
2728 // ----------------------------------- 2730 // -----------------------------------
2729 Label miss;
2730
2731 // Check that the maps haven't changed.
2732 __ JumpIfSmi(r1, &miss);
2733 CheckPrototypes(receiver, r1, holder, r3, r4, r5, name, &miss);
2734
2735 { 2731 {
2736 FrameScope scope(masm(), StackFrame::INTERNAL); 2732 FrameScope scope(masm, StackFrame::INTERNAL);
2737 2733
2738 // Save value register, so we can restore it later. 2734 // Save value register, so we can restore it later.
2739 __ push(r0); 2735 __ push(r0);
2740 2736
2741 // Call the JavaScript setter with the receiver and the value on the stack. 2737 if (!setter.is_null()) {
2742 __ Push(r1, r0); 2738 // Call the JavaScript setter with receiver and value on the stack.
2743 ParameterCount actual(1); 2739 __ Push(r1, r0);
2744 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), 2740 ParameterCount actual(1);
2745 CALL_AS_METHOD); 2741 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
2742 CALL_AS_METHOD);
2743 } else {
2744 // If we generate a global code snippet for deoptimization only, remember
2745 // the place to continue after deoptimization.
2746 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
2747 }
2746 2748
2747 // We have to return the passed value, not the return value of the setter. 2749 // We have to return the passed value, not the return value of the setter.
2748 __ pop(r0); 2750 __ pop(r0);
2749 2751
2750 // Restore context register. 2752 // Restore context register.
2751 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2753 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2752 } 2754 }
2753 __ Ret(); 2755 __ Ret();
2756 }
2757
2758
2759 #undef __
2760 #define __ ACCESS_MASM(masm())
2761
2762
2763 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2764 Handle<String> name,
2765 Handle<JSObject> receiver,
2766 Handle<JSObject> holder,
2767 Handle<JSFunction> setter) {
2768 // ----------- S t a t e -------------
2769 // -- r0 : value
2770 // -- r1 : receiver
2771 // -- r2 : name
2772 // -- lr : return address
2773 // -----------------------------------
2774 Label miss;
2775
2776 // Check that the maps haven't changed.
2777 __ JumpIfSmi(r1, &miss);
2778 CheckPrototypes(receiver, r1, holder, r3, r4, r5, name, &miss);
2779
2780 GenerateStoreViaSetter(masm(), setter);
2754 2781
2755 __ bind(&miss); 2782 __ bind(&miss);
2756 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); 2783 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2757 __ Jump(ic, RelocInfo::CODE_TARGET); 2784 __ Jump(ic, RelocInfo::CODE_TARGET);
2758 2785
2759 // Return the generated code. 2786 // Return the generated code.
2760 return GetCode(Code::CALLBACKS, name); 2787 return GetCode(Code::CALLBACKS, name);
2761 } 2788 }
2762 2789
2763 2790
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
4725 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4752 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4726 } 4753 }
4727 } 4754 }
4728 4755
4729 4756
4730 #undef __ 4757 #undef __
4731 4758
4732 } } // namespace v8::internal 4759 } } // namespace v8::internal
4733 4760
4734 #endif // V8_TARGET_ARCH_ARM 4761 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698