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

Unified Diff: src/compiler/x64/linkage-x64.cc

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 years, 5 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
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | src/contexts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/linkage-x64.cc
diff --git a/src/compiler/x64/linkage-x64.cc b/src/compiler/x64/linkage-x64.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3a92bb16c7a1a8abef0faa1f714f5c3de259a65c
--- /dev/null
+++ b/src/compiler/x64/linkage-x64.cc
@@ -0,0 +1,77 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/v8.h"
+
+#include "src/assembler.h"
+#include "src/code-stubs.h"
+#include "src/compiler/linkage.h"
+#include "src/compiler/linkage-impl.h"
+#include "src/zone.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+struct LinkageHelperTraits {
+ static Register ReturnValueReg() { return rax; }
+ static Register ReturnValue2Reg() { return rdx; }
+ static Register JSCallFunctionReg() { return rdi; }
+ static Register ContextReg() { return rsi; }
+ static Register RuntimeCallFunctionReg() { return rbx; }
+ static Register RuntimeCallArgCountReg() { return rax; }
+#ifdef _WIN64
+ static RegList CCalleeSaveRegisters() {
+ return rbx.bit() | rdi.bit() | rsi.bit() | r12.bit() | r13.bit() |
+ r14.bit() | r15.bit();
+ }
+ static Register CRegisterParameter(int i) {
+ static Register register_parameters[] = {rcx, rdx, r8, r9};
+ return register_parameters[i];
+ }
+ static int CRegisterParametersLength() { return 4; }
+#else
+ static RegList CCalleeSaveRegisters() {
+ return rbx.bit() | r12.bit() | r13.bit() | r14.bit() | r15.bit();
+ }
+ static Register CRegisterParameter(int i) {
+ static Register register_parameters[] = {rdi, rsi, rdx, rcx, r8, r9};
+ return register_parameters[i];
+ }
+ static int CRegisterParametersLength() { return 6; }
+#endif
+};
+
+
+CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count, Zone* zone) {
+ return LinkageHelper::GetJSCallDescriptor<LinkageHelperTraits>(
+ zone, parameter_count);
+}
+
+
+CallDescriptor* Linkage::GetRuntimeCallDescriptor(
+ Runtime::FunctionId function, int parameter_count,
+ Operator::Property properties,
+ CallDescriptor::DeoptimizationSupport can_deoptimize, Zone* zone) {
+ return LinkageHelper::GetRuntimeCallDescriptor<LinkageHelperTraits>(
+ zone, function, parameter_count, properties, can_deoptimize);
+}
+
+
+CallDescriptor* Linkage::GetStubCallDescriptor(
+ CodeStubInterfaceDescriptor* descriptor, int stack_parameter_count) {
+ return LinkageHelper::GetStubCallDescriptor<LinkageHelperTraits>(
+ this->info_->zone(), descriptor, stack_parameter_count);
+}
+
+
+CallDescriptor* Linkage::GetSimplifiedCDescriptor(
+ Zone* zone, int num_params, MachineRepresentation return_type,
+ const MachineRepresentation* param_types) {
+ return LinkageHelper::GetSimplifiedCDescriptor<LinkageHelperTraits>(
+ zone, num_params, return_type, param_types);
+}
+}
+}
+} // namespace v8::internal::compiler
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698