| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 // All parameters are on the stack. r0 has the return value after call. | 1028 // All parameters are on the stack. r0 has the return value after call. |
| 1029 | 1029 |
| 1030 // If the expected number of arguments of the runtime function is | 1030 // If the expected number of arguments of the runtime function is |
| 1031 // constant, we check that the actual number of arguments match the | 1031 // constant, we check that the actual number of arguments match the |
| 1032 // expectation. | 1032 // expectation. |
| 1033 if (f->nargs >= 0 && f->nargs != num_arguments) { | 1033 if (f->nargs >= 0 && f->nargs != num_arguments) { |
| 1034 IllegalOperation(num_arguments); | 1034 IllegalOperation(num_arguments); |
| 1035 return; | 1035 return; |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 Runtime::FunctionId function_id = | 1038 // TODO(1236192): Most runtime routines don't need the number of |
| 1039 static_cast<Runtime::FunctionId>(f->stub_id); | 1039 // arguments passed in because it is constant. At some point we |
| 1040 RuntimeStub stub(function_id, num_arguments); | 1040 // should remove this need and make the runtime routine entry code |
| 1041 // smarter. |
| 1042 mov(r0, Operand(num_arguments)); |
| 1043 mov(r1, Operand(ExternalReference(f))); |
| 1044 CEntryStub stub(1); |
| 1041 CallStub(&stub); | 1045 CallStub(&stub); |
| 1042 } | 1046 } |
| 1043 | 1047 |
| 1044 | 1048 |
| 1045 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { | 1049 void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) { |
| 1046 CallRuntime(Runtime::FunctionForId(fid), num_arguments); | 1050 CallRuntime(Runtime::FunctionForId(fid), num_arguments); |
| 1047 } | 1051 } |
| 1048 | 1052 |
| 1049 | 1053 |
| 1050 void MacroAssembler::TailCallRuntime(const ExternalReference& ext, | 1054 void MacroAssembler::TailCallRuntime(const ExternalReference& ext, |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 } | 1294 } |
| 1291 | 1295 |
| 1292 | 1296 |
| 1293 void CodePatcher::Emit(Address addr) { | 1297 void CodePatcher::Emit(Address addr) { |
| 1294 masm()->emit(reinterpret_cast<Instr>(addr)); | 1298 masm()->emit(reinterpret_cast<Instr>(addr)); |
| 1295 } | 1299 } |
| 1296 #endif // ENABLE_DEBUGGER_SUPPORT | 1300 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1297 | 1301 |
| 1298 | 1302 |
| 1299 } } // namespace v8::internal | 1303 } } // namespace v8::internal |
| OLD | NEW |