Index: src/compiler/linkage.cc |
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc |
index 4239f9fef92493dfe70a121311973b05bfa94206..481b44353b6f97ea191ef2b31dc555897faaa4ae 100644 |
--- a/src/compiler/linkage.cc |
+++ b/src/compiler/linkage.cc |
@@ -39,28 +39,30 @@ std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) { |
} |
-Linkage::Linkage(CompilationInfo* info) : info_(info) { |
+CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { |
if (info->function() != NULL) { |
// If we already have the function literal, use the number of parameters |
// plus the receiver. |
- incoming_ = GetJSCallDescriptor(1 + info->function()->parameter_count()); |
- } else if (!info->closure().is_null()) { |
+ return GetJSCallDescriptor(1 + info->function()->parameter_count(), zone); |
+ } |
+ if (!info->closure().is_null()) { |
// If we are compiling a JS function, use a JS call descriptor, |
// plus the receiver. |
SharedFunctionInfo* shared = info->closure()->shared(); |
- incoming_ = GetJSCallDescriptor(1 + shared->formal_parameter_count()); |
- } else if (info->code_stub() != NULL) { |
+ return GetJSCallDescriptor(1 + shared->formal_parameter_count(), zone); |
+ } |
+ if (info->code_stub() != NULL) { |
// Use the code stub interface descriptor. |
CallInterfaceDescriptor descriptor = |
info->code_stub()->GetCallInterfaceDescriptor(); |
- incoming_ = GetStubCallDescriptor(descriptor); |
- } else { |
- incoming_ = NULL; // TODO(titzer): ? |
+ return GetStubCallDescriptor(descriptor, 0, CallDescriptor::kNoFlags, zone); |
} |
+ return NULL; // TODO(titzer): ? |
} |
-FrameOffset Linkage::GetFrameOffset(int spill_slot, Frame* frame, int extra) { |
+FrameOffset Linkage::GetFrameOffset(int spill_slot, Frame* frame, |
+ int extra) const { |
if (frame->GetSpillSlotCount() > 0 || incoming_->IsJSFunctionCall() || |
incoming_->kind() == CallDescriptor::kCallAddress) { |
int offset; |
@@ -87,24 +89,22 @@ FrameOffset Linkage::GetFrameOffset(int spill_slot, Frame* frame, int extra) { |
} |
-CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count) { |
- return GetJSCallDescriptor(parameter_count, this->info_->zone()); |
+CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count) const { |
+ return GetJSCallDescriptor(parameter_count, zone_); |
} |
CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
Runtime::FunctionId function, int parameter_count, |
- Operator::Properties properties) { |
- return GetRuntimeCallDescriptor(function, parameter_count, properties, |
- this->info_->zone()); |
+ Operator::Properties properties) const { |
+ return GetRuntimeCallDescriptor(function, parameter_count, properties, zone_); |
} |
CallDescriptor* Linkage::GetStubCallDescriptor( |
CallInterfaceDescriptor descriptor, int stack_parameter_count, |
- CallDescriptor::Flags flags) { |
- return GetStubCallDescriptor(descriptor, stack_parameter_count, flags, |
- this->info_->zone()); |
+ CallDescriptor::Flags flags) const { |
+ return GetStubCallDescriptor(descriptor, stack_parameter_count, flags, zone_); |
} |