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

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

Issue 10855098: Deoptimization support for accessors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed unit tests. 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
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 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2711 // Handle store cache miss. 2711 // Handle store cache miss.
2712 __ bind(&miss); 2712 __ bind(&miss);
2713 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); 2713 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2714 __ Jump(ic, RelocInfo::CODE_TARGET); 2714 __ Jump(ic, RelocInfo::CODE_TARGET);
2715 2715
2716 // Return the generated code. 2716 // Return the generated code.
2717 return GetCode(Code::CALLBACKS, name); 2717 return GetCode(Code::CALLBACKS, name);
2718 } 2718 }
2719 2719
2720 2720
2721 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( 2721 #undef __
2722 Handle<String> name, 2722 #define __ ACCESS_MASM(masm)
2723 Handle<JSObject> receiver, 2723
2724 Handle<JSObject> holder, 2724
2725 void StoreStubCompiler::GenerateStoreViaSetter(
2726 MacroAssembler* masm,
2725 Handle<JSFunction> setter) { 2727 Handle<JSFunction> setter) {
2726 // ----------- S t a t e ------------- 2728 // ----------- S t a t e -------------
2727 // -- a0 : value 2729 // -- a0 : value
2728 // -- a1 : receiver 2730 // -- a1 : receiver
2729 // -- a2 : name 2731 // -- a2 : name
2730 // -- ra : return address 2732 // -- ra : return address
2731 // ----------------------------------- 2733 // -----------------------------------
2732 Label miss;
2733
2734 // Check that the maps haven't changed.
2735 __ JumpIfSmi(a1, &miss);
2736 CheckPrototypes(receiver, a1, holder, a3, t0, t1, name, &miss);
2737
2738 { 2734 {
2739 FrameScope scope(masm(), StackFrame::INTERNAL); 2735 FrameScope scope(masm, StackFrame::INTERNAL);
2740 2736
2741 // Save value register, so we can restore it later. 2737 // Save value register, so we can restore it later.
2742 __ push(a0); 2738 __ push(a0);
2743 2739
2744 // Call the JavaScript setter with the receiver and the value on the stack. 2740 // Call the JavaScript setter with the receiver and the value on the stack.
2745 __ push(a1); 2741 __ push(a1);
2746 __ push(a0); 2742 __ push(a0);
2747 ParameterCount actual(1); 2743 ParameterCount actual(1);
2748 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), 2744 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
2749 CALL_AS_METHOD); 2745 CALL_AS_METHOD);
2750 2746
2751 // We have to return the passed value, not the return value of the setter. 2747 // We have to return the passed value, not the return value of the setter.
2752 __ pop(v0); 2748 __ pop(v0);
2753 2749
2754 // Restore context register. 2750 // Restore context register.
2755 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2751 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2756 } 2752 }
2757 __ Ret(); 2753 __ Ret();
2754 }
2755
2756
2757 #undef __
2758 #define __ ACCESS_MASM(masm())
2759
2760
2761 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2762 Handle<String> name,
2763 Handle<JSObject> receiver,
2764 Handle<JSObject> holder,
2765 Handle<JSFunction> setter) {
2766 // ----------- S t a t e -------------
2767 // -- a0 : value
2768 // -- a1 : receiver
2769 // -- a2 : name
2770 // -- ra : return address
2771 // -----------------------------------
2772 Label miss;
2773
2774 // Check that the maps haven't changed.
2775 __ JumpIfSmi(a1, &miss);
2776 CheckPrototypes(receiver, a1, holder, a3, t0, t1, name, &miss);
2777
2778 GenerateStoreViaSetter(masm(), setter);
2758 2779
2759 __ bind(&miss); 2780 __ bind(&miss);
2760 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); 2781 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2761 __ Jump(ic, RelocInfo::CODE_TARGET); 2782 __ Jump(ic, RelocInfo::CODE_TARGET);
2762 2783
2763 // Return the generated code. 2784 // Return the generated code.
2764 return GetCode(Code::CALLBACKS, name); 2785 return GetCode(Code::CALLBACKS, name);
2765 } 2786 }
2766 2787
2767 2788
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
4786 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4807 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4787 } 4808 }
4788 } 4809 }
4789 4810
4790 4811
4791 #undef __ 4812 #undef __
4792 4813
4793 } } // namespace v8::internal 4814 } } // namespace v8::internal
4794 4815
4795 #endif // V8_TARGET_ARCH_MIPS 4816 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698