| OLD | NEW |
| 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 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 __ bind(&miss); | 2420 __ bind(&miss); |
| 2421 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2421 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
| 2422 __ Jump(ic, RelocInfo::CODE_TARGET); | 2422 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 2423 | 2423 |
| 2424 // Return the generated code. | 2424 // Return the generated code. |
| 2425 return GetCode(Code::CALLBACKS, name); | 2425 return GetCode(Code::CALLBACKS, name); |
| 2426 } | 2426 } |
| 2427 | 2427 |
| 2428 | 2428 |
| 2429 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( | 2429 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
| 2430 Handle<String> name, |
| 2430 Handle<JSObject> receiver, | 2431 Handle<JSObject> receiver, |
| 2431 Handle<JSFunction> setter, | 2432 Handle<JSObject> holder, |
| 2432 Handle<String> name) { | 2433 Handle<JSFunction> setter) { |
| 2433 // ----------- S t a t e ------------- | 2434 // ----------- S t a t e ------------- |
| 2434 // -- rax : value | 2435 // -- rax : value |
| 2435 // -- rcx : name | 2436 // -- rcx : name |
| 2436 // -- rdx : receiver | 2437 // -- rdx : receiver |
| 2437 // -- rsp[0] : return address | 2438 // -- rsp[0] : return address |
| 2438 // ----------------------------------- | 2439 // ----------------------------------- |
| 2439 Label miss; | 2440 Label miss; |
| 2440 | 2441 |
| 2441 // Check that the map of the object hasn't changed. | 2442 // Check that the maps haven't changed. |
| 2442 __ CheckMap(rdx, Handle<Map>(receiver->map()), &miss, DO_SMI_CHECK, | 2443 __ JumpIfSmi(rdx, &miss); |
| 2443 ALLOW_ELEMENT_TRANSITION_MAPS); | 2444 CheckPrototypes(receiver, rdx, holder, rbx, r8, rdi, name, &miss); |
| 2444 | 2445 |
| 2445 { | 2446 { |
| 2446 FrameScope scope(masm(), StackFrame::INTERNAL); | 2447 FrameScope scope(masm(), StackFrame::INTERNAL); |
| 2447 | 2448 |
| 2448 // Save value register, so we can restore it later. | 2449 // Save value register, so we can restore it later. |
| 2449 __ push(rax); | 2450 __ push(rax); |
| 2450 | 2451 |
| 2451 // Call the JavaScript getter with the receiver and the value on the stack. | 2452 // Call the JavaScript setter with the receiver and the value on the stack. |
| 2452 __ push(rdx); | 2453 __ push(rdx); |
| 2453 __ push(rax); | 2454 __ push(rax); |
| 2454 ParameterCount actual(1); | 2455 ParameterCount actual(1); |
| 2455 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), | 2456 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), |
| 2456 CALL_AS_METHOD); | 2457 CALL_AS_METHOD); |
| 2457 | 2458 |
| 2458 // We have to return the passed value, not the return value of the setter. | 2459 // We have to return the passed value, not the return value of the setter. |
| 2459 __ pop(rax); | 2460 __ pop(rax); |
| 2460 | 2461 |
| 2461 // Restore context register. | 2462 // Restore context register. |
| (...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4000 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4001 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
| 4001 } | 4002 } |
| 4002 } | 4003 } |
| 4003 | 4004 |
| 4004 | 4005 |
| 4005 #undef __ | 4006 #undef __ |
| 4006 | 4007 |
| 4007 } } // namespace v8::internal | 4008 } } // namespace v8::internal |
| 4008 | 4009 |
| 4009 #endif // V8_TARGET_ARCH_X64 | 4010 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |