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

Side by Side Diff: src/ia32/virtual-frame-ia32.cc

Issue 601080: Change KeyedLoadIC interface on ia32 to take receiver and name in registers. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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
« no previous file with comments | « src/ia32/stub-cache-ia32.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 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 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 receiver.ToRegister(eax); 917 receiver.ToRegister(eax);
918 name.ToRegister(ecx); 918 name.ToRegister(ecx);
919 } 919 }
920 name.Unuse(); 920 name.Unuse();
921 receiver.Unuse(); 921 receiver.Unuse();
922 return RawCallCodeObject(ic, mode); 922 return RawCallCodeObject(ic, mode);
923 } 923 }
924 924
925 925
926 Result VirtualFrame::CallKeyedLoadIC(RelocInfo::Mode mode) { 926 Result VirtualFrame::CallKeyedLoadIC(RelocInfo::Mode mode) {
927 // Key and receiver are on top of the frame. The IC expects them on 927 // Key and receiver are on top of the frame. Put them in eax and edx.
928 // the stack. It does not drop them. 928 Result key = Pop();
929 Result receiver = Pop();
930 PrepareForCall(0, 0);
931
932 if (!key.is_register() || !key.reg().is(edx)) {
933 // Register edx is available for receiver.
934 receiver.ToRegister(edx);
935 key.ToRegister(eax);
936 } else if (!receiver.is_register() || !receiver.reg().is(eax)) {
937 // Register eax is available for key.
938 key.ToRegister(eax);
939 receiver.ToRegister(edx);
940 } else {
941 __ xchg(edx, eax);
942 }
943 key.Unuse();
944 receiver.Unuse();
945
929 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); 946 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
930 PrepareForCall(2, 0); // Two stack args, neither callee-dropped.
931 return RawCallCodeObject(ic, mode); 947 return RawCallCodeObject(ic, mode);
932 } 948 }
933 949
934 950
935 Result VirtualFrame::CallStoreIC() { 951 Result VirtualFrame::CallStoreIC() {
936 // Name, value, and receiver are on top of the frame. The IC 952 // Name, value, and receiver are on top of the frame. The IC
937 // expects name in ecx, value in eax, and receiver in edx. 953 // expects name in ecx, value in eax, and receiver in edx.
938 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); 954 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
939 Result name = Pop(); 955 Result name = Pop();
940 Result value = Pop(); 956 Result value = Pop();
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 ASSERT(stack_pointer_ == element_count() - 1); 1171 ASSERT(stack_pointer_ == element_count() - 1);
1156 elements_.Add(FrameElement::MemoryElement(info)); 1172 elements_.Add(FrameElement::MemoryElement(info));
1157 stack_pointer_++; 1173 stack_pointer_++;
1158 __ push(immediate); 1174 __ push(immediate);
1159 } 1175 }
1160 1176
1161 1177
1162 #undef __ 1178 #undef __
1163 1179
1164 } } // namespace v8::internal 1180 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698