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

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

Issue 10873057: Added IC support for native setters on the prototype chain. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 3 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') | src/ic.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 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after
2594 __ jmp(ic, RelocInfo::CODE_TARGET); 2594 __ jmp(ic, RelocInfo::CODE_TARGET);
2595 2595
2596 // Return the generated code. 2596 // Return the generated code.
2597 return GetCode(transition.is_null() 2597 return GetCode(transition.is_null()
2598 ? Code::FIELD 2598 ? Code::FIELD
2599 : Code::MAP_TRANSITION, name); 2599 : Code::MAP_TRANSITION, name);
2600 } 2600 }
2601 2601
2602 2602
2603 Handle<Code> StoreStubCompiler::CompileStoreCallback( 2603 Handle<Code> StoreStubCompiler::CompileStoreCallback(
2604 Handle<JSObject> object, 2604 Handle<String> name,
2605 Handle<AccessorInfo> callback, 2605 Handle<JSObject> receiver,
2606 Handle<String> name) { 2606 Handle<JSObject> holder,
2607 Handle<AccessorInfo> callback) {
2607 // ----------- S t a t e ------------- 2608 // ----------- S t a t e -------------
2608 // -- eax : value 2609 // -- eax : value
2609 // -- ecx : name 2610 // -- ecx : name
2610 // -- edx : receiver 2611 // -- edx : receiver
2611 // -- esp[0] : return address 2612 // -- esp[0] : return address
2612 // ----------------------------------- 2613 // -----------------------------------
2613 Label miss; 2614 Label miss;
2615 // Check that the maps haven't changed, preserving the value register.
2616 __ push(eax);
2617 __ JumpIfSmi(edx, &miss);
2618 CheckPrototypes(receiver, edx, holder, ebx, eax, edi, name, &miss);
2619 __ pop(eax); // restore value
2614 2620
2615 // Check that the map of the object hasn't changed. 2621 // Stub never generated for non-global objects that require access checks.
2616 __ CheckMap(edx, Handle<Map>(object->map()), 2622 ASSERT(holder->IsJSGlobalProxy() || !holder->IsAccessCheckNeeded());
2617 &miss, DO_SMI_CHECK, ALLOW_ELEMENT_TRANSITION_MAPS);
2618
2619 // Perform global security token check if needed.
2620 if (object->IsJSGlobalProxy()) {
2621 __ CheckAccessGlobalProxy(edx, ebx, &miss);
2622 }
2623
2624 // Stub never generated for non-global objects that require access
2625 // checks.
2626 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
2627 2623
2628 __ pop(ebx); // remove the return address 2624 __ pop(ebx); // remove the return address
2629 __ push(edx); // receiver 2625 __ push(edx); // receiver
2630 __ push(Immediate(callback)); // callback info 2626 __ push(Immediate(callback)); // callback info
2631 __ push(ecx); // name 2627 __ push(ecx); // name
2632 __ push(eax); // value 2628 __ push(eax); // value
2633 __ push(ebx); // restore return address 2629 __ push(ebx); // restore return address
2634 2630
2635 // Do tail-call to the runtime system. 2631 // Do tail-call to the runtime system.
2636 ExternalReference store_callback_property = 2632 ExternalReference store_callback_property =
2637 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate()); 2633 ExternalReference(IC_Utility(IC::kStoreCallbackProperty), isolate());
2638 __ TailCallExternalReference(store_callback_property, 4, 1); 2634 __ TailCallExternalReference(store_callback_property, 4, 1);
2639 2635
2640 // Handle store cache miss. 2636 // Handle store cache miss.
2641 __ bind(&miss); 2637 __ bind(&miss);
2638 __ pop(eax);
2642 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2639 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2643 __ jmp(ic, RelocInfo::CODE_TARGET); 2640 __ jmp(ic, RelocInfo::CODE_TARGET);
2644 2641
2645 // Return the generated code. 2642 // Return the generated code.
2646 return GetCode(Code::CALLBACKS, name); 2643 return GetCode(Code::CALLBACKS, name);
2647 } 2644 }
2648 2645
2649 2646
2650 #undef __ 2647 #undef __
2651 #define __ ACCESS_MASM(masm) 2648 #define __ ACCESS_MASM(masm)
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after
4331 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 4328 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4332 } 4329 }
4333 } 4330 }
4334 4331
4335 4332
4336 #undef __ 4333 #undef __
4337 4334
4338 } } // namespace v8::internal 4335 } } // namespace v8::internal
4339 4336
4340 #endif // V8_TARGET_ARCH_IA32 4337 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ic.cc » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698