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

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

Issue 1272883003: [turbofan] Remove architecture-specific linkage files and LinkageTraits. Use macro-assembler-define… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/compiler/js-linkage.cc
diff --git a/src/compiler/js-linkage.cc b/src/compiler/js-linkage.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7dbc48e52186cacbd337626e1104b07a4fc8ea00
--- /dev/null
+++ b/src/compiler/js-linkage.cc
@@ -0,0 +1,60 @@
+// Copyright 2015 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/assembler.h"
+#include "src/macro-assembler.h"
+
+#include "src/compiler/linkage.h"
+#include "src/compiler/linkage-impl.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
+ int js_parameter_count,
+ CallDescriptor::Flags flags) {
+ const size_t return_count = 1;
+ const size_t context_count = 1;
+ const size_t parameter_count = js_parameter_count + context_count;
+
+ LocationSignature::Builder locations(zone, return_count, parameter_count);
+ MachineSignature::Builder types(zone, return_count, parameter_count);
+
+ // All JS calls have exactly one return value.
+ locations.AddReturn(regloc(kReturnRegister0));
+ types.AddReturn(kMachAnyTagged);
+
+ // All parameters to JS calls go on the stack.
+ for (int i = 0; i < js_parameter_count; i++) {
+ int spill_slot_index = i - js_parameter_count;
+ locations.AddParam(stackloc(spill_slot_index));
+ types.AddParam(kMachAnyTagged);
+ }
+ // Add context.
+ locations.AddParam(regloc(kContextRegister));
+ types.AddParam(kMachAnyTagged);
+
+ // The target for JS function calls is the JSFunction object.
+ MachineType target_type = kMachAnyTagged;
+ // TODO(titzer): When entering into an OSR function from unoptimized code,
+ // the JSFunction is not in a register, but it is on the stack in an
+ // unaddressable spill slot. We hack this in the OSR prologue. Fix.
+ LinkageLocation target_loc = regloc(kJSFunctionRegister);
+ return new (zone) CallDescriptor( // --
+ CallDescriptor::kCallJSFunction, // kind
+ target_type, // target MachineType
+ target_loc, // target location
+ types.Build(), // machine_sig
+ locations.Build(), // location_sig
+ js_parameter_count, // stack_parameter_count
+ Operator::kNoProperties, // properties
+ kNoCalleeSaved, // callee-saved
+ kNoCalleeSaved, // callee-saved fp
+ flags, // flags
+ "js-call");
+}
+}
Michael Starzinger 2015/08/07 07:59:03 nit: } // namespace compiler } // namespace int
+}
+}

Powered by Google App Engine
This is Rietveld 408576698