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 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 // Handle store cache miss. | 2665 // Handle store cache miss. |
2666 __ bind(&miss); | 2666 __ bind(&miss); |
2667 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); | 2667 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |
2668 __ Jump(ic, RelocInfo::CODE_TARGET); | 2668 __ Jump(ic, RelocInfo::CODE_TARGET); |
2669 | 2669 |
2670 // Return the generated code. | 2670 // Return the generated code. |
2671 return GetCode(CALLBACKS, name); | 2671 return GetCode(CALLBACKS, name); |
2672 } | 2672 } |
2673 | 2673 |
2674 | 2674 |
| 2675 Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
| 2676 Handle<JSObject> receiver, |
| 2677 Handle<JSFunction> setter, |
| 2678 Handle<String> name) { |
| 2679 // ----------- S t a t e ------------- |
| 2680 // -- a0 : value |
| 2681 // -- a1 : receiver |
| 2682 // -- a2 : name |
| 2683 // -- ra : return address |
| 2684 // ----------------------------------- |
| 2685 Label miss; |
| 2686 |
| 2687 // Check that the map of the object hasn't changed. |
| 2688 __ CheckMap(a1, a3, Handle<Map>(receiver->map()), &miss, DO_SMI_CHECK, |
| 2689 ALLOW_ELEMENT_TRANSITION_MAPS); |
| 2690 |
| 2691 { |
| 2692 FrameScope scope(masm(), StackFrame::INTERNAL); |
| 2693 |
| 2694 // Save value register, so we can restore it later. |
| 2695 __ push(a0); |
| 2696 |
| 2697 // Call the JavaScript getter with the receiver and the value on the stack. |
| 2698 __ push(a1); |
| 2699 __ push(a0); |
| 2700 ParameterCount actual(1); |
| 2701 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), |
| 2702 CALL_AS_METHOD); |
| 2703 |
| 2704 // We have to return the passed value, not the return value of the setter. |
| 2705 __ pop(a0); |
| 2706 |
| 2707 // Restore context register. |
| 2708 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2709 } |
| 2710 __ Ret(); |
| 2711 |
| 2712 __ bind(&miss); |
| 2713 Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |
| 2714 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 2715 |
| 2716 // Return the generated code. |
| 2717 return GetCode(CALLBACKS, name); |
| 2718 } |
| 2719 |
| 2720 |
2675 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( | 2721 Handle<Code> StoreStubCompiler::CompileStoreInterceptor( |
2676 Handle<JSObject> receiver, | 2722 Handle<JSObject> receiver, |
2677 Handle<String> name) { | 2723 Handle<String> name) { |
2678 // ----------- S t a t e ------------- | 2724 // ----------- S t a t e ------------- |
2679 // -- a0 : value | 2725 // -- a0 : value |
2680 // -- a1 : receiver | 2726 // -- a1 : receiver |
2681 // -- a2 : name | 2727 // -- a2 : name |
2682 // -- ra : return address | 2728 // -- ra : return address |
2683 // ----------------------------------- | 2729 // ----------------------------------- |
2684 Label miss; | 2730 Label miss; |
(...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4691 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4737 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4692 } | 4738 } |
4693 } | 4739 } |
4694 | 4740 |
4695 | 4741 |
4696 #undef __ | 4742 #undef __ |
4697 | 4743 |
4698 } } // namespace v8::internal | 4744 } } // namespace v8::internal |
4699 | 4745 |
4700 #endif // V8_TARGET_ARCH_MIPS | 4746 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |