| 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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 PushElementAt(arg_count + 1); | 1214 PushElementAt(arg_count + 1); |
| 1215 Result function = Pop(); | 1215 Result function = Pop(); |
| 1216 PrepareForCall(arg_count + 1, arg_count + 1); // Spill args and receiver. | 1216 PrepareForCall(arg_count + 1, arg_count + 1); // Spill args and receiver. |
| 1217 function.ToRegister(rdi); | 1217 function.ToRegister(rdi); |
| 1218 | 1218 |
| 1219 // Constructors are called with the number of arguments in register | 1219 // Constructors are called with the number of arguments in register |
| 1220 // rax for now. Another option would be to have separate construct | 1220 // rax for now. Another option would be to have separate construct |
| 1221 // call trampolines per different arguments counts encountered. | 1221 // call trampolines per different arguments counts encountered. |
| 1222 Result num_args = cgen()->allocator()->Allocate(rax); | 1222 Result num_args = cgen()->allocator()->Allocate(rax); |
| 1223 ASSERT(num_args.is_valid()); | 1223 ASSERT(num_args.is_valid()); |
| 1224 __ movq(num_args.reg(), Immediate(arg_count)); | 1224 __ Set(num_args.reg(), arg_count); |
| 1225 | 1225 |
| 1226 function.Unuse(); | 1226 function.Unuse(); |
| 1227 num_args.Unuse(); | 1227 num_args.Unuse(); |
| 1228 return RawCallCodeObject(ic, RelocInfo::CONSTRUCT_CALL); | 1228 return RawCallCodeObject(ic, RelocInfo::CONSTRUCT_CALL); |
| 1229 } | 1229 } |
| 1230 | 1230 |
| 1231 | 1231 |
| 1232 void VirtualFrame::PushTryHandler(HandlerType type) { | 1232 void VirtualFrame::PushTryHandler(HandlerType type) { |
| 1233 ASSERT(cgen()->HasValidEntryRegisters()); | 1233 ASSERT(cgen()->HasValidEntryRegisters()); |
| 1234 // Grow the expression stack by handler size less one (the return | 1234 // Grow the expression stack by handler size less one (the return |
| 1235 // address is already pushed by a call instruction). | 1235 // address is already pushed by a call instruction). |
| 1236 Adjust(kHandlerSize - 1); | 1236 Adjust(kHandlerSize - 1); |
| 1237 __ PushTryHandler(IN_JAVASCRIPT, type); | 1237 __ PushTryHandler(IN_JAVASCRIPT, type); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 | 1240 |
| 1241 #undef __ | 1241 #undef __ |
| 1242 | 1242 |
| 1243 } } // namespace v8::internal | 1243 } } // namespace v8::internal |
| 1244 | 1244 |
| 1245 #endif // V8_TARGET_ARCH_X64 | 1245 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |