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

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

Issue 10534091: Implemented StoreIC for setters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/ia32/stub-cache-ia32.cc » ('J')
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 2650 matching lines...) Expand 10 before | Expand all | Expand 10 after
2661 // Handle store cache miss. 2661 // Handle store cache miss.
2662 __ bind(&miss); 2662 __ bind(&miss);
2663 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); 2663 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2664 __ Jump(ic, RelocInfo::CODE_TARGET); 2664 __ Jump(ic, RelocInfo::CODE_TARGET);
2665 2665
2666 // Return the generated code. 2666 // Return the generated code.
2667 return GetCode(CALLBACKS, name); 2667 return GetCode(CALLBACKS, name);
2668 } 2668 }
2669 2669
2670 2670
2671 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2672 Handle<JSObject> receiver,
2673 Handle<JSFunction> setter,
2674 Handle<String> name) {
2675 // ----------- S t a t e -------------
2676 // -- r0 : value
2677 // -- r1 : receiver
2678 // -- r2 : name
2679 // -- lr : return address
2680 // -----------------------------------
2681 Label miss;
2682
2683 // Check that the map of the object hasn't changed.
2684 __ CheckMap(r1, r3, Handle<Map>(receiver->map()), &miss, DO_SMI_CHECK,
2685 ALLOW_ELEMENT_TRANSITION_MAPS);
2686
2687 {
2688 FrameScope scope(masm(), StackFrame::INTERNAL);
2689
2690 // Save value register, so we can restore it later.
2691 __ push(r0);
2692
2693 // Call the JavaScript getter with the receiver and the value on the stack.
2694 __ Push(r1, r0);
2695 ParameterCount actual(1);
2696 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
2697 CALL_AS_METHOD);
2698
2699 // We have to return the passed value, not the return value of the setter.
2700 __ pop(r0);
2701
2702 // Restore context register.
2703 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2704 }
2705 __ Ret();
2706
2707 __ bind(&miss);
2708 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss();
2709 __ Jump(ic, RelocInfo::CODE_TARGET);
2710
2711 // Return the generated code.
2712 return GetCode(CALLBACKS, name);
2713 }
2714
2715
2671 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( 2716 Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
2672 Handle<JSObject> receiver, 2717 Handle<JSObject> receiver,
2673 Handle<String> name) { 2718 Handle<String> name) {
2674 // ----------- S t a t e ------------- 2719 // ----------- S t a t e -------------
2675 // -- r0 : value 2720 // -- r0 : value
2676 // -- r1 : receiver 2721 // -- r1 : receiver
2677 // -- r2 : name 2722 // -- r2 : name
2678 // -- lr : return address 2723 // -- lr : return address
2679 // ----------------------------------- 2724 // -----------------------------------
2680 Label miss; 2725 Label miss;
(...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after
4630 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4675 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4631 } 4676 }
4632 } 4677 }
4633 4678
4634 4679
4635 #undef __ 4680 #undef __
4636 4681
4637 } } // namespace v8::internal 4682 } } // namespace v8::internal
4638 4683
4639 #endif // V8_TARGET_ARCH_ARM 4684 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | src/ia32/stub-cache-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698