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

Side by Side Diff: src/x64/macro-assembler-x64.h

Issue 1553703002: [runtime] TailCallRuntime and CallRuntime should use default argument counts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-12-29_TailCallRuntime_default_result_size_1_1550923002
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ 5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_
6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ 6 #define V8_X64_MACRO_ASSEMBLER_X64_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/flags.h" 10 #include "src/base/flags.h"
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 1397
1398 // Return from a code stub after popping its arguments. 1398 // Return from a code stub after popping its arguments.
1399 void StubReturn(int argc); 1399 void StubReturn(int argc);
1400 1400
1401 // Call a runtime routine. 1401 // Call a runtime routine.
1402 void CallRuntime(const Runtime::Function* f, 1402 void CallRuntime(const Runtime::Function* f,
1403 int num_arguments, 1403 int num_arguments,
1404 SaveFPRegsMode save_doubles = kDontSaveFPRegs); 1404 SaveFPRegsMode save_doubles = kDontSaveFPRegs);
1405 1405
1406 // Call a runtime function and save the value of XMM registers. 1406 // Call a runtime function and save the value of XMM registers.
1407 void CallRuntimeSaveDoubles(Runtime::FunctionId id) { 1407 void CallRuntimeSaveDoubles(Runtime::FunctionId fid) {
1408 const Runtime::Function* function = Runtime::FunctionForId(id); 1408 const Runtime::Function* function = Runtime::FunctionForId(fid);
1409 CallRuntime(function, function->nargs, kSaveFPRegs); 1409 CallRuntime(function, function->nargs, kSaveFPRegs);
1410 } 1410 }
1411 1411
1412 // Convenience function: Same as above, but takes the fid instead. 1412 // Convenience function: Same as above, but takes the fid instead.
1413 void CallRuntime(Runtime::FunctionId id, 1413 void CallRuntime(Runtime::FunctionId fid,
1414 int num_arguments,
1415 SaveFPRegsMode save_doubles = kDontSaveFPRegs) { 1414 SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
1416 CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles); 1415 const Runtime::Function* function = Runtime::FunctionForId(fid);
1416 CallRuntime(function, function->nargs, save_doubles);
1417 }
1418
1419 // Convenience function: Same as above, but takes the fid instead.
1420 void CallRuntime(Runtime::FunctionId fid, int num_arguments,
1421 SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
1422 CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
1417 } 1423 }
1418 1424
1419 // Convenience function: call an external reference. 1425 // Convenience function: call an external reference.
1420 void CallExternalReference(const ExternalReference& ext, 1426 void CallExternalReference(const ExternalReference& ext,
1421 int num_arguments); 1427 int num_arguments);
1422 1428
1423 // Tail call of a runtime routine (jump). 1429 // Convenience function: tail call a runtime routine (jump)
1424 // Like JumpToExternalReference, but also takes care of passing the number 1430 void TailCallRuntime(Runtime::FunctionId fid);
1425 // of parameters.
1426 void TailCallExternalReference(const ExternalReference& ext,
1427 int num_arguments);
1428 1431
1429 // Convenience function: tail call a runtime routine (jump). 1432 // Jump to a runtime routines
1430 void TailCallRuntime(Runtime::FunctionId fid, int num_arguments);
1431
1432 // Jump to a runtime routine.
1433 void JumpToExternalReference(const ExternalReference& ext); 1433 void JumpToExternalReference(const ExternalReference& ext);
1434 1434
1435 // Before calling a C-function from generated code, align arguments on stack. 1435 // Before calling a C-function from generated code, align arguments on stack.
1436 // After aligning the frame, arguments must be stored in rsp[0], rsp[8], 1436 // After aligning the frame, arguments must be stored in rsp[0], rsp[8],
1437 // etc., not pushed. The argument count assumes all arguments are word sized. 1437 // etc., not pushed. The argument count assumes all arguments are word sized.
1438 // The number of slots reserved for arguments depends on platform. On Windows 1438 // The number of slots reserved for arguments depends on platform. On Windows
1439 // stack slots are reserved for the arguments passed in registers. On other 1439 // stack slots are reserved for the arguments passed in registers. On other
1440 // platforms stack slots are only reserved for the arguments actually passed 1440 // platforms stack slots are only reserved for the arguments actually passed
1441 // on the stack. 1441 // on the stack.
1442 void PrepareCallCFunction(int num_arguments); 1442 void PrepareCallCFunction(int num_arguments);
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 } \ 1736 } \
1737 masm-> 1737 masm->
1738 #else 1738 #else
1739 #define ACCESS_MASM(masm) masm-> 1739 #define ACCESS_MASM(masm) masm->
1740 #endif 1740 #endif
1741 1741
1742 } // namespace internal 1742 } // namespace internal
1743 } // namespace v8 1743 } // namespace v8
1744 1744
1745 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ 1745 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698