From 5767f56a4193e4970af0b92e33bc37687e26d873 Mon Sep 17 00:00:00 2001 From: Alexey Toptygin Date: Thu, 20 Feb 2020 12:48:03 -0800 Subject: [PATCH] Delete 2 unused IROPs. Summary: ThrowArithmeticError and ThrowDivisionByZeroError are dead, delete them. Reviewed By: ricklavoie Differential Revision: D19993545 fbshipit-source-id: fb119bcec41d70e73570bbac23440fb3ed4437cf --- hphp/doc/ir.specification | 8 -------- hphp/runtime/base/builtin-functions.cpp | 8 -------- hphp/runtime/base/builtin-functions.h | 2 -- hphp/runtime/vm/jit/dce.cpp | 2 -- hphp/runtime/vm/jit/ir-opcode.cpp | 2 -- hphp/runtime/vm/jit/ir-unit.cpp | 2 -- hphp/runtime/vm/jit/irlower-exception.cpp | 2 -- hphp/runtime/vm/jit/memory-effects.cpp | 2 -- hphp/runtime/vm/jit/native-calls.cpp | 4 ---- 9 files changed, 32 deletions(-) diff --git a/hphp/doc/ir.specification b/hphp/doc/ir.specification index ae520d1d732..1b9340cd6bc 100644 --- a/hphp/doc/ir.specification +++ b/hphp/doc/ir.specification @@ -3261,14 +3261,6 @@ fields of that struct for holding intermediate values. Throws an InvalidOperationException with a message indicating S0. -| ThrowArithmeticError, ND, S(Str), T - - Throws an ArithmeticError with a message indicating S0. - -| ThrowDivisionByZeroError, ND, S(Str), T - - Throws a DivisionByZeroError with a message indicating S0. - | ThrowDivisionByZeroException, ND, NA, T Throws a DivisionByZeroException. diff --git a/hphp/runtime/base/builtin-functions.cpp b/hphp/runtime/base/builtin-functions.cpp index d0862668780..b56db640d77 100644 --- a/hphp/runtime/base/builtin-functions.cpp +++ b/hphp/runtime/base/builtin-functions.cpp @@ -738,14 +738,6 @@ void throw_invalid_operation_exception(StringData* str) { SystemLib::throwInvalidOperationExceptionObject(Variant{str}); } -void throw_arithmetic_error(StringData* str) { - SystemLib::throwArithmeticErrorObject(Variant{str}); -} - -void throw_division_by_zero_error(StringData *str) { - SystemLib::throwDivisionByZeroErrorObject(Variant{str}); -} - void throw_division_by_zero_exception() { SystemLib::throwDivisionByZeroExceptionObject(); } diff --git a/hphp/runtime/base/builtin-functions.h b/hphp/runtime/base/builtin-functions.h index c4a5b89d969..6d0b3167675 100644 --- a/hphp/runtime/base/builtin-functions.h +++ b/hphp/runtime/base/builtin-functions.h @@ -343,8 +343,6 @@ bool is_constructor_name(const char* func); [[noreturn]] void throw_invalid_collection_parameter(); [[noreturn]] void throw_invalid_operation_exception(StringData*); -[[noreturn]] void throw_arithmetic_error(StringData*); -[[noreturn]] void throw_division_by_zero_error(StringData*); [[noreturn]] void throw_division_by_zero_exception(); [[noreturn]] void throw_iterator_not_valid(); [[noreturn]] void throw_collection_property_exception(); diff --git a/hphp/runtime/vm/jit/dce.cpp b/hphp/runtime/vm/jit/dce.cpp index c43d687dc36..b4fdedaf941 100644 --- a/hphp/runtime/vm/jit/dce.cpp +++ b/hphp/runtime/vm/jit/dce.cpp @@ -707,9 +707,7 @@ bool canDCE(IRInstruction* inst) { case ThrowOutOfBounds: case ThrowInvalidArrayKey: case ThrowInvalidOperation: - case ThrowArithmeticError: case ThrowCallReifiedFunctionWithoutGenerics: - case ThrowDivisionByZeroError: case ThrowDivisionByZeroException: case ThrowHasThisNeedStatic: case ThrowLateInitPropError: diff --git a/hphp/runtime/vm/jit/ir-opcode.cpp b/hphp/runtime/vm/jit/ir-opcode.cpp index e6e6f1ece43..7952cb3b6a6 100644 --- a/hphp/runtime/vm/jit/ir-opcode.cpp +++ b/hphp/runtime/vm/jit/ir-opcode.cpp @@ -488,12 +488,10 @@ bool opcodeMayRaise(Opcode opc) { case SuspendHookAwaitR: case SuspendHookCreateCont: case SuspendHookYield: - case ThrowArithmeticError: case ThrowAsTypeStructException: case ThrowArrayIndexException: case ThrowArrayKeyException: case ThrowCallReifiedFunctionWithoutGenerics: - case ThrowDivisionByZeroError: case ThrowDivisionByZeroException: case ThrowHasThisNeedStatic: case ThrowInvalidArrayKey: diff --git a/hphp/runtime/vm/jit/ir-unit.cpp b/hphp/runtime/vm/jit/ir-unit.cpp index aa5d4f613e4..b8eaec26362 100644 --- a/hphp/runtime/vm/jit/ir-unit.cpp +++ b/hphp/runtime/vm/jit/ir-unit.cpp @@ -129,12 +129,10 @@ static bool endsUnitAtSrcKey(const Block* block, SrcKey sk) { case JmpSSwitchDest: case JmpSwitchDest: case RaiseError: - case ThrowArithmeticError: case ThrowAsTypeStructException: case ThrowArrayIndexException: case ThrowArrayKeyException: case ThrowCallReifiedFunctionWithoutGenerics: - case ThrowDivisionByZeroError: case ThrowDivisionByZeroException: case ThrowInvalidArrayKey: case ThrowInvalidOperation: diff --git a/hphp/runtime/vm/jit/irlower-exception.cpp b/hphp/runtime/vm/jit/irlower-exception.cpp index dfee49add0d..d5a6329f883 100644 --- a/hphp/runtime/vm/jit/irlower-exception.cpp +++ b/hphp/runtime/vm/jit/irlower-exception.cpp @@ -187,12 +187,10 @@ IMPL_OPCODE_CALL(RaiseUndefProp) IMPL_OPCODE_CALL(RaiseUninitLoc) IMPL_OPCODE_CALL(RaiseWarning) IMPL_OPCODE_CALL(RaiseRxCallViolation) -IMPL_OPCODE_CALL(ThrowArithmeticError) IMPL_OPCODE_CALL(ThrowArrayIndexException) IMPL_OPCODE_CALL(ThrowArrayKeyException) IMPL_OPCODE_CALL(ThrowAsTypeStructException) IMPL_OPCODE_CALL(ThrowCallReifiedFunctionWithoutGenerics) -IMPL_OPCODE_CALL(ThrowDivisionByZeroError) IMPL_OPCODE_CALL(ThrowDivisionByZeroException) IMPL_OPCODE_CALL(ThrowHasThisNeedStatic) IMPL_OPCODE_CALL(ThrowInvalidArrayKey) diff --git a/hphp/runtime/vm/jit/memory-effects.cpp b/hphp/runtime/vm/jit/memory-effects.cpp index ba4e255b53e..e3910b76f93 100644 --- a/hphp/runtime/vm/jit/memory-effects.cpp +++ b/hphp/runtime/vm/jit/memory-effects.cpp @@ -2088,9 +2088,7 @@ MemEffects memory_effects_impl(const IRInstruction& inst) { case ThrowOutOfBounds: case ThrowInvalidArrayKey: case ThrowInvalidOperation: - case ThrowArithmeticError: case ThrowCallReifiedFunctionWithoutGenerics: - case ThrowDivisionByZeroError: case ThrowDivisionByZeroException: case ThrowHasThisNeedStatic: case ThrowLateInitPropError: diff --git a/hphp/runtime/vm/jit/native-calls.cpp b/hphp/runtime/vm/jit/native-calls.cpp index 8943677f7db..561a40e1743 100644 --- a/hphp/runtime/vm/jit/native-calls.cpp +++ b/hphp/runtime/vm/jit/native-calls.cpp @@ -307,13 +307,9 @@ static CallMap s_callMap { DNone, SSync, {{SSA, 0}, {SSA, 1}}}, {ThrowInvalidOperation, throw_invalid_operation_exception, DNone, SSync, {{SSA, 0}}}, - {ThrowArithmeticError, throw_arithmetic_error, - DNone, SSync, {{SSA, 0}}}, {ThrowCallReifiedFunctionWithoutGenerics, throw_call_reified_func_without_generics, DNone, SSync, {{SSA, 0}}}, - {ThrowDivisionByZeroError, throw_division_by_zero_error, - DNone, SSync, {{SSA, 0}}}, {ThrowDivisionByZeroException, throw_division_by_zero_exception, DNone, SSync, {}}, {ThrowHasThisNeedStatic, throw_has_this_need_static, -- 2.11.4.GIT