InterfaceDescriptor becomes CallInterfaceDescriptor.

There was no difference between these two classes in a hierarchical
relationship.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/532473002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23560 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ae2b08f4
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
const Register InterfaceDescriptor::ContextRegister() { return cp; } const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
void CallDescriptors::InitializeForIsolate(Isolate* isolate) { void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
......
...@@ -1082,7 +1082,7 @@ LInstruction* LChunkBuilder::DoCallJSFunction( ...@@ -1082,7 +1082,7 @@ LInstruction* LChunkBuilder::DoCallJSFunction(
LInstruction* LChunkBuilder::DoCallWithDescriptor( LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) { HCallWithDescriptor* instr) {
const InterfaceDescriptor* descriptor = instr->descriptor(); const CallInterfaceDescriptor* descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target()); LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> ops(instr->OperandCount(), zone()); ZoneList<LOperand*> ops(instr->OperandCount(), zone());
......
...@@ -1874,18 +1874,17 @@ class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> { ...@@ -1874,18 +1874,17 @@ class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
public: public:
LCallWithDescriptor(const InterfaceDescriptor* descriptor, LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
const ZoneList<LOperand*>& operands, const ZoneList<LOperand*>& operands, Zone* zone)
Zone* zone) : descriptor_(descriptor),
: descriptor_(descriptor), inputs_(descriptor->GetRegisterParameterCount() + 1, zone) {
inputs_(descriptor->GetRegisterParameterCount() + 1, zone) {
DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length());
inputs_.AddAll(operands, zone); inputs_.AddAll(operands, zone);
} }
LOperand* target() const { return inputs_[0]; } LOperand* target() const { return inputs_[0]; }
const InterfaceDescriptor* descriptor() { return descriptor_; } const CallInterfaceDescriptor* descriptor() { return descriptor_; }
private: private:
DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
...@@ -1895,7 +1894,7 @@ class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { ...@@ -1895,7 +1894,7 @@ class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
int arity() const { return hydrogen()->argument_count() - 1; } int arity() const { return hydrogen()->argument_count() - 1; }
const InterfaceDescriptor* descriptor_; const CallInterfaceDescriptor* descriptor_;
ZoneList<LOperand*> inputs_; ZoneList<LOperand*> inputs_;
// Iterator support. // Iterator support.
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
const Register InterfaceDescriptor::ContextRegister() { return cp; } const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
void CallDescriptors::InitializeForIsolate(Isolate* isolate) { void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
......
...@@ -1036,7 +1036,7 @@ LInstruction* LChunkBuilder::DoCallJSFunction( ...@@ -1036,7 +1036,7 @@ LInstruction* LChunkBuilder::DoCallJSFunction(
LInstruction* LChunkBuilder::DoCallWithDescriptor( LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) { HCallWithDescriptor* instr) {
const InterfaceDescriptor* descriptor = instr->descriptor(); const CallInterfaceDescriptor* descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target()); LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> ops(instr->OperandCount(), zone()); ZoneList<LOperand*> ops(instr->OperandCount(), zone());
......
...@@ -1523,18 +1523,17 @@ class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { ...@@ -1523,18 +1523,17 @@ class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> {
class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
public: public:
LCallWithDescriptor(const InterfaceDescriptor* descriptor, LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
const ZoneList<LOperand*>& operands, const ZoneList<LOperand*>& operands, Zone* zone)
Zone* zone) : descriptor_(descriptor),
: descriptor_(descriptor), inputs_(descriptor->GetRegisterParameterCount() + 1, zone) {
inputs_(descriptor->GetRegisterParameterCount() + 1, zone) {
DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length());
inputs_.AddAll(operands, zone); inputs_.AddAll(operands, zone);
} }
LOperand* target() const { return inputs_[0]; } LOperand* target() const { return inputs_[0]; }
const InterfaceDescriptor* descriptor() { return descriptor_; } const CallInterfaceDescriptor* descriptor() { return descriptor_; }
private: private:
DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
...@@ -1544,7 +1543,7 @@ class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { ...@@ -1544,7 +1543,7 @@ class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
int arity() const { return hydrogen()->argument_count() - 1; } int arity() const { return hydrogen()->argument_count() - 1; }
const InterfaceDescriptor* descriptor_; const CallInterfaceDescriptor* descriptor_;
ZoneList<LOperand*> inputs_; ZoneList<LOperand*> inputs_;
// Iterator support. // Iterator support.
......
...@@ -2318,11 +2318,10 @@ class HCallJSFunction V8_FINAL : public HCall<1> { ...@@ -2318,11 +2318,10 @@ class HCallJSFunction V8_FINAL : public HCall<1> {
class HCallWithDescriptor V8_FINAL : public HInstruction { class HCallWithDescriptor V8_FINAL : public HInstruction {
public: public:
static HCallWithDescriptor* New(Zone* zone, HValue* context, static HCallWithDescriptor* New(Zone* zone, HValue* context, HValue* target,
HValue* target, int argument_count,
int argument_count, const CallInterfaceDescriptor* descriptor,
const InterfaceDescriptor* descriptor, const Vector<HValue*>& operands) {
const Vector<HValue*>& operands) {
DCHECK(operands.length() == descriptor->GetEnvironmentLength()); DCHECK(operands.length() == descriptor->GetEnvironmentLength());
HCallWithDescriptor* res = HCallWithDescriptor* res =
new(zone) HCallWithDescriptor(target, argument_count, new(zone) HCallWithDescriptor(target, argument_count,
...@@ -2362,9 +2361,7 @@ class HCallWithDescriptor V8_FINAL : public HInstruction { ...@@ -2362,9 +2361,7 @@ class HCallWithDescriptor V8_FINAL : public HInstruction {
return -argument_count_; return -argument_count_;
} }
const InterfaceDescriptor* descriptor() const { const CallInterfaceDescriptor* descriptor() const { return descriptor_; }
return descriptor_;
}
HValue* target() { HValue* target() {
return OperandAt(0); return OperandAt(0);
...@@ -2374,13 +2371,11 @@ class HCallWithDescriptor V8_FINAL : public HInstruction { ...@@ -2374,13 +2371,11 @@ class HCallWithDescriptor V8_FINAL : public HInstruction {
private: private:
// The argument count includes the receiver. // The argument count includes the receiver.
HCallWithDescriptor(HValue* target, HCallWithDescriptor(HValue* target, int argument_count,
int argument_count, const CallInterfaceDescriptor* descriptor,
const InterfaceDescriptor* descriptor, const Vector<HValue*>& operands, Zone* zone)
const Vector<HValue*>& operands, : descriptor_(descriptor),
Zone* zone) values_(descriptor->GetEnvironmentLength() + 1, zone) {
: descriptor_(descriptor),
values_(descriptor->GetEnvironmentLength() + 1, zone) {
argument_count_ = argument_count; argument_count_ = argument_count;
AddOperand(target, zone); AddOperand(target, zone);
for (int i = 0; i < operands.length(); i++) { for (int i = 0; i < operands.length(); i++) {
...@@ -2400,7 +2395,7 @@ class HCallWithDescriptor V8_FINAL : public HInstruction { ...@@ -2400,7 +2395,7 @@ class HCallWithDescriptor V8_FINAL : public HInstruction {
values_[index] = value; values_[index] = value;
} }
const InterfaceDescriptor* descriptor_; const CallInterfaceDescriptor* descriptor_;
ZoneList<HValue*> values_; ZoneList<HValue*> values_;
int argument_count_; int argument_count_;
}; };
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
const Register InterfaceDescriptor::ContextRegister() { return esi; } const Register CallInterfaceDescriptor::ContextRegister() { return esi; }
void CallDescriptors::InitializeForIsolate(Isolate* isolate) { void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
......
...@@ -1123,7 +1123,7 @@ LInstruction* LChunkBuilder::DoCallJSFunction( ...@@ -1123,7 +1123,7 @@ LInstruction* LChunkBuilder::DoCallJSFunction(
LInstruction* LChunkBuilder::DoCallWithDescriptor( LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) { HCallWithDescriptor* instr) {
const InterfaceDescriptor* descriptor = instr->descriptor(); const CallInterfaceDescriptor* descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target()); LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> ops(instr->OperandCount(), zone()); ZoneList<LOperand*> ops(instr->OperandCount(), zone());
ops.Add(target, zone()); ops.Add(target, zone());
......
...@@ -1891,10 +1891,9 @@ class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> { ...@@ -1891,10 +1891,9 @@ class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
public: public:
LCallWithDescriptor(const InterfaceDescriptor* descriptor, LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
const ZoneList<LOperand*>& operands, const ZoneList<LOperand*>& operands, Zone* zone)
Zone* zone) : inputs_(descriptor->GetRegisterParameterCount() + 1, zone) {
: inputs_(descriptor->GetRegisterParameterCount() + 1, zone) {
DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length());
inputs_.AddAll(operands, zone); inputs_.AddAll(operands, zone);
} }
......
...@@ -10,10 +10,7 @@ ...@@ -10,10 +10,7 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
InterfaceDescriptor::InterfaceDescriptor() : register_param_count_(-1) {} void CallInterfaceDescriptor::Initialize(
void InterfaceDescriptor::Initialize(
int register_parameter_count, Register* registers, int register_parameter_count, Register* registers,
Representation* register_param_representations, Representation* register_param_representations,
PlatformInterfaceDescriptor* platform_descriptor) { PlatformInterfaceDescriptor* platform_descriptor) {
...@@ -45,20 +42,11 @@ void InterfaceDescriptor::Initialize( ...@@ -45,20 +42,11 @@ void InterfaceDescriptor::Initialize(
} }
void CallInterfaceDescriptor::Initialize(
int register_parameter_count, Register* registers,
Representation* param_representations,
PlatformInterfaceDescriptor* platform_descriptor) {
InterfaceDescriptor::Initialize(register_parameter_count, registers,
param_representations, platform_descriptor);
}
void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) { void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) {
{ {
CallInterfaceDescriptor* descriptor = CallInterfaceDescriptor* descriptor =
isolate->call_descriptor(CallDescriptorKey::LoadICCall); isolate->call_descriptor(CallDescriptorKey::LoadICCall);
Register registers[] = {InterfaceDescriptor::ContextRegister(), Register registers[] = {CallInterfaceDescriptor::ContextRegister(),
LoadConvention::ReceiverRegister(), LoadConvention::ReceiverRegister(),
LoadConvention::NameRegister()}; LoadConvention::NameRegister()};
descriptor->Initialize(arraysize(registers), registers, NULL); descriptor->Initialize(arraysize(registers), registers, NULL);
...@@ -66,7 +54,7 @@ void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) { ...@@ -66,7 +54,7 @@ void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) {
{ {
CallInterfaceDescriptor* descriptor = CallInterfaceDescriptor* descriptor =
isolate->call_descriptor(CallDescriptorKey::StoreICCall); isolate->call_descriptor(CallDescriptorKey::StoreICCall);
Register registers[] = {InterfaceDescriptor::ContextRegister(), Register registers[] = {CallInterfaceDescriptor::ContextRegister(),
StoreConvention::ReceiverRegister(), StoreConvention::ReceiverRegister(),
StoreConvention::NameRegister(), StoreConvention::NameRegister(),
StoreConvention::ValueRegister()}; StoreConvention::ValueRegister()};
...@@ -76,7 +64,7 @@ void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) { ...@@ -76,7 +64,7 @@ void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) {
CallInterfaceDescriptor* descriptor = isolate->call_descriptor( CallInterfaceDescriptor* descriptor = isolate->call_descriptor(
CallDescriptorKey::ElementTransitionAndStoreCall); CallDescriptorKey::ElementTransitionAndStoreCall);
Register registers[] = { Register registers[] = {
InterfaceDescriptor::ContextRegister(), CallInterfaceDescriptor::ContextRegister(),
StoreConvention::ValueRegister(), StoreConvention::MapRegister(), StoreConvention::ValueRegister(), StoreConvention::MapRegister(),
StoreConvention::NameRegister(), StoreConvention::ReceiverRegister()}; StoreConvention::NameRegister(), StoreConvention::ReceiverRegister()};
descriptor->Initialize(arraysize(registers), registers, NULL); descriptor->Initialize(arraysize(registers), registers, NULL);
...@@ -84,7 +72,7 @@ void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) { ...@@ -84,7 +72,7 @@ void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) {
{ {
CallInterfaceDescriptor* descriptor = CallInterfaceDescriptor* descriptor =
isolate->call_descriptor(CallDescriptorKey::InstanceofCall); isolate->call_descriptor(CallDescriptorKey::InstanceofCall);
Register registers[] = {InterfaceDescriptor::ContextRegister(), Register registers[] = {CallInterfaceDescriptor::ContextRegister(),
InstanceofConvention::left(), InstanceofConvention::left(),
InstanceofConvention::right()}; InstanceofConvention::right()};
descriptor->Initialize(arraysize(registers), registers, NULL); descriptor->Initialize(arraysize(registers), registers, NULL);
...@@ -92,7 +80,7 @@ void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) { ...@@ -92,7 +80,7 @@ void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) {
{ {
CallInterfaceDescriptor* descriptor = CallInterfaceDescriptor* descriptor =
isolate->call_descriptor(CallDescriptorKey::VectorLoadICCall); isolate->call_descriptor(CallDescriptorKey::VectorLoadICCall);
Register registers[] = {InterfaceDescriptor::ContextRegister(), Register registers[] = {CallInterfaceDescriptor::ContextRegister(),
FullVectorLoadConvention::ReceiverRegister(), FullVectorLoadConvention::ReceiverRegister(),
FullVectorLoadConvention::NameRegister(), FullVectorLoadConvention::NameRegister(),
FullVectorLoadConvention::SlotRegister(), FullVectorLoadConvention::SlotRegister(),
......
...@@ -13,8 +13,21 @@ namespace internal { ...@@ -13,8 +13,21 @@ namespace internal {
class PlatformInterfaceDescriptor; class PlatformInterfaceDescriptor;
class InterfaceDescriptor { class CallInterfaceDescriptor {
public: public:
CallInterfaceDescriptor() : register_param_count_(-1) {}
// A copy of the passed in registers and param_representations is made
// and owned by the CallInterfaceDescriptor.
// TODO(mvstanton): Instead of taking parallel arrays register and
// param_representations, how about a struct that puts the representation
// and register side by side (eg, RegRep(r1, Representation::Tagged()).
// The same should go for the CodeStubInterfaceDescriptor class.
void Initialize(int register_parameter_count, Register* registers,
Representation* param_representations,
PlatformInterfaceDescriptor* platform_descriptor = NULL);
bool IsInitialized() const { return register_param_count_ >= 0; } bool IsInitialized() const { return register_param_count_ >= 0; }
int GetEnvironmentLength() const { return register_param_count_; } int GetEnvironmentLength() const { return register_param_count_; }
...@@ -55,14 +68,6 @@ class InterfaceDescriptor { ...@@ -55,14 +68,6 @@ class InterfaceDescriptor {
static const Register ContextRegister(); static const Register ContextRegister();
protected:
InterfaceDescriptor();
virtual ~InterfaceDescriptor() {}
void Initialize(int register_parameter_count, Register* registers,
Representation* register_param_representations,
PlatformInterfaceDescriptor* platform_descriptor = NULL);
private: private:
int register_param_count_; int register_param_count_;
...@@ -79,7 +84,7 @@ class InterfaceDescriptor { ...@@ -79,7 +84,7 @@ class InterfaceDescriptor {
PlatformInterfaceDescriptor* platform_specific_descriptor_; PlatformInterfaceDescriptor* platform_specific_descriptor_;
DISALLOW_COPY_AND_ASSIGN(InterfaceDescriptor); DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptor);
}; };
...@@ -118,23 +123,6 @@ enum CallDescriptorKey { ...@@ -118,23 +123,6 @@ enum CallDescriptorKey {
}; };
class CallInterfaceDescriptor : public InterfaceDescriptor {
public:
CallInterfaceDescriptor() {}
// A copy of the passed in registers and param_representations is made
// and owned by the CallInterfaceDescriptor.
// TODO(mvstanton): Instead of taking parallel arrays register and
// param_representations, how about a struct that puts the representation
// and register side by side (eg, RegRep(r1, Representation::Tagged()).
// The same should go for the CodeStubInterfaceDescriptor class.
void Initialize(int register_parameter_count, Register* registers,
Representation* param_representations,
PlatformInterfaceDescriptor* platform_descriptor = NULL);
};
class CallDescriptors { class CallDescriptors {
public: public:
static void InitializeForIsolate(Isolate* isolate); static void InitializeForIsolate(Isolate* isolate);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
const Register InterfaceDescriptor::ContextRegister() { return rsi; } const Register CallInterfaceDescriptor::ContextRegister() { return rsi; }
void CallDescriptors::InitializeForIsolate(Isolate* isolate) { void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
......
...@@ -1102,7 +1102,7 @@ LInstruction* LChunkBuilder::DoCallJSFunction( ...@@ -1102,7 +1102,7 @@ LInstruction* LChunkBuilder::DoCallJSFunction(
LInstruction* LChunkBuilder::DoCallWithDescriptor( LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) { HCallWithDescriptor* instr) {
const InterfaceDescriptor* descriptor = instr->descriptor(); const CallInterfaceDescriptor* descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target()); LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> ops(instr->OperandCount(), zone()); ZoneList<LOperand*> ops(instr->OperandCount(), zone());
......
...@@ -1877,10 +1877,9 @@ class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> { ...@@ -1877,10 +1877,9 @@ class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> {
class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> {
public: public:
LCallWithDescriptor(const InterfaceDescriptor* descriptor, LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
const ZoneList<LOperand*>& operands, const ZoneList<LOperand*>& operands, Zone* zone)
Zone* zone) : inputs_(descriptor->GetRegisterParameterCount() + 1, zone) {
: inputs_(descriptor->GetRegisterParameterCount() + 1, zone) {
DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length());
inputs_.AddAll(operands, zone); inputs_.AddAll(operands, zone);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment