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 2572 matching lines...) Loading... |
2583 __ bind(&miss); | 2583 __ bind(&miss); |
2584 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2584 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
2585 __ jmp(ic, RelocInfo::CODE_TARGET); | 2585 __ jmp(ic, RelocInfo::CODE_TARGET); |
2586 | 2586 |
2587 // Return the generated code. | 2587 // Return the generated code. |
2588 return GetCode(Code::CALLBACKS, name); | 2588 return GetCode(Code::CALLBACKS, name); |
2589 } | 2589 } |
2590 | 2590 |
2591 | 2591 |
2592 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( | 2592 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
| 2593 Handle<String> name, |
2593 Handle<JSObject> receiver, | 2594 Handle<JSObject> receiver, |
2594 Handle<JSFunction> setter, | 2595 Handle<JSObject> holder, |
2595 Handle<String> name) { | 2596 Handle<JSFunction> setter) { |
2596 // ----------- S t a t e ------------- | 2597 // ----------- S t a t e ------------- |
2597 // -- eax : value | 2598 // -- eax : value |
2598 // -- ecx : name | 2599 // -- ecx : name |
2599 // -- edx : receiver | 2600 // -- edx : receiver |
2600 // -- esp[0] : return address | 2601 // -- esp[0] : return address |
2601 // ----------------------------------- | 2602 // ----------------------------------- |
2602 Label miss; | 2603 Label miss; |
2603 | 2604 |
2604 // Check that the map of the object hasn't changed. | 2605 // Check that the maps haven't changed, preserving the name register. |
2605 __ CheckMap(edx, Handle<Map>(receiver->map()), &miss, DO_SMI_CHECK, | 2606 __ push(ecx); |
2606 ALLOW_ELEMENT_TRANSITION_MAPS); | 2607 __ JumpIfSmi(edx, &miss); |
| 2608 CheckPrototypes(receiver, edx, holder, ebx, ecx, edi, name, &miss); |
| 2609 __ pop(ecx); |
2607 | 2610 |
2608 { | 2611 { |
2609 FrameScope scope(masm(), StackFrame::INTERNAL); | 2612 FrameScope scope(masm(), StackFrame::INTERNAL); |
2610 | 2613 |
2611 // Save value register, so we can restore it later. | 2614 // Save value register, so we can restore it later. |
2612 __ push(eax); | 2615 __ push(eax); |
2613 | 2616 |
2614 // Call the JavaScript getter with the receiver and the value on the stack. | 2617 // Call the JavaScript setter with the receiver and the value on the stack. |
2615 __ push(edx); | 2618 __ push(edx); |
2616 __ push(eax); | 2619 __ push(eax); |
2617 ParameterCount actual(1); | 2620 ParameterCount actual(1); |
2618 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), | 2621 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), |
2619 CALL_AS_METHOD); | 2622 CALL_AS_METHOD); |
2620 | 2623 |
2621 // We have to return the passed value, not the return value of the setter. | 2624 // We have to return the passed value, not the return value of the setter. |
2622 __ pop(eax); | 2625 __ pop(eax); |
2623 | 2626 |
2624 // Restore context register. | 2627 // Restore context register. |
2625 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2628 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
2626 } | 2629 } |
2627 __ ret(0); | 2630 __ ret(0); |
2628 | 2631 |
2629 __ bind(&miss); | 2632 __ bind(&miss); |
| 2633 __ pop(ecx); |
2630 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); | 2634 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |
2631 __ jmp(ic, RelocInfo::CODE_TARGET); | 2635 __ jmp(ic, RelocInfo::CODE_TARGET); |
2632 | 2636 |
2633 // Return the generated code. | 2637 // Return the generated code. |
2634 return GetCode(Code::CALLBACKS, name); | 2638 return GetCode(Code::CALLBACKS, name); |
2635 } | 2639 } |
2636 | 2640 |
2637 | 2641 |
2638 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( | 2642 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
2639 Handle<JSObject> receiver, | 2643 Handle<JSObject> receiver, |
(...skipping 1602 matching lines...) Loading... |
4242 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4246 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
4243 } | 4247 } |
4244 } | 4248 } |
4245 | 4249 |
4246 | 4250 |
4247 #undef __ | 4251 #undef __ |
4248 | 4252 |
4249 } } // namespace v8::internal | 4253 } } // namespace v8::internal |
4250 | 4254 |
4251 #endif // V8_TARGET_ARCH_IA32 | 4255 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |