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

Unified Diff: src/x64/macro-assembler-x64.h

Issue 598072: Direct call C++ functions (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 side-by-side diff with in-line comments
Download patch
Index: src/x64/macro-assembler-x64.h
===================================================================
--- src/x64/macro-assembler-x64.h (revision 3911)
+++ src/x64/macro-assembler-x64.h (working copy)
@@ -38,6 +38,21 @@
// function calling convention.
static const Register kScratchRegister = r10;
+// Registers for passing arguments into a C function.
+#ifdef _WIN64
+static const int kCArgRegsCount = 4;
+static const RegList kCCallerSaved =
+ rax.bit() | rcx.bit() | rdx.bit() | r8.bit() |
+ r9.bit() | r10.bit() | r11.bit();
+#else
+static const int kCArgRegsCount = 6;
+static const RegList kCCallerSaved =
+ rax.bit() | rcx.bit() | rdx.bit() | rsi.bit() | rdi.bit() | r8.bit() |
+ r9.bit() | r10.bit() | r11.bit();
+#endif
+extern const Register kCArgRegs[kCArgRegsCount];
+
+
// Convenience for platform-independent signatures.
typedef Operand MemOperand;
@@ -655,13 +670,18 @@
void CallExternalReference(const ExternalReference& ext,
int num_arguments);
- // Tail call of a runtime routine (jump).
- // Like JumpToRuntime, but also takes care of passing the number
+ // Tail call of a runtime routine (jump or equivalent if jump is not
+ // possible). Like JumpToRuntime, but also takes care of passing the number
// of arguments.
- void TailCallRuntime(const ExternalReference& ext,
+ void TailCallRuntime(Runtime::FunctionId id,
int num_arguments,
int result_size);
+ void TailCallExternalReference(const ExternalReference& ext,
+ int num_arguments,
+ int result_size);
+
+
// Jump to a runtime routine.
void JumpToRuntime(const ExternalReference& ext, int result_size);
« src/runtime.h ('K') | « src/x64/ic-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698