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

Unified Diff: src/compiler/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/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 5421f4110f0645b2ffadd0b6f350910fc49b9f46..2b1e6d4fd0db85b6737fbfdd63d9f32beff6c772 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -7,6 +7,7 @@
#include "src/compiler/common-operator.h"
#include "src/compiler/linkage.h"
#include "src/compiler/node.h"
+#include "src/compiler/osr.h"
#include "src/compiler/pipeline.h"
#include "src/scopes.h"
@@ -14,7 +15,6 @@ namespace v8 {
namespace internal {
namespace compiler {
-
std::ostream& operator<<(std::ostream& os, const CallDescriptor::Kind& k) {
switch (k) {
case CallDescriptor::kCallCodeObject:
@@ -247,42 +247,26 @@ bool CallDescriptor::UsesOnlyRegisters() const {
}
-//==============================================================================
-// Provide unimplemented methods on unsupported architectures, to at least link.
-//==============================================================================
-#if !V8_TURBOFAN_BACKEND
-CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
- int parameter_count,
- CallDescriptor::Flags flags) {
- UNIMPLEMENTED();
- return NULL;
-}
-
-
LinkageLocation Linkage::GetOsrValueLocation(int index) const {
- UNIMPLEMENTED();
- return LinkageLocation(-1); // Dummy value
-}
-
+ CHECK(incoming_->IsJSFunctionCall());
+ int parameter_count = static_cast<int>(incoming_->JSParameterCount() - 1);
+ int first_stack_slot = OsrHelper::FirstStackSlotIndex(parameter_count);
-CallDescriptor* Linkage::GetRuntimeCallDescriptor(
- Zone* zone, Runtime::FunctionId function, int parameter_count,
- Operator::Properties properties) {
- UNIMPLEMENTED();
- return NULL;
-}
-
-
-CallDescriptor* Linkage::GetStubCallDescriptor(
- Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
- int stack_parameter_count, CallDescriptor::Flags flags,
- Operator::Properties properties, MachineType return_type) {
- UNIMPLEMENTED();
- return NULL;
+ if (index == kOsrContextSpillSlotIndex) {
+ // Context. Use the parameter location of the context spill slot.
+ // Parameter (arity + 1) is special for the context of the function frame.
+ int context_index = 1 + 1 + parameter_count; // target + receiver + params
+ return incoming_->GetInputLocation(context_index);
+ } else if (index >= first_stack_slot) {
+ // Local variable stored in this (callee) stack.
+ int spill_index = index - first_stack_slot;
+ return LinkageLocation::ForCalleeFrameSlot(spill_index);
+ } else {
+ // Parameter. Use the assigned location from the incoming call descriptor.
+ int parameter_index = 1 + index; // skip index 0, which is the target.
+ return incoming_->GetInputLocation(parameter_index);
+ }
}
-
-
-#endif // !V8_TURBOFAN_BACKEND
} // namespace compiler
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698