OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 } | 1161 } |
1162 value->Unuse(); | 1162 value->Unuse(); |
1163 key->Unuse(); | 1163 key->Unuse(); |
1164 receiver->Unuse(); | 1164 receiver->Unuse(); |
1165 } | 1165 } |
1166 | 1166 |
1167 return RawCallCodeObject(ic, RelocInfo::CODE_TARGET); | 1167 return RawCallCodeObject(ic, RelocInfo::CODE_TARGET); |
1168 } | 1168 } |
1169 | 1169 |
1170 | 1170 |
| 1171 Result VirtualFrame::CallStoreIC(Handle<String> name, bool is_contextual) { |
| 1172 // Value and (if not contextual) receiver are on top of the frame. |
| 1173 // The IC expects name in rcx, value in rax, and receiver in rdx. |
| 1174 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); |
| 1175 Result value = Pop(); |
| 1176 if (is_contextual) { |
| 1177 PrepareForCall(0, 0); |
| 1178 value.ToRegister(rax); |
| 1179 __ movq(rdx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 1180 value.Unuse(); |
| 1181 } else { |
| 1182 Result receiver = Pop(); |
| 1183 PrepareForCall(0, 0); |
| 1184 MoveResultsToRegisters(&value, &receiver, rax, rdx); |
| 1185 } |
| 1186 __ Move(rcx, name); |
| 1187 return RawCallCodeObject(ic, RelocInfo::CODE_TARGET); |
| 1188 } |
| 1189 |
| 1190 |
1171 Result VirtualFrame::CallCallIC(RelocInfo::Mode mode, | 1191 Result VirtualFrame::CallCallIC(RelocInfo::Mode mode, |
1172 int arg_count, | 1192 int arg_count, |
1173 int loop_nesting) { | 1193 int loop_nesting) { |
1174 // Function name, arguments, and receiver are found on top of the frame | 1194 // Function name, arguments, and receiver are found on top of the frame |
1175 // and dropped by the call. The IC expects the name in rcx and the rest | 1195 // and dropped by the call. The IC expects the name in rcx and the rest |
1176 // on the stack, and drops them all. | 1196 // on the stack, and drops them all. |
1177 InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP; | 1197 InLoopFlag in_loop = loop_nesting > 0 ? IN_LOOP : NOT_IN_LOOP; |
1178 Handle<Code> ic = cgen()->ComputeCallInitialize(arg_count, in_loop); | 1198 Handle<Code> ic = cgen()->ComputeCallInitialize(arg_count, in_loop); |
1179 Result name = Pop(); | 1199 Result name = Pop(); |
1180 // Spill args, receiver, and function. The call will drop args and | 1200 // Spill args, receiver, and function. The call will drop args and |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 Adjust(kHandlerSize - 1); | 1256 Adjust(kHandlerSize - 1); |
1237 __ PushTryHandler(IN_JAVASCRIPT, type); | 1257 __ PushTryHandler(IN_JAVASCRIPT, type); |
1238 } | 1258 } |
1239 | 1259 |
1240 | 1260 |
1241 #undef __ | 1261 #undef __ |
1242 | 1262 |
1243 } } // namespace v8::internal | 1263 } } // namespace v8::internal |
1244 | 1264 |
1245 #endif // V8_TARGET_ARCH_X64 | 1265 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |