Revision: 18908
Author:   [email protected]
Date:     Wed Jan 29 14:03:32 2014 UTC
Log:      Replace HThrow with HCallRuntime.

[email protected]

Review URL: https://codereview.chromium.org/131103021
http://code.google.com/p/v8/source/detail?r=18908

Modified:
 /branches/bleeding_edge/src/arm/lithium-arm.cc
 /branches/bleeding_edge/src/arm/lithium-arm.h
 /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
 /branches/bleeding_edge/src/ia32/lithium-ia32.cc
 /branches/bleeding_edge/src/ia32/lithium-ia32.h
 /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
 /branches/bleeding_edge/src/mips/lithium-mips.cc
 /branches/bleeding_edge/src/mips/lithium-mips.h
 /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.h

=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/arm/lithium-arm.cc Wed Jan 29 14:03:32 2014 UTC
@@ -1750,13 +1750,6 @@
   // abruptly (e.g., threw an exception).  There is nothing specific to do.
   return NULL;
 }
-
-
-LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
-  LOperand* context = UseFixed(instr->context(), cp);
-  LOperand* value = UseFixed(instr->value(), r0);
-  return MarkAsCall(new(zone()) LThrow(context, value), instr);
-}


 LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) {
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.h Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/arm/lithium-arm.h Wed Jan 29 14:03:32 2014 UTC
@@ -167,7 +167,6 @@
   V(RSubI)                                      \
   V(TaggedToI)                                  \
   V(ThisFunction)                               \
-  V(Throw)                                      \
   V(ToFastProperties)                           \
   V(TransitionElementsKind)                     \
   V(TrapAllocationMemento)                      \
@@ -1348,20 +1347,6 @@
 };


-class LThrow V8_FINAL : public LTemplateInstruction<0, 2, 0> {
- public:
-  LThrow(LOperand* context, LOperand* value) {
-    inputs_[0] = context;
-    inputs_[1] = value;
-  }
-
-  LOperand* context() { return inputs_[0]; }
-  LOperand* value() { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
-};
-
-
 class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
  public:
   LAddI(LOperand* left, LOperand* right) {
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Wed Jan 29 14:03:32 2014 UTC
@@ -1977,17 +1977,6 @@
     __ strh(value, operand);
   }
 }
-
-
-void LCodeGen::DoThrow(LThrow* instr) {
-  __ push(ToRegister(instr->value()));
-  ASSERT(ToRegister(instr->context()).is(cp));
-  CallRuntime(Runtime::kThrow, 1, instr);
-
-  if (FLAG_debug_code) {
-    __ stop("Unreachable code.");
-  }
-}


 void LCodeGen::DoAddI(LAddI* instr) {
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Wed Jan 29 14:03:32 2014 UTC
@@ -171,7 +171,6 @@
   V(StringCompareAndBranch)                    \
   V(Sub)                                       \
   V(ThisFunction)                              \
-  V(Throw)                                     \
   V(ToFastProperties)                          \
   V(TransitionElementsKind)                    \
   V(TrapAllocationMemento)                     \
@@ -1640,28 +1639,6 @@
 };


-class HThrow V8_FINAL : public HTemplateInstruction<2> {
- public:
-  DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HThrow, HValue*);
-
- virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
-    return Representation::Tagged();
-  }
-
-  HValue* context() { return OperandAt(0); }
-  HValue* value() { return OperandAt(1); }
-
-  DECLARE_CONCRETE_INSTRUCTION(Throw)
-
- private:
-  HThrow(HValue* context, HValue* value) {
-    SetOperandAt(0, context);
-    SetOperandAt(1, value);
-    SetAllSideEffects();
-  }
-};
-
-
 class HUseConst V8_FINAL : public HUnaryOperation {
  public:
   DECLARE_INSTRUCTION_FACTORY_P1(HUseConst, HValue*);
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Wed Jan 29 13:41:00 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Wed Jan 29 14:03:32 2014 UTC
@@ -6254,7 +6254,9 @@

   HValue* value = environment()->Pop();
   if (!FLAG_emit_opt_code_positions) SetSourcePosition(expr->position());
-  Add<HThrow>(value);
+  Add<HPushArgument>(value);
+  Add<HCallRuntime>(isolate()->factory()->empty_string(),
+                    Runtime::FunctionForId(Runtime::kThrow), 1);
   Add<HSimulate>(expr->id());

   // If the throw definitely exits the function, we can finish with a dummy
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Wed Jan 29 14:03:32 2014 UTC
@@ -2087,18 +2087,6 @@
     }
   }
 }
-
-
-void LCodeGen::DoThrow(LThrow* instr) {
-  __ push(ToOperand(instr->value()));
-  ASSERT(ToRegister(instr->context()).is(esi));
-  CallRuntime(Runtime::kThrow, 1, instr);
-
-  if (FLAG_debug_code) {
-    Comment("Unreachable code.");
-    __ int3();
-  }
-}


 void LCodeGen::DoAddI(LAddI* instr) {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Wed Jan 29 14:03:32 2014 UTC
@@ -1764,13 +1764,6 @@
   // abruptly (e.g., threw an exception).  There is nothing specific to do.
   return NULL;
 }
-
-
-LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
-  LOperand* context = UseFixed(instr->context(), esi);
-  LOperand* value = UseFixed(instr->value(), eax);
-  return MarkAsCall(new(zone()) LThrow(context, value), instr);
-}


 LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.h Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/ia32/lithium-ia32.h Wed Jan 29 14:03:32 2014 UTC
@@ -166,7 +166,6 @@
   V(SubI)                                       \
   V(TaggedToI)                                  \
   V(ThisFunction)                               \
-  V(Throw)                                      \
   V(ToFastProperties)                           \
   V(TransitionElementsKind)                     \
   V(TrapAllocationMemento)                      \
@@ -1323,20 +1322,6 @@
 };


-class LThrow V8_FINAL : public LTemplateInstruction<0, 2, 0> {
- public:
-  LThrow(LOperand* context, LOperand* value) {
-    inputs_[0] = context;
-    inputs_[1] = value;
-  }
-
-  LOperand* context() { return inputs_[0]; }
-  LOperand* value() { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
-};
-
-
 class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
  public:
   LAddI(LOperand* left, LOperand* right) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Jan 29 14:03:32 2014 UTC
@@ -1786,17 +1786,6 @@
     __ sh(value, operand);
   }
 }
-
-
-void LCodeGen::DoThrow(LThrow* instr) {
-  __ push(ToRegister(instr->value()));
-  ASSERT(ToRegister(instr->context()).is(cp));
-  CallRuntime(Runtime::kThrow, 1, instr);
-
-  if (FLAG_debug_code) {
-    __ stop("Unreachable code.");
-  }
-}


 void LCodeGen::DoAddI(LAddI* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/mips/lithium-mips.cc Wed Jan 29 14:03:32 2014 UTC
@@ -1678,13 +1678,6 @@
   // abruptly (e.g., threw an exception).  There is nothing specific to do.
   return NULL;
 }
-
-
-LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
-  LOperand* context = UseFixed(instr->context(), cp);
-  LOperand* value = UseFixed(instr->value(), a0);
-  return MarkAsCall(new(zone()) LThrow(context, value), instr);
-}


 LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.h Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/mips/lithium-mips.h Wed Jan 29 14:03:32 2014 UTC
@@ -165,7 +165,6 @@
   V(SubI)                                       \
   V(TaggedToI)                                  \
   V(ThisFunction)                               \
-  V(Throw)                                      \
   V(ToFastProperties)                           \
   V(TransitionElementsKind)                     \
   V(TrapAllocationMemento)                      \
@@ -1328,20 +1327,6 @@
 };


-class LThrow V8_FINAL : public LTemplateInstruction<0, 2, 0> {
- public:
-  LThrow(LOperand* context, LOperand* value) {
-    inputs_[0] = context;
-    inputs_[1] = value;
-  }
-
-  LOperand* context() { return inputs_[0]; }
-  LOperand* value() { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
-};
-
-
 class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
  public:
   LAddI(LOperand* left, LOperand* right) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Jan 29 14:03:32 2014 UTC
@@ -1692,18 +1692,6 @@
     }
   }
 }
-
-
-void LCodeGen::DoThrow(LThrow* instr) {
-  __ push(ToRegister(instr->value()));
-  ASSERT(ToRegister(instr->context()).is(rsi));
-  CallRuntime(Runtime::kThrow, 1, instr);
-
-  if (FLAG_debug_code) {
-    Comment("Unreachable code.");
-    __ int3();
-  }
-}


 void LCodeGen::DoAddI(LAddI* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/x64/lithium-x64.cc Wed Jan 29 14:03:32 2014 UTC
@@ -1657,13 +1657,6 @@
   // abruptly (e.g., threw an exception).  There is nothing specific to do.
   return NULL;
 }
-
-
-LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
-  LOperand* context = UseFixed(instr->context(), rsi);
-  LOperand* value = UseFixed(instr->value(), rax);
-  return MarkAsCall(new(zone()) LThrow(context, value), instr);
-}


 LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h Wed Jan 29 13:44:50 2014 UTC +++ /branches/bleeding_edge/src/x64/lithium-x64.h Wed Jan 29 14:03:32 2014 UTC
@@ -164,7 +164,6 @@
   V(SubI)                                       \
   V(TaggedToI)                                  \
   V(ThisFunction)                               \
-  V(Throw)                                      \
   V(ToFastProperties)                           \
   V(TransitionElementsKind)                     \
   V(TrapAllocationMemento)                      \
@@ -1287,20 +1286,6 @@
 };


-class LThrow V8_FINAL : public LTemplateInstruction<0, 2, 0> {
- public:
-  explicit LThrow(LOperand* context, LOperand* value) {
-    inputs_[0] = context;
-    inputs_[1] = value;
-  }
-
-  LOperand* context() { return inputs_[0]; }
-  LOperand* value() { return inputs_[1]; }
-
-  DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
-};
-
-
 class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
  public:
   LAddI(LOperand* left, LOperand* right) {

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to