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

Side by Side Diff: src/ia32/stub-cache-ia32.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 | « src/arm/stub-cache-arm.cc ('k') | src/ic.cc » ('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 2569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 // Handle store cache miss. 2580 // Handle store cache miss.
2581 __ bind(&miss); 2581 __ bind(&miss);
2582 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2582 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2583 __ jmp(ic, RelocInfo::CODE_TARGET); 2583 __ jmp(ic, RelocInfo::CODE_TARGET);
2584 2584
2585 // Return the generated code. 2585 // Return the generated code.
2586 return GetCode(CALLBACKS, name); 2586 return GetCode(CALLBACKS, name);
2587 } 2587 }
2588 2588
2589 2589
2590 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2591 Handle<JSObject> receiver,
2592 Handle<JSFunction> setter,
2593 Handle<String> name) {
2594 // ----------- S t a t e -------------
2595 // -- eax : value
2596 // -- ecx : name
2597 // -- edx : receiver
2598 // -- esp[0] : return address
2599 // -----------------------------------
2600 Label miss;
2601
2602 // Check that the map of the object hasn't changed.
2603 __ CheckMap(edx, Handle<Map>(receiver->map()), &miss, DO_SMI_CHECK,
Vyacheslav Egorov (Google) 2012/06/17 10:17:09 Is there any reason why we are not giving benefits
2604 ALLOW_ELEMENT_TRANSITION_MAPS);
2605
2606 {
2607 FrameScope scope(masm(), StackFrame::INTERNAL);
2608
2609 // Save value register, so we can restore it later.
2610 __ push(eax);
2611
2612 // Call the JavaScript getter with the receiver and the value on the stack.
Vyacheslav Egorov (Google) 2012/06/17 10:17:09 s/getter/setter/
2613 __ push(edx);
2614 __ push(eax);
2615 ParameterCount actual(1);
2616 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
2617 CALL_AS_METHOD);
2618
2619 // We have to return the passed value, not the return value of the setter.
2620 __ pop(eax);
2621
2622 // Restore context register.
2623 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2624 }
2625 __ ret(0);
2626
2627 __ bind(&miss);
2628 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2629 __ jmp(ic, RelocInfo::CODE_TARGET);
2630
2631 // Return the generated code.
2632 return GetCode(CALLBACKS, name);
2633 }
2634
2635
2590 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( 2636 Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
2591 Handle<JSObject> receiver, 2637 Handle<JSObject> receiver,
2592 Handle<String> name) { 2638 Handle<String> name) {
2593 // ----------- S t a t e ------------- 2639 // ----------- S t a t e -------------
2594 // -- eax : value 2640 // -- eax : value
2595 // -- ecx : name 2641 // -- ecx : name
2596 // -- edx : receiver 2642 // -- edx : receiver
2597 // -- esp[0] : return address 2643 // -- esp[0] : return address
2598 // ----------------------------------- 2644 // -----------------------------------
2599 Label miss; 2645 Label miss;
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
4192 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 4238 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4193 } 4239 }
4194 } 4240 }
4195 4241
4196 4242
4197 #undef __ 4243 #undef __
4198 4244
4199 } } // namespace v8::internal 4245 } } // namespace v8::internal
4200 4246
4201 #endif // V8_TARGET_ARCH_IA32 4247 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698