Remove HCallGlobal and merge uses with HCallNamed.
authorverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 14 Jan 2014 16:15:52 +0000 (16:15 +0000)
committerverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 14 Jan 2014 16:15:52 +0000 (16:15 +0000)
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

12 files changed:
src/arm/lithium-arm.cc
src/arm/lithium-arm.h
src/arm/lithium-codegen-arm.cc
src/hydrogen-instructions.cc
src/hydrogen-instructions.h
src/hydrogen.cc
src/ia32/lithium-codegen-ia32.cc
src/ia32/lithium-ia32.cc
src/ia32/lithium-ia32.h
src/x64/lithium-codegen-x64.cc
src/x64/lithium-x64.cc
src/x64/lithium-x64.h

index b72417e8c854c384e278872d04313f1d30d095b3..08f872859cc27c207f0a16411d04e1a82edd165e 100644 (file)
@@ -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);
 }
index 3a540a2722bb79e3194e775072643f195faf47d4..e24a23bb48a20ab3ad522aa1495ed0a732c92e64 100644 (file)
@@ -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")
index 7483649889308e74f6bb87a0a6b44f9c541cdb3f..a9639d81686943ec34a6f54d15754fef82d01078 100644 (file)
@@ -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(),
index c6feeb7e34a989310a44fef38275c2f3b7d0efe3..59341c032a65042feca41112fba2fc9ef7afa460 100644 (file)
@@ -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());
index af6729ab6614412ad1e46da5e466bae5179d523f..b02396684c411a692235fb75cfa9a98db8d99a74 100644 (file)
@@ -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);
index 7841e1f92f8fe7d93cac3fe86fe40120a88596b1..091fcf7d17fc361951c46267fcf278ffa0dccd03 100644 (file)
@@ -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);
       }
 
index e2814959cd145957cfe532eb70c9bdc00846c1b9..ac054f3a8a1cb37d736bd199598236369c81c1d5 100644 (file)
@@ -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(),
index ea1f7b8bb8c53e2249eeb87cc3d17b8ab212d2cc..2eb387a128a5f52f2c95451358419e3347056469 100644 (file)
@@ -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);
 }
index 62815f33b9b4017091832a240918afbac2bf9639..a9b444245431059009c00bc6b45cece863672937 100644 (file)
@@ -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")
index c3fbba4e417488accef545c0749f58ca3947f905..0d7baeaf11b1ea85060c9d0e91c4ea26e62d45e7 100644 (file)
@@ -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(),
index 2ebc197d9998755247e4d3735ff271c1772f51a9..e329b21eb3d564033ba9230e8ac19648845f43a1 100644 (file)
@@ -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);
 }
index b04d607624462152b35d861478d0b4561297015a..eea11f48d1a0c54ee6b034b9216221d588100d6f 100644 (file)
@@ -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")