InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject:
+ case CallDescriptor::kInterpreterDispatch:
opcode = kArchTailCallCodeObject;
break;
case CallDescriptor::kCallJSFunction:
return LH::GetSimplifiedCDescriptor(zone, sig);
}
+
+CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(
+ Zone* zone, const MachineSignature* sig) {
+ return LH::GetInterpreterDispatchDescriptor(zone, sig);
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject:
+ case CallDescriptor::kInterpreterDispatch:
opcode = kArchTailCallCodeObject;
break;
case CallDescriptor::kCallJSFunction:
return LH::GetSimplifiedCDescriptor(zone, sig);
}
+
+CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(
+ Zone* zone, const MachineSignature* sig) {
+ return LH::GetInterpreterDispatchDescriptor(zone, sig);
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
bool CodeGenerator::IsMaterializableFromRoot(
Handle<HeapObject> object, Heap::RootListIndex* index_return) {
- if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
+ const CallDescriptor* incoming_descriptor =
+ linkage()->GetIncomingDescriptor();
+ if (incoming_descriptor->IsJSFunctionCall() ||
+ incoming_descriptor->IsInterpreterDispatch()) {
RootIndexMap map(isolate());
int root_index = map.Lookup(*object);
if (root_index != RootIndexMap::kInvalidRootIndex) {
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject:
+ case CallDescriptor::kInterpreterDispatch:
opcode = kArchTailCallCodeObject;
break;
case CallDescriptor::kCallJSFunction:
return LH::GetSimplifiedCDescriptor(zone, sig);
}
+
+CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(
+ Zone* zone, const MachineSignature* sig) {
+ return LH::GetInterpreterDispatchDescriptor(zone, sig);
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
g.UseLocation(callee, buffer->descriptor->GetInputLocation(0),
buffer->descriptor->GetInputType(0)));
break;
+ case CallDescriptor::kInterpreterDispatch:
+ buffer->instruction_args.push_back(g.UseRegister(callee));
+ break;
}
DCHECK_EQ(1u, buffer->instruction_args.size());
"c-call");
}
+ static CallDescriptor* GetInterpreterDispatchDescriptor(
+ Zone* zone, const MachineSignature* msig) {
+ DCHECK_EQ(0, msig->parameter_count());
+ LocationSignature::Builder locations(zone, msig->return_count(),
+ msig->parameter_count());
+ AddReturnLocations(&locations);
+ LinkageLocation target_loc = LinkageLocation::AnyRegister();
+ return new (zone) CallDescriptor( // --
+ CallDescriptor::kInterpreterDispatch, // kind
+ kMachNone, // target MachineType
+ target_loc, // target location
+ msig, // machine_sig
+ locations.Build(), // location_sig
+ 0, // js_parameter_count
+ Operator::kNoProperties, // properties
+ kNoCalleeSaved, // callee-saved registers
+ kNoCalleeSaved, // callee-saved fp regs
+ CallDescriptor::kSupportsTailCalls, // flags
+ "interpreter-dispatch");
+ }
+
static LinkageLocation regloc(Register reg) {
return LinkageLocation(Register::ToAllocationIndex(reg));
}
case CallDescriptor::kCallAddress:
os << "Addr";
break;
+ case CallDescriptor::kInterpreterDispatch:
+ os << "InterpreterDispatch";
+ break;
}
return os;
}
public:
// Describes the kind of this call, which determines the target.
enum Kind {
- kCallCodeObject, // target is a Code object
- kCallJSFunction, // target is a JSFunction object
- kCallAddress // target is a machine pointer
+ kCallCodeObject, // target is a Code object
+ kCallJSFunction, // target is a JSFunction object
+ kCallAddress, // target is a machine pointer
+ kInterpreterDispatch // target is an interpreter bytecode handler
};
enum Flag {
// Returns {true} if this descriptor is a call to a JSFunction.
bool IsJSFunctionCall() const { return kind_ == kCallJSFunction; }
+ bool IsInterpreterDispatch() const { return kind_ == kInterpreterDispatch; }
+
// The number of return values from this call.
size_t ReturnCount() const { return machine_sig_->return_count(); }
static CallDescriptor* GetSimplifiedCDescriptor(Zone* zone,
const MachineSignature* sig);
+ // Creates a call descriptor for interpreter handler code stubs. These are not
+ // intended to be called directly but are instead dispatched to by the
+ // interpreter.
+ static CallDescriptor* GetInterpreterDispatchDescriptor(
+ Zone* zone, const MachineSignature* sig);
+
// Get the location of an (incoming) parameter to this function.
LinkageLocation GetParameterLocation(int index) const {
return incoming_->GetInputLocation(index + 1); // + 1 to skip target.
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject:
+ case CallDescriptor::kInterpreterDispatch:
opcode = kArchTailCallCodeObject;
break;
case CallDescriptor::kCallJSFunction:
return LH::GetSimplifiedCDescriptor(zone, sig);
}
+
+CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(
+ Zone* zone, const MachineSignature* sig) {
+ return LH::GetInterpreterDispatchDescriptor(zone, sig);
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject:
+ case CallDescriptor::kInterpreterDispatch:
opcode = kArchTailCallCodeObject;
break;
case CallDescriptor::kCallJSFunction:
return LH::GetSimplifiedCDescriptor(zone, sig);
}
+
+CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(
+ Zone* zone, const MachineSignature* sig) {
+ return LH::GetInterpreterDispatchDescriptor(zone, sig);
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
InstructionCode opcode;
switch (descriptor->kind()) {
case CallDescriptor::kCallCodeObject:
+ case CallDescriptor::kInterpreterDispatch:
opcode = kArchTailCallCodeObject;
break;
case CallDescriptor::kCallJSFunction:
return LH::GetSimplifiedCDescriptor(zone, sig);
}
+
+CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(
+ Zone* zone, const MachineSignature* sig) {
+ return LH::GetInterpreterDispatchDescriptor(zone, sig);
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8