Replace HThrow with HCallRuntime.
R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/131103021 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18908 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
5a2fe0a670
commit
4a0959e360
@ -1752,13 +1752,6 @@ LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -167,7 +167,6 @@ class LCodeGen;
|
||||
V(RSubI) \
|
||||
V(TaggedToI) \
|
||||
V(ThisFunction) \
|
||||
V(Throw) \
|
||||
V(ToFastProperties) \
|
||||
V(TransitionElementsKind) \
|
||||
V(TrapAllocationMemento) \
|
||||
@ -1348,20 +1347,6 @@ class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> {
|
||||
};
|
||||
|
||||
|
||||
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) {
|
||||
|
@ -1979,17 +1979,6 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
LOperand* left = instr->left();
|
||||
LOperand* right = instr->right();
|
||||
|
@ -171,7 +171,6 @@ class LChunkBuilder;
|
||||
V(StringCompareAndBranch) \
|
||||
V(Sub) \
|
||||
V(ThisFunction) \
|
||||
V(Throw) \
|
||||
V(ToFastProperties) \
|
||||
V(TransitionElementsKind) \
|
||||
V(TrapAllocationMemento) \
|
||||
@ -1640,28 +1639,6 @@ class HUnaryOperation : public HTemplateInstruction<1> {
|
||||
};
|
||||
|
||||
|
||||
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*);
|
||||
|
@ -6254,7 +6254,9 @@ void HOptimizedGraphBuilder::VisitThrow(Throw* expr) {
|
||||
|
||||
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
|
||||
|
@ -2089,18 +2089,6 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
LOperand* left = instr->left();
|
||||
LOperand* right = instr->right();
|
||||
|
@ -1766,13 +1766,6 @@ LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -166,7 +166,6 @@ class LCodeGen;
|
||||
V(SubI) \
|
||||
V(TaggedToI) \
|
||||
V(ThisFunction) \
|
||||
V(Throw) \
|
||||
V(ToFastProperties) \
|
||||
V(TransitionElementsKind) \
|
||||
V(TrapAllocationMemento) \
|
||||
@ -1323,20 +1322,6 @@ class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> {
|
||||
};
|
||||
|
||||
|
||||
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) {
|
||||
|
@ -1788,17 +1788,6 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
LOperand* left = instr->left();
|
||||
LOperand* right = instr->right();
|
||||
|
@ -1680,13 +1680,6 @@ LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -165,7 +165,6 @@ class LCodeGen;
|
||||
V(SubI) \
|
||||
V(TaggedToI) \
|
||||
V(ThisFunction) \
|
||||
V(Throw) \
|
||||
V(ToFastProperties) \
|
||||
V(TransitionElementsKind) \
|
||||
V(TrapAllocationMemento) \
|
||||
@ -1328,20 +1327,6 @@ class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> {
|
||||
};
|
||||
|
||||
|
||||
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) {
|
||||
|
@ -1694,18 +1694,6 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
LOperand* left = instr->left();
|
||||
LOperand* right = instr->right();
|
||||
|
@ -1659,13 +1659,6 @@ LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -164,7 +164,6 @@ class LCodeGen;
|
||||
V(SubI) \
|
||||
V(TaggedToI) \
|
||||
V(ThisFunction) \
|
||||
V(Throw) \
|
||||
V(ToFastProperties) \
|
||||
V(TransitionElementsKind) \
|
||||
V(TrapAllocationMemento) \
|
||||
@ -1287,20 +1286,6 @@ class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> {
|
||||
};
|
||||
|
||||
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user