OLD | NEW |
---|---|
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
850 // name slot (but it does drop the rest). | 850 // name slot (but it does drop the rest). |
851 InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP; | 851 InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP; |
852 Handle<Code> ic = cgen()->ComputeCallInitialize(arg_count, in_loop); | 852 Handle<Code> ic = cgen()->ComputeCallInitialize(arg_count, in_loop); |
853 // Spill args, receiver, and function. The call will drop args and | 853 // Spill args, receiver, and function. The call will drop args and |
854 // receiver. | 854 // receiver. |
855 PrepareForCall(arg_count + 2, arg_count + 1); | 855 PrepareForCall(arg_count + 2, arg_count + 1); |
856 return RawCallCodeObject(ic, mode); | 856 return RawCallCodeObject(ic, mode); |
857 } | 857 } |
858 | 858 |
859 | 859 |
860 Result VirtualFrame::CallStoreIC() { | |
861 // Name, value, and receiver are on top of the frame. The IC | |
862 // expects name in ecx, value in eax, and receiver on the stack. It | |
William Hesse
2009/06/22 19:14:23
rcx, value in rax,
Mads Ager (chromium)
2009/06/22 19:25:00
Done.
| |
863 // does not drop the receiver. | |
864 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); | |
865 Result name = Pop(); | |
866 Result value = Pop(); | |
867 PrepareForCall(1, 0); // One stack arg, not callee-dropped. | |
868 | |
869 if (value.is_register() && value.reg().is(rcx)) { | |
870 if (name.is_register() && name.reg().is(rax)) { | |
871 // Wrong registers. | |
872 __ xchg(rax, rcx); | |
873 } else { | |
874 // Register eax is free for value, which frees ecx for name. | |
William Hesse
2009/06/22 19:14:23
Register rax ... rcx
Mads Ager (chromium)
2009/06/22 19:25:00
Done.
| |
875 value.ToRegister(rax); | |
876 name.ToRegister(rcx); | |
877 } | |
878 } else { | |
879 // Register ecx is free for name, which guarantees eax is free for | |
William Hesse
2009/06/22 19:14:23
rcx ... rax
Mads Ager (chromium)
2009/06/22 19:25:00
Done.
| |
880 // value. | |
881 name.ToRegister(rcx); | |
882 value.ToRegister(rax); | |
883 } | |
884 | |
885 name.Unuse(); | |
886 value.Unuse(); | |
887 return RawCallCodeObject(ic, RelocInfo::CODE_TARGET); | |
888 } | |
860 | 889 |
861 | 890 |
862 #undef __ | 891 #undef __ |
863 | 892 |
864 } } // namespace v8::internal | 893 } } // namespace v8::internal |
OLD | NEW |