Remove HCallGlobal and merge uses with HCallNamed.
R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/134333007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18595 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
53f46c5214
commit
72125bafcc
@ -313,12 +313,6 @@ void LCallNamed::PrintDataTo(StringStream* stream) {
|
||||
}
|
||||
|
||||
|
||||
void LCallGlobal::PrintDataTo(StringStream* stream) {
|
||||
SmartArrayPointer<char> name_string = name()->ToCString();
|
||||
stream->Add("%s #%d / ", name_string.get(), arity());
|
||||
}
|
||||
|
||||
|
||||
void LCallKnownGlobal::PrintDataTo(StringStream* stream) {
|
||||
stream->Add("#%d / ", arity());
|
||||
}
|
||||
@ -1188,12 +1182,6 @@ LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
|
||||
}
|
||||
|
||||
|
||||
LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
|
||||
LOperand* context = UseFixed(instr->context(), cp);
|
||||
return MarkAsCall(DefineFixed(new(zone()) LCallGlobal(context), r0), instr);
|
||||
}
|
||||
|
||||
|
||||
LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
|
||||
return MarkAsCall(DefineFixed(new(zone()) LCallKnownGlobal, r0), instr);
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ class LCodeGen;
|
||||
V(Branch) \
|
||||
V(CallConstantFunction) \
|
||||
V(CallFunction) \
|
||||
V(CallGlobal) \
|
||||
V(CallKeyed) \
|
||||
V(CallKnownGlobal) \
|
||||
V(CallNamed) \
|
||||
@ -1920,24 +1919,6 @@ class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
|
||||
};
|
||||
|
||||
|
||||
class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LCallGlobal(LOperand* context) {
|
||||
inputs_[0] = context;
|
||||
}
|
||||
|
||||
LOperand* context() { return inputs_[0]; }
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
|
||||
DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
|
||||
|
||||
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
|
||||
|
||||
Handle<String> name() const {return hydrogen()->name(); }
|
||||
int arity() const { return hydrogen()->argument_count() - 1; }
|
||||
};
|
||||
|
||||
|
||||
class LCallKnownGlobal V8_FINAL : public LTemplateInstruction<1, 0, 0> {
|
||||
public:
|
||||
DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
|
||||
|
@ -4008,17 +4008,6 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
|
||||
}
|
||||
|
||||
|
||||
void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
|
||||
ASSERT(ToRegister(instr->context()).is(cp));
|
||||
ASSERT(ToRegister(instr->result()).is(r0));
|
||||
|
||||
int arity = instr->arity();
|
||||
Handle<Code> ic = isolate()->stub_cache()->ComputeCallInitialize(arity);
|
||||
__ mov(r2, Operand(instr->name()));
|
||||
CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
|
||||
}
|
||||
|
||||
|
||||
void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
|
||||
ASSERT(ToRegister(instr->result()).is(r0));
|
||||
CallKnownFunction(instr->hydrogen()->target(),
|
||||
|
@ -981,12 +981,6 @@ void HCallNamed::PrintDataTo(StringStream* stream) {
|
||||
}
|
||||
|
||||
|
||||
void HCallGlobal::PrintDataTo(StringStream* stream) {
|
||||
stream->Add("%o ", *name());
|
||||
HUnaryCall::PrintDataTo(stream);
|
||||
}
|
||||
|
||||
|
||||
void HCallKnownGlobal::PrintDataTo(StringStream* stream) {
|
||||
stream->Add("%o ", target()->shared()->DebugName());
|
||||
stream->Add("#%d", argument_count());
|
||||
|
@ -79,7 +79,6 @@ class LChunkBuilder;
|
||||
V(Branch) \
|
||||
V(CallConstantFunction) \
|
||||
V(CallFunction) \
|
||||
V(CallGlobal) \
|
||||
V(CallKeyed) \
|
||||
V(CallKnownGlobal) \
|
||||
V(CallNamed) \
|
||||
@ -2442,26 +2441,6 @@ class HCallFunction V8_FINAL : public HBinaryCall {
|
||||
};
|
||||
|
||||
|
||||
class HCallGlobal V8_FINAL : public HUnaryCall {
|
||||
public:
|
||||
DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallGlobal, Handle<String>, int);
|
||||
|
||||
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
|
||||
|
||||
HValue* context() { return value(); }
|
||||
Handle<String> name() const { return name_; }
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(CallGlobal)
|
||||
|
||||
private:
|
||||
HCallGlobal(HValue* context, Handle<String> name, int argument_count)
|
||||
: HUnaryCall(context, argument_count), name_(name) {
|
||||
}
|
||||
|
||||
Handle<String> name_;
|
||||
};
|
||||
|
||||
|
||||
class HCallKnownGlobal V8_FINAL : public HCall<0> {
|
||||
public:
|
||||
DECLARE_INSTRUCTION_FACTORY_P2(HCallKnownGlobal, Handle<JSFunction>, int);
|
||||
|
@ -7857,7 +7857,7 @@ void HOptimizedGraphBuilder::VisitCall(Call* expr) {
|
||||
environment()->SetExpressionStackAt(receiver_index, global_object);
|
||||
// When the target has a custom call IC generator, use the IC,
|
||||
// because it is likely to generate better code.
|
||||
call = PreProcessCall(New<HCallGlobal>(var->name(), argument_count));
|
||||
call = PreProcessCall(New<HCallNamed>(var->name(), argument_count));
|
||||
} else {
|
||||
call = PreProcessCall(New<HCallKnownGlobal>(
|
||||
expr->target(), argument_count));
|
||||
@ -7867,7 +7867,7 @@ void HOptimizedGraphBuilder::VisitCall(Call* expr) {
|
||||
Push(Add<HPushArgument>(receiver));
|
||||
CHECK_ALIVE(VisitArgumentList(expr->arguments()));
|
||||
|
||||
call = New<HCallGlobal>(var->name(), argument_count);
|
||||
call = New<HCallNamed>(var->name(), argument_count);
|
||||
Drop(argument_count);
|
||||
}
|
||||
|
||||
|
@ -4251,17 +4251,6 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
|
||||
}
|
||||
|
||||
|
||||
void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
|
||||
ASSERT(ToRegister(instr->context()).is(esi));
|
||||
ASSERT(ToRegister(instr->result()).is(eax));
|
||||
|
||||
int arity = instr->arity();
|
||||
Handle<Code> ic = isolate()->stub_cache()->ComputeCallInitialize(arity);
|
||||
__ mov(ecx, instr->name());
|
||||
CallCode(ic, RelocInfo::CODE_TARGET, instr);
|
||||
}
|
||||
|
||||
|
||||
void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
|
||||
ASSERT(ToRegister(instr->result()).is(eax));
|
||||
CallKnownFunction(instr->hydrogen()->target(),
|
||||
|
@ -345,12 +345,6 @@ void LCallNamed::PrintDataTo(StringStream* stream) {
|
||||
}
|
||||
|
||||
|
||||
void LCallGlobal::PrintDataTo(StringStream* stream) {
|
||||
SmartArrayPointer<char> name_string = name()->ToCString();
|
||||
stream->Add("%s #%d / ", name_string.get(), arity());
|
||||
}
|
||||
|
||||
|
||||
void LCallKnownGlobal::PrintDataTo(StringStream* stream) {
|
||||
stream->Add("#%d / ", arity());
|
||||
}
|
||||
@ -1271,13 +1265,6 @@ LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
|
||||
}
|
||||
|
||||
|
||||
LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
|
||||
LOperand* context = UseFixed(instr->context(), esi);
|
||||
LCallGlobal* result = new(zone()) LCallGlobal(context);
|
||||
return MarkAsCall(DefineFixed(result, eax), instr);
|
||||
}
|
||||
|
||||
|
||||
LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
|
||||
return MarkAsCall(DefineFixed(new(zone()) LCallKnownGlobal, eax), instr);
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ class LCodeGen;
|
||||
V(Branch) \
|
||||
V(CallConstantFunction) \
|
||||
V(CallFunction) \
|
||||
V(CallGlobal) \
|
||||
V(CallKeyed) \
|
||||
V(CallKnownGlobal) \
|
||||
V(CallNamed) \
|
||||
@ -1922,24 +1921,6 @@ class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
|
||||
};
|
||||
|
||||
|
||||
class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LCallGlobal(LOperand* context) {
|
||||
inputs_[0] = context;
|
||||
}
|
||||
|
||||
LOperand* context() { return inputs_[0]; }
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
|
||||
DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
|
||||
|
||||
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
|
||||
|
||||
Handle<String> name() const {return hydrogen()->name(); }
|
||||
int arity() const { return hydrogen()->argument_count() - 1; }
|
||||
};
|
||||
|
||||
|
||||
class LCallKnownGlobal V8_FINAL : public LTemplateInstruction<1, 0, 0> {
|
||||
public:
|
||||
DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
|
||||
|
@ -3823,16 +3823,6 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
|
||||
}
|
||||
|
||||
|
||||
void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
|
||||
ASSERT(ToRegister(instr->context()).is(rsi));
|
||||
ASSERT(ToRegister(instr->result()).is(rax));
|
||||
int arity = instr->arity();
|
||||
Handle<Code> ic = isolate()->stub_cache()->ComputeCallInitialize(arity);
|
||||
__ Move(rcx, instr->name());
|
||||
CallCode(ic, RelocInfo::CODE_TARGET, instr);
|
||||
}
|
||||
|
||||
|
||||
void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
|
||||
ASSERT(ToRegister(instr->result()).is(rax));
|
||||
CallKnownFunction(instr->hydrogen()->target(),
|
||||
|
@ -316,12 +316,6 @@ void LCallNamed::PrintDataTo(StringStream* stream) {
|
||||
}
|
||||
|
||||
|
||||
void LCallGlobal::PrintDataTo(StringStream* stream) {
|
||||
SmartArrayPointer<char> name_string = name()->ToCString();
|
||||
stream->Add("%s #%d / ", name_string.get(), arity());
|
||||
}
|
||||
|
||||
|
||||
void LCallKnownGlobal::PrintDataTo(StringStream* stream) {
|
||||
stream->Add("#%d / ", arity());
|
||||
}
|
||||
@ -1191,13 +1185,6 @@ LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) {
|
||||
}
|
||||
|
||||
|
||||
LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) {
|
||||
LOperand* context = UseFixed(instr->context(), rsi);
|
||||
LCallGlobal* result = new(zone()) LCallGlobal(context);
|
||||
return MarkAsCall(DefineFixed(result, rax), instr);
|
||||
}
|
||||
|
||||
|
||||
LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) {
|
||||
return MarkAsCall(DefineFixed(new(zone()) LCallKnownGlobal, rax), instr);
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ class LCodeGen;
|
||||
V(Branch) \
|
||||
V(CallConstantFunction) \
|
||||
V(CallFunction) \
|
||||
V(CallGlobal) \
|
||||
V(CallKeyed) \
|
||||
V(CallKnownGlobal) \
|
||||
V(CallNamed) \
|
||||
@ -1866,24 +1865,6 @@ class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> {
|
||||
};
|
||||
|
||||
|
||||
class LCallGlobal V8_FINAL : public LTemplateInstruction<1, 1, 0> {
|
||||
public:
|
||||
explicit LCallGlobal(LOperand* context) {
|
||||
inputs_[0] = context;
|
||||
}
|
||||
|
||||
LOperand* context() { return inputs_[0]; }
|
||||
|
||||
DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
|
||||
DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
|
||||
|
||||
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
|
||||
|
||||
Handle<String> name() const {return hydrogen()->name(); }
|
||||
int arity() const { return hydrogen()->argument_count() - 1; }
|
||||
};
|
||||
|
||||
|
||||
class LCallKnownGlobal V8_FINAL : public LTemplateInstruction<1, 0, 0> {
|
||||
public:
|
||||
DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
|
||||
|
Loading…
Reference in New Issue
Block a user