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

Side by Side Diff: src/x64/stub-cache-x64.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
« src/ia32/stub-cache-ia32.cc ('K') | « src/stub-cache.cc ('k') | no next file » | 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 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 // Handle store cache miss. 2417 // Handle store cache miss.
2418 __ bind(&miss); 2418 __ bind(&miss);
2419 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2419 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2420 __ Jump(ic, RelocInfo::CODE_TARGET); 2420 __ Jump(ic, RelocInfo::CODE_TARGET);
2421 2421
2422 // Return the generated code. 2422 // Return the generated code.
2423 return GetCode(CALLBACKS, name); 2423 return GetCode(CALLBACKS, name);
2424 } 2424 }
2425 2425
2426 2426
2427 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2428 Handle<JSObject> receiver,
2429 Handle<JSFunction> setter,
2430 Handle<String> name) {
2431 // ----------- S t a t e -------------
2432 // -- rax : value
2433 // -- rcx : name
2434 // -- rdx : receiver
2435 // -- rsp[0] : return address
2436 // -----------------------------------
2437 Label miss;
2438
2439 // Check that the map of the object hasn't changed.
2440 __ CheckMap(rdx, Handle<Map>(receiver->map()), &miss, DO_SMI_CHECK,
2441 ALLOW_ELEMENT_TRANSITION_MAPS);
2442
2443 {
2444 FrameScope scope(masm(), StackFrame::INTERNAL);
2445
2446 // Save value register, so we can restore it later.
2447 __ push(rax);
2448
2449 // Call the JavaScript getter with the receiver and the value on the stack.
2450 __ push(rdx);
2451 __ push(rax);
2452 ParameterCount actual(1);
2453 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
2454 CALL_AS_METHOD);
2455
2456 // We have to return the passed value, not the return value of the setter.
2457 __ pop(rax);
2458
2459 // Restore context register.
2460 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
2461 }
2462 __ ret(0);
2463
2464 __ bind(&miss);
2465 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2466 __ Jump(ic, RelocInfo::CODE_TARGET);
2467
2468 // Return the generated code.
2469 return GetCode(CALLBACKS, name);
2470 }
2471
2472
2427 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( 2473 Handle<Code> StoreStubCompiler::CompileStoreInterceptor(
2428 Handle<JSObject> receiver, 2474 Handle<JSObject> receiver,
2429 Handle<String> name) { 2475 Handle<String> name) {
2430 // ----------- S t a t e ------------- 2476 // ----------- S t a t e -------------
2431 // -- rax : value 2477 // -- rax : value
2432 // -- rcx : name 2478 // -- rcx : name
2433 // -- rdx : receiver 2479 // -- rdx : receiver
2434 // -- rsp[0] : return address 2480 // -- rsp[0] : return address
2435 // ----------------------------------- 2481 // -----------------------------------
2436 Label miss; 2482 Label miss;
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
3950 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 3996 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
3951 } 3997 }
3952 } 3998 }
3953 3999
3954 4000
3955 #undef __ 4001 #undef __
3956 4002
3957 } } // namespace v8::internal 4003 } } // namespace v8::internal
3958 4004
3959 #endif // V8_TARGET_ARCH_X64 4005 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/ia32/stub-cache-ia32.cc ('K') | « src/stub-cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698