From e60436cd057d733cd35e101db44facf5b23bed69 Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Fri, 29 Aug 2025 13:10:54 -0700 Subject: [PATCH 1/3] :wastebasket: (patch) Remove extra includes --- .../generated_tests/estell_except.cpp.csv | 118 ++++++++--------- benchmark/generated_tests/except.cpp.csv | 120 +++++++++--------- benchmark/generated_tests/gcc_except_fast.csv | 120 +++++++++--------- benchmark/generated_tests/nearpoint.cpp.csv | 86 ++++++------- .../generated_tests/result_error04.cpp.csv | 28 ++-- .../generated_tests/result_error16.cpp.csv | 30 ++--- .../generated_tests/result_error65.cpp.csv | 40 +++--- include/libhal-exceptions/control.hpp | 3 - 8 files changed, 271 insertions(+), 274 deletions(-) diff --git a/benchmark/generated_tests/estell_except.cpp.csv b/benchmark/generated_tests/estell_except.cpp.csv index 64595b7..03f8cab 100644 --- a/benchmark/generated_tests/estell_except.cpp.csv +++ b/benchmark/generated_tests/estell_except.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,342.12 -35,4,0,244.71 -15,4,0,116.5 -5,4,0,52.0 -1,4,0,26.17 -50,4,25,431.75 -35,4,25,307.46 -15,4,25,144.12 -5,4,25,65.79 -1,4,25,33.58 -50,4,50,514.25 -35,4,50,369.5 -15,4,50,172.0 -5,4,50,72.71 -1,4,50,33.54 -50,4,100,687.25 -35,4,100,486.92 -15,4,100,220.54 -5,4,100,87.29 -1,4,100,33.58 -50,16,0,342.17 -35,16,0,244.75 -15,16,0,116.42 -5,16,0,52.04 +50,4,0,340.83 +35,4,0,244.38 +15,4,0,116.75 +5,4,0,51.79 +1,4,0,26.21 +50,4,25,430.96 +35,4,25,307.67 +15,4,25,145.12 +5,4,25,66.67 +1,4,25,33.96 +50,4,50,513.67 +35,4,50,369.12 +15,4,50,172.08 +5,4,50,74.0 +1,4,50,33.96 +50,4,100,684.96 +35,4,100,485.83 +15,4,100,219.83 +5,4,100,87.33 +1,4,100,34.0 +50,16,0,340.88 +35,16,0,244.38 +15,16,0,116.75 +5,16,0,51.79 1,16,0,26.17 -50,16,25,431.79 -35,16,25,307.5 -15,16,25,144.17 -5,16,25,65.83 -1,16,25,33.62 -50,16,50,514.29 -35,16,50,369.54 -15,16,50,172.04 -5,16,50,72.75 -1,16,50,33.62 -50,16,100,687.17 -35,16,100,487.0 -15,16,100,220.62 -5,16,100,87.33 -1,16,100,33.62 -50,65,0,352.62 -35,65,0,255.25 -15,65,0,126.96 -5,65,0,62.5 -1,65,0,36.67 -50,65,25,442.12 -35,65,25,317.88 -15,65,25,154.58 -5,65,25,76.21 -1,65,25,44.0 -50,65,50,524.71 -35,65,50,379.88 -15,65,50,182.46 -5,65,50,83.17 -1,65,50,44.0 -50,65,100,697.54 -35,65,100,497.29 -15,65,100,231.0 -5,65,100,97.75 -1,65,100,44.04 +50,16,25,431.0 +35,16,25,308.08 +15,16,25,145.17 +5,16,25,66.33 +1,16,25,34.04 +50,16,50,513.67 +35,16,50,369.17 +15,16,50,172.12 +5,16,50,74.0 +1,16,50,34.04 +50,16,100,684.96 +35,16,100,485.92 +15,16,100,219.83 +5,16,100,87.38 +1,16,100,34.0 +50,65,0,356.46 +35,65,0,259.96 +15,65,0,132.33 +5,65,0,67.38 +1,65,0,41.79 +50,65,25,446.92 +35,65,25,323.67 +15,65,25,160.29 +5,65,25,81.83 +1,65,25,49.54 +50,65,50,529.25 +35,65,50,384.67 +15,65,50,187.71 +5,65,50,89.54 +1,65,50,49.5 +50,65,100,700.42 +35,65,100,501.42 +15,65,100,235.33 +5,65,100,102.92 +1,65,100,49.54 diff --git a/benchmark/generated_tests/except.cpp.csv b/benchmark/generated_tests/except.cpp.csv index 54f3647..979a03c 100644 --- a/benchmark/generated_tests/except.cpp.csv +++ b/benchmark/generated_tests/except.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,2339.79 -35,4,0,1716.62 -15,4,0,807.08 -5,4,0,349.21 -1,4,0,161.46 -50,4,25,2614.88 -35,4,25,1855.21 -15,4,25,871.12 -5,4,25,393.25 -1,4,25,181.67 -50,4,50,2870.12 -35,4,50,2048.88 -15,4,50,955.42 -5,4,50,404.12 -1,4,50,181.67 -50,4,100,3369.71 -35,4,100,2398.21 -15,4,100,1087.79 -5,4,100,444.67 -1,4,100,181.71 -50,16,0,2341.92 -35,16,0,1710.54 -15,16,0,814.04 -5,16,0,354.62 -1,16,0,165.17 -50,16,25,2623.08 -35,16,25,1859.08 -15,16,25,873.38 -5,16,25,391.58 -1,16,25,185.46 -50,16,50,2868.42 -35,16,50,2050.88 -15,16,50,946.88 -5,16,50,407.79 -1,16,50,185.5 -50,16,100,3371.96 -35,16,100,2389.88 -15,16,100,1086.21 -5,16,100,446.83 -1,16,100,185.5 -50,65,0,2354.79 -35,65,0,1724.92 -15,65,0,822.92 -5,65,0,363.54 -1,65,0,174.17 -50,65,25,2632.21 -35,65,25,1868.08 -15,65,25,875.58 -5,65,25,404.46 -1,65,25,194.38 -50,65,50,2881.33 -35,65,50,2055.25 -15,65,50,962.71 -5,65,50,416.79 -1,65,50,194.38 -50,65,100,3374.0 -35,65,100,2405.58 -15,65,100,1098.96 -5,65,100,459.62 -1,65,100,194.42 +50,4,0,2310.0 +35,4,0,1659.38 +15,4,0,777.83 +5,4,0,335.12 +1,4,0,170.92 +50,4,25,2546.42 +35,4,25,1808.46 +15,4,25,832.71 +5,4,25,391.0 +1,4,25,194.42 +50,4,50,2867.29 +35,4,50,2056.71 +15,4,50,956.12 +5,4,50,415.17 +1,4,50,194.38 +50,4,100,3384.58 +35,4,100,2410.67 +15,4,100,1099.58 +5,4,100,456.04 +1,4,100,194.38 +50,16,0,2311.92 +35,16,0,1663.38 +15,16,0,776.17 +5,16,0,333.38 +1,16,0,169.29 +50,16,25,2544.58 +35,16,25,1806.71 +15,16,25,824.67 +5,16,25,393.21 +1,16,25,196.54 +50,16,50,2869.25 +35,16,50,2050.62 +15,16,50,961.75 +5,16,50,417.42 +1,16,50,196.54 +50,16,100,3390.25 +35,16,100,2409.25 +15,16,100,1101.92 +5,16,100,450.17 +1,16,100,196.54 +50,65,0,2319.67 +35,65,0,1677.17 +15,65,0,793.88 +5,65,0,351.08 +1,65,0,186.88 +50,65,25,2562.62 +35,65,25,1824.62 +15,65,25,845.67 +5,65,25,410.79 +1,65,25,214.25 +50,65,50,2887.25 +35,65,50,2070.12 +15,65,50,975.58 +5,65,50,435.08 +1,65,50,214.25 +50,65,100,3404.25 +35,65,100,2426.88 +15,65,100,1109.25 +5,65,100,469.46 +1,65,100,214.25 diff --git a/benchmark/generated_tests/gcc_except_fast.csv b/benchmark/generated_tests/gcc_except_fast.csv index 5ab0a4c..d209d50 100644 --- a/benchmark/generated_tests/gcc_except_fast.csv +++ b/benchmark/generated_tests/gcc_except_fast.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,1657.12 -35,4,0,1201.67 -15,4,0,575.17 -5,4,0,258.71 -1,4,0,146.62 -50,4,25,1871.33 -35,4,25,1328.54 -15,4,25,620.17 -5,4,25,312.08 -1,4,25,166.58 -50,4,50,2188.79 -35,4,50,1573.83 -15,4,50,741.46 -5,4,50,334.88 -1,4,50,166.62 -50,4,100,2687.46 -35,4,100,1908.21 -15,4,100,881.46 -5,4,100,374.21 -1,4,100,166.58 -50,16,0,1659.17 -35,16,0,1205.38 -15,16,0,573.67 -5,16,0,257.21 -1,16,0,145.0 -50,16,25,1869.83 -35,16,25,1326.92 -15,16,25,611.62 -5,16,25,314.21 -1,16,25,170.42 -50,16,50,2190.71 -35,16,50,1567.75 -15,16,50,746.62 -5,16,50,333.25 -1,16,50,170.42 -50,16,100,2679.08 -35,16,100,1913.54 -15,16,100,879.71 -5,16,100,376.33 -1,16,100,170.38 -50,65,0,1666.38 -35,65,0,1219.5 -15,65,0,591.42 -5,65,0,275.0 -1,65,0,162.92 -50,65,25,1887.62 -35,65,25,1344.58 -15,65,25,632.67 -5,65,25,332.12 -1,65,25,184.38 -50,65,50,2208.42 -35,65,50,1586.79 -15,65,50,760.67 -5,65,50,351.12 -1,65,50,184.38 -50,65,100,2699.92 -35,65,100,1927.54 -15,65,100,897.71 -5,65,100,394.29 -1,65,100,184.38 +50,4,0,1645.83 +35,4,0,1193.75 +15,4,0,563.96 +5,4,0,260.33 +1,4,0,139.75 +50,4,25,1924.5 +35,4,25,1373.33 +15,4,25,658.0 +5,4,25,314.29 +1,4,25,161.38 +50,4,50,2204.0 +35,4,50,1576.33 +15,4,50,742.5 +5,4,50,330.62 +1,4,50,161.42 +50,4,100,2731.5 +35,4,100,1946.25 +15,4,100,890.0 +5,4,100,372.0 +1,4,100,161.33 +50,16,0,1637.92 +35,16,0,1192.21 +15,16,0,566.12 +5,16,0,262.46 +1,16,0,141.96 +50,16,25,1926.67 +35,16,25,1375.58 +15,16,25,663.67 +5,16,25,316.54 +1,16,25,163.5 +50,16,50,2206.17 +35,16,50,1580.17 +15,16,50,740.96 +5,16,50,332.88 +1,16,50,163.5 +50,16,100,2736.96 +35,16,100,1944.67 +15,16,100,892.21 +5,16,100,366.08 +1,16,100,163.54 +50,65,0,1653.75 +35,65,0,1204.75 +15,65,0,578.79 +5,65,0,275.04 +1,65,0,154.46 +50,65,25,1933.46 +35,65,25,1388.25 +15,65,25,672.33 +5,65,25,310.08 +1,65,25,176.08 +50,65,50,2210.62 +35,65,50,1588.88 +15,65,50,753.42 +5,65,50,345.42 +1,65,50,176.17 +50,65,100,2745.83 +35,65,100,1957.33 +15,65,100,894.33 +5,65,100,380.25 +1,65,100,176.17 diff --git a/benchmark/generated_tests/nearpoint.cpp.csv b/benchmark/generated_tests/nearpoint.cpp.csv index 1e13f3b..ed935d7 100644 --- a/benchmark/generated_tests/nearpoint.cpp.csv +++ b/benchmark/generated_tests/nearpoint.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us 50,4,0,199.67 35,4,0,142.33 -15,4,0,73.42 -5,4,0,38.83 +15,4,0,73.46 +5,4,0,38.88 1,4,0,23.71 -50,4,25,300.0 -35,4,25,215.0 -15,4,25,109.08 +50,4,25,300.12 +35,4,25,215.04 +15,4,25,109.12 5,4,25,54.25 1,4,25,29.04 -50,4,50,431.0 -35,4,50,317.88 -15,4,50,151.79 -5,4,50,66.83 +50,4,50,431.12 +35,4,50,317.96 +15,4,50,151.83 +5,4,50,66.88 1,4,50,29.04 -50,4,100,709.08 -35,4,100,504.21 -15,4,100,224.79 -5,4,100,86.88 +50,4,100,709.29 +35,4,100,504.33 +15,4,100,224.83 +5,4,100,86.92 1,4,100,29.04 -50,16,0,199.25 -35,16,0,143.83 -15,16,0,72.96 -5,16,0,38.42 +50,16,0,199.29 +35,16,0,143.92 +15,16,0,73.0 +5,16,0,38.38 1,16,0,25.04 -50,16,25,299.71 -35,16,25,214.79 +50,16,25,299.79 +35,16,25,214.88 15,16,25,110.12 -5,16,25,56.17 +5,16,25,56.12 1,16,25,32.21 -50,16,50,430.71 -35,16,50,317.62 -15,16,50,151.54 -5,16,50,66.79 +50,16,50,430.88 +35,16,50,317.71 +15,16,50,151.58 +5,16,50,66.83 1,16,50,32.21 -50,16,100,709.0 -35,16,100,504.12 -15,16,100,224.88 +50,16,100,709.17 +35,16,100,504.25 +15,16,100,224.96 5,16,100,87.04 -1,16,100,32.21 -50,65,0,209.88 -35,65,0,154.67 -15,65,0,83.75 -5,65,0,49.21 +1,16,100,32.25 +50,65,0,209.92 +35,65,0,154.71 +15,65,0,83.79 +5,65,0,49.25 1,65,0,35.83 -50,65,25,310.42 -35,65,25,225.5 +50,65,25,310.5 +35,65,25,225.54 15,65,25,120.83 5,65,25,67.08 -1,65,25,43.17 -50,65,50,441.62 -35,65,50,328.58 +1,65,25,43.12 +50,65,50,441.75 +35,65,50,328.62 15,65,50,162.5 -5,65,50,77.5 -1,65,50,43.12 -50,65,100,719.71 -35,65,100,514.88 -15,65,100,234.08 -5,65,100,96.92 +5,65,50,77.54 +1,65,50,43.17 +50,65,100,719.96 +35,65,100,515.04 +15,65,100,234.17 +5,65,100,96.96 1,65,100,43.12 diff --git a/benchmark/generated_tests/result_error04.cpp.csv b/benchmark/generated_tests/result_error04.cpp.csv index 6df8eb8..55e1946 100644 --- a/benchmark/generated_tests/result_error04.cpp.csv +++ b/benchmark/generated_tests/result_error04.cpp.csv @@ -1,21 +1,21 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,16.33 +50,4,0,16.29 35,4,0,11.71 -15,4,0,5.79 -5,4,0,2.75 -1,4,0,1.58 -50,4,25,17.33 -35,4,25,12.54 -15,4,25,6.12 -5,4,25,2.92 +15,4,0,5.71 +5,4,0,2.71 +1,4,0,1.5 +50,4,25,17.29 +35,4,25,12.46 +15,4,25,6.08 +5,4,25,2.83 1,4,25,1.58 -50,4,50,18.46 +50,4,50,18.38 35,4,50,13.29 -15,4,50,6.42 -5,4,50,2.92 -1,4,50,1.58 -50,4,100,20.33 +15,4,50,6.33 +5,4,50,2.88 +1,4,50,1.54 +50,4,100,20.25 35,4,100,14.62 -15,4,100,6.96 +15,4,100,6.88 5,4,100,3.12 1,4,100,1.58 diff --git a/benchmark/generated_tests/result_error16.cpp.csv b/benchmark/generated_tests/result_error16.cpp.csv index 9724fa8..7ed27c8 100644 --- a/benchmark/generated_tests/result_error16.cpp.csv +++ b/benchmark/generated_tests/result_error16.cpp.csv @@ -1,21 +1,21 @@ depth,error_size,destructor_percentage,pulse_us -50,16,0,28.83 -35,16,0,20.71 +50,16,0,28.79 +35,16,0,20.58 15,16,0,9.58 -5,16,0,4.08 +5,16,0,3.96 1,16,0,1.79 -50,16,25,29.67 -35,16,25,21.21 -15,16,25,9.88 -5,16,25,4.21 -1,16,25,1.96 -50,16,50,30.42 -35,16,50,21.75 -15,16,50,10.08 +50,16,25,29.54 +35,16,25,21.17 +15,16,25,9.75 +5,16,25,4.17 +1,16,25,1.92 +50,16,50,30.33 +35,16,50,21.71 +15,16,50,10.0 5,16,50,4.25 1,16,50,1.92 -50,16,100,31.79 -35,16,100,22.79 -15,16,100,10.5 -5,16,100,4.5 +50,16,100,32.08 +35,16,100,22.88 +15,16,100,10.58 +5,16,100,4.33 1,16,100,1.92 diff --git a/benchmark/generated_tests/result_error65.cpp.csv b/benchmark/generated_tests/result_error65.cpp.csv index 47d111f..add627a 100644 --- a/benchmark/generated_tests/result_error65.cpp.csv +++ b/benchmark/generated_tests/result_error65.cpp.csv @@ -1,21 +1,21 @@ depth,error_size,destructor_percentage,pulse_us -50,65,0,1177.54 -35,65,0,829.38 -15,65,0,364.38 -5,65,0,132.12 -1,65,0,39.04 -50,65,25,1178.67 -35,65,25,830.0 -15,65,25,365.04 -5,65,25,132.33 -1,65,25,39.17 -50,65,50,1179.08 -35,65,50,830.21 -15,65,50,364.96 -5,65,50,132.21 -1,65,50,39.17 -50,65,100,1181.33 -35,65,100,831.67 -15,65,100,365.42 -5,65,100,132.38 -1,65,100,39.17 +50,65,0,975.12 +35,65,0,686.04 +15,65,0,300.21 +5,65,0,107.5 +1,65,0,30.29 +50,65,25,976.08 +35,65,25,686.75 +15,65,25,300.92 +5,65,25,107.75 +1,65,25,30.42 +50,65,50,976.58 +35,65,50,687.04 +15,65,50,300.75 +5,65,50,107.67 +1,65,50,30.42 +50,65,100,978.38 +35,65,100,688.21 +15,65,100,301.42 +5,65,100,107.83 +1,65,100,30.42 diff --git a/include/libhal-exceptions/control.hpp b/include/libhal-exceptions/control.hpp index 58be520..98eb84e 100644 --- a/include/libhal-exceptions/control.hpp +++ b/include/libhal-exceptions/control.hpp @@ -14,11 +14,8 @@ #pragma once -#include -#include #include #include -#include namespace hal { /** From 53a9ea83ad728fa01262088bdd9042feec9cd4cc Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Tue, 2 Sep 2025 15:59:47 -0700 Subject: [PATCH 2/3] Add catch_all to type_info list --- benchmark/conanfile.py | 2 +- .../generated_tests/estell_except.cpp.csv | 118 ++++++++--------- benchmark/generated_tests/except.cpp.csv | 86 ++++++------- benchmark/generated_tests/gcc_except_fast.csv | 104 +++++++-------- benchmark/generated_tests/nearpoint.cpp.csv | 120 +++++++++--------- .../generated_tests/result_error04.cpp.csv | 20 +-- .../generated_tests/result_error16.cpp.csv | 16 +-- .../generated_tests/result_error65.cpp.csv | 30 ++--- benchmark/nearpoint.cpp | 40 +++--- benchmark/test_nearpoint.csv | 2 + src/arm_cortex/estell/exception.cpp | 18 +-- src/arm_cortex/estell/internal.hpp | 19 ++- 12 files changed, 292 insertions(+), 283 deletions(-) create mode 100644 benchmark/test_nearpoint.csv diff --git a/benchmark/conanfile.py b/benchmark/conanfile.py index cfeea49..f047bba 100644 --- a/benchmark/conanfile.py +++ b/benchmark/conanfile.py @@ -65,4 +65,4 @@ def requirements(self): bootstrap = self.python_requires["libhal-bootstrap"] bootstrap.module.add_demo_requirements(self) if self.options.platform != "mac": - self.requires("libhal-exceptions/1.4.1") + self.requires("libhal-exceptions/1.4.2") diff --git a/benchmark/generated_tests/estell_except.cpp.csv b/benchmark/generated_tests/estell_except.cpp.csv index 03f8cab..b3521bf 100644 --- a/benchmark/generated_tests/estell_except.cpp.csv +++ b/benchmark/generated_tests/estell_except.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,340.83 -35,4,0,244.38 -15,4,0,116.75 -5,4,0,51.79 -1,4,0,26.21 -50,4,25,430.96 -35,4,25,307.67 -15,4,25,145.12 -5,4,25,66.67 -1,4,25,33.96 -50,4,50,513.67 -35,4,50,369.12 -15,4,50,172.08 -5,4,50,74.0 -1,4,50,33.96 -50,4,100,684.96 -35,4,100,485.83 -15,4,100,219.83 -5,4,100,87.33 -1,4,100,34.0 -50,16,0,340.88 -35,16,0,244.38 -15,16,0,116.75 -5,16,0,51.79 -1,16,0,26.17 -50,16,25,431.0 -35,16,25,308.08 -15,16,25,145.17 -5,16,25,66.33 -1,16,25,34.04 -50,16,50,513.67 -35,16,50,369.17 -15,16,50,172.12 -5,16,50,74.0 -1,16,50,34.04 +50,4,0,341.71 +35,4,0,245.17 +15,4,0,117.54 +5,4,0,52.5 +1,4,0,26.96 +50,4,25,431.54 +35,4,25,308.33 +15,4,25,145.79 +5,4,25,67.38 +1,4,25,34.67 +50,4,50,513.96 +35,4,50,369.58 +15,4,50,172.75 +5,4,50,74.62 +1,4,50,34.67 +50,4,100,684.92 +35,4,100,486.08 +15,4,100,220.29 +5,4,100,88.0 +1,4,100,34.67 +50,16,0,341.62 +35,16,0,245.12 +15,16,0,117.5 +5,16,0,52.5 +1,16,0,26.88 +50,16,25,431.58 +35,16,25,308.71 +15,16,25,145.83 +5,16,25,67.04 +1,16,25,34.71 +50,16,50,514.04 +35,16,50,369.62 +15,16,50,172.75 +5,16,50,74.75 +1,16,50,34.71 50,16,100,684.96 -35,16,100,485.92 -15,16,100,219.83 -5,16,100,87.38 -1,16,100,34.0 -50,65,0,356.46 -35,65,0,259.96 -15,65,0,132.33 -5,65,0,67.38 -1,65,0,41.79 -50,65,25,446.92 -35,65,25,323.67 -15,65,25,160.29 -5,65,25,81.83 -1,65,25,49.54 -50,65,50,529.25 -35,65,50,384.67 -15,65,50,187.71 -5,65,50,89.54 -1,65,50,49.5 -50,65,100,700.42 -35,65,100,501.42 -15,65,100,235.33 -5,65,100,102.92 -1,65,100,49.54 +35,16,100,486.12 +15,16,100,220.33 +5,16,100,88.04 +1,16,100,34.71 +50,65,0,352.12 +35,65,0,255.67 +15,65,0,128.0 +5,65,0,62.96 +1,65,0,37.38 +50,65,25,442.46 +35,65,25,319.08 +15,65,25,155.88 +5,65,25,77.42 +1,65,25,45.12 +50,65,50,524.5 +35,65,50,380.08 +15,65,50,183.21 +5,65,50,85.08 +1,65,50,45.12 +50,65,100,695.38 +35,65,100,496.58 +15,65,100,230.75 +5,65,100,98.46 +1,65,100,45.12 diff --git a/benchmark/generated_tests/except.cpp.csv b/benchmark/generated_tests/except.cpp.csv index 979a03c..08cc934 100644 --- a/benchmark/generated_tests/except.cpp.csv +++ b/benchmark/generated_tests/except.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,2310.0 +50,4,0,2309.83 35,4,0,1659.38 -15,4,0,777.83 -5,4,0,335.12 -1,4,0,170.92 -50,4,25,2546.42 -35,4,25,1808.46 -15,4,25,832.71 +15,4,0,777.92 +5,4,0,335.17 +1,4,0,170.88 +50,4,25,2546.46 +35,4,25,1808.58 +15,4,25,832.75 5,4,25,391.0 -1,4,25,194.42 -50,4,50,2867.29 -35,4,50,2056.71 +1,4,25,194.38 +50,4,50,2867.42 +35,4,50,2056.79 15,4,50,956.12 -5,4,50,415.17 -1,4,50,194.38 -50,4,100,3384.58 -35,4,100,2410.67 -15,4,100,1099.58 +5,4,50,415.21 +1,4,50,194.42 +50,4,100,3384.71 +35,4,100,2410.83 +15,4,100,1099.62 5,4,100,456.04 -1,4,100,194.38 -50,16,0,2311.92 -35,16,0,1663.38 -15,16,0,776.17 -5,16,0,333.38 +1,4,100,194.42 +50,16,0,2312.29 +35,16,0,1663.46 +15,16,0,776.21 +5,16,0,333.42 1,16,0,169.29 -50,16,25,2544.58 -35,16,25,1806.71 -15,16,25,824.67 -5,16,25,393.21 +50,16,25,2544.75 +35,16,25,1806.62 +15,16,25,824.54 +5,16,25,393.25 1,16,25,196.54 -50,16,50,2869.25 -35,16,50,2050.62 -15,16,50,961.75 -5,16,50,417.42 +50,16,50,2869.38 +35,16,50,2050.54 +15,16,50,961.79 +5,16,50,417.46 1,16,50,196.54 -50,16,100,3390.25 -35,16,100,2409.25 +50,16,100,3390.17 +35,16,100,2409.04 15,16,100,1101.92 -5,16,100,450.17 -1,16,100,196.54 -50,65,0,2319.67 +5,16,100,450.12 +1,16,100,196.5 +50,65,0,2319.33 35,65,0,1677.17 -15,65,0,793.88 +15,65,0,793.83 5,65,0,351.08 -1,65,0,186.88 -50,65,25,2562.62 -35,65,25,1824.62 -15,65,25,845.67 +1,65,0,186.83 +50,65,25,2562.33 +35,65,25,1824.42 +15,65,25,845.58 5,65,25,410.79 1,65,25,214.25 -50,65,50,2887.25 +50,65,50,2887.04 35,65,50,2070.12 15,65,50,975.58 5,65,50,435.08 1,65,50,214.25 -50,65,100,3404.25 -35,65,100,2426.88 -15,65,100,1109.25 -5,65,100,469.46 +50,65,100,3404.08 +35,65,100,2426.71 +15,65,100,1109.12 +5,65,100,469.42 1,65,100,214.25 diff --git a/benchmark/generated_tests/gcc_except_fast.csv b/benchmark/generated_tests/gcc_except_fast.csv index d209d50..080ce7c 100644 --- a/benchmark/generated_tests/gcc_except_fast.csv +++ b/benchmark/generated_tests/gcc_except_fast.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,1645.83 -35,4,0,1193.75 -15,4,0,563.96 -5,4,0,260.33 +50,4,0,1646.21 +35,4,0,1194.0 +15,4,0,564.17 +5,4,0,260.38 1,4,0,139.75 -50,4,25,1924.5 -35,4,25,1373.33 -15,4,25,658.0 -5,4,25,314.29 -1,4,25,161.38 -50,4,50,2204.0 -35,4,50,1576.33 -15,4,50,742.5 -5,4,50,330.62 +50,4,25,1924.88 +35,4,25,1373.67 +15,4,25,658.12 +5,4,25,314.38 +1,4,25,161.42 +50,4,50,2204.5 +35,4,50,1576.58 +15,4,50,742.58 +5,4,50,330.71 1,4,50,161.42 -50,4,100,2731.5 -35,4,100,1946.25 -15,4,100,890.0 -5,4,100,372.0 -1,4,100,161.33 -50,16,0,1637.92 -35,16,0,1192.21 -15,16,0,566.12 +50,4,100,2731.96 +35,4,100,1946.71 +15,4,100,890.17 +5,4,100,372.04 +1,4,100,161.42 +50,16,0,1638.17 +35,16,0,1192.38 +15,16,0,566.25 5,16,0,262.46 1,16,0,141.96 -50,16,25,1926.67 -35,16,25,1375.58 -15,16,25,663.67 -5,16,25,316.54 -1,16,25,163.5 -50,16,50,2206.17 -35,16,50,1580.17 -15,16,50,740.96 -5,16,50,332.88 -1,16,50,163.5 -50,16,100,2736.96 -35,16,100,1944.67 -15,16,100,892.21 -5,16,100,366.08 -1,16,100,163.54 -50,65,0,1653.75 -35,65,0,1204.75 -15,65,0,578.79 +50,16,25,1927.12 +35,16,25,1375.79 +15,16,25,663.75 +5,16,25,316.67 +1,16,25,163.54 +50,16,50,2206.5 +35,16,50,1580.46 +15,16,50,741.08 +5,16,50,332.96 +1,16,50,163.54 +50,16,100,2737.5 +35,16,100,1944.96 +15,16,100,892.46 +5,16,100,366.12 +1,16,100,163.5 +50,65,0,1654.0 +35,65,0,1204.83 +15,65,0,578.88 5,65,0,275.04 1,65,0,154.46 -50,65,25,1933.46 -35,65,25,1388.25 -15,65,25,672.33 -5,65,25,310.08 -1,65,25,176.08 -50,65,50,2210.62 -35,65,50,1588.88 -15,65,50,753.42 +50,65,25,1933.67 +35,65,25,1388.42 +15,65,25,672.42 +5,65,25,310.12 +1,65,25,176.12 +50,65,50,2211.12 +35,65,50,1589.29 +15,65,50,753.5 5,65,50,345.42 1,65,50,176.17 -50,65,100,2745.83 -35,65,100,1957.33 -15,65,100,894.33 -5,65,100,380.25 -1,65,100,176.17 +50,65,100,2746.21 +35,65,100,1957.63 +15,65,100,894.54 +5,65,100,380.29 +1,65,100,176.12 diff --git a/benchmark/generated_tests/nearpoint.cpp.csv b/benchmark/generated_tests/nearpoint.cpp.csv index ed935d7..3d8dbb5 100644 --- a/benchmark/generated_tests/nearpoint.cpp.csv +++ b/benchmark/generated_tests/nearpoint.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,199.67 -35,4,0,142.33 -15,4,0,73.46 -5,4,0,38.88 -1,4,0,23.71 -50,4,25,300.12 -35,4,25,215.04 -15,4,25,109.12 -5,4,25,54.25 -1,4,25,29.04 -50,4,50,431.12 -35,4,50,317.96 -15,4,50,151.83 -5,4,50,66.88 -1,4,50,29.04 -50,4,100,709.29 -35,4,100,504.33 -15,4,100,224.83 -5,4,100,86.92 -1,4,100,29.04 -50,16,0,199.29 -35,16,0,143.92 -15,16,0,73.0 -5,16,0,38.38 -1,16,0,25.04 -50,16,25,299.79 -35,16,25,214.88 -15,16,25,110.12 -5,16,25,56.12 -1,16,25,32.21 -50,16,50,430.88 -35,16,50,317.71 -15,16,50,151.58 -5,16,50,66.83 -1,16,50,32.21 -50,16,100,709.17 -35,16,100,504.25 -15,16,100,224.96 -5,16,100,87.04 -1,16,100,32.25 -50,65,0,209.92 -35,65,0,154.71 -15,65,0,83.79 -5,65,0,49.25 -1,65,0,35.83 -50,65,25,310.5 -35,65,25,225.54 -15,65,25,120.83 -5,65,25,67.08 -1,65,25,43.12 -50,65,50,441.75 -35,65,50,328.62 -15,65,50,162.5 -5,65,50,77.54 -1,65,50,43.17 -50,65,100,719.96 -35,65,100,515.04 -15,65,100,234.17 -5,65,100,96.96 -1,65,100,43.12 +50,4,0,200.88 +35,4,0,143.54 +15,4,0,74.79 +5,4,0,40.04 +1,4,0,25.04 +50,4,25,305.58 +35,4,25,219.21 +15,4,25,111.38 +5,4,25,55.83 +1,4,25,30.25 +50,4,50,440.46 +35,4,50,325.04 +15,4,50,155.46 +5,4,50,68.92 +1,4,50,30.25 +50,4,100,725.83 +35,4,100,515.75 +15,4,100,230.42 +5,4,100,89.5 +1,4,100,30.25 +50,16,0,200.5 +35,16,0,145.04 +15,16,0,74.38 +5,16,0,39.62 +1,16,0,26.12 +50,16,25,305.29 +35,16,25,219.0 +15,16,25,112.42 +5,16,25,57.71 +1,16,25,33.38 +50,16,50,440.21 +35,16,50,324.75 +15,16,50,155.21 +5,16,50,68.83 +1,16,50,33.38 +50,16,100,725.67 +35,16,100,515.62 +15,16,100,230.38 +5,16,100,89.46 +1,16,100,33.38 +50,65,0,216.42 +35,65,0,160.96 +15,65,0,90.29 +5,65,0,55.54 +1,65,0,42.04 +50,65,25,321.08 +35,65,25,234.79 +15,65,25,128.21 +5,65,25,73.75 +1,65,25,49.42 +50,65,50,456.17 +35,65,50,340.75 +15,65,50,171.21 +5,65,50,84.67 +1,65,50,49.42 +50,65,100,741.5 +35,65,100,531.71 +15,65,100,244.67 +5,65,100,104.67 +1,65,100,49.42 diff --git a/benchmark/generated_tests/result_error04.cpp.csv b/benchmark/generated_tests/result_error04.cpp.csv index 55e1946..ecdaa57 100644 --- a/benchmark/generated_tests/result_error04.cpp.csv +++ b/benchmark/generated_tests/result_error04.cpp.csv @@ -1,21 +1,21 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,16.29 -35,4,0,11.71 -15,4,0,5.71 +50,4,0,16.25 +35,4,0,11.75 +15,4,0,5.75 5,4,0,2.71 1,4,0,1.5 50,4,25,17.29 -35,4,25,12.46 +35,4,25,12.42 15,4,25,6.08 -5,4,25,2.83 +5,4,25,2.88 1,4,25,1.58 50,4,50,18.38 35,4,50,13.29 15,4,50,6.33 -5,4,50,2.88 +5,4,50,2.92 1,4,50,1.54 -50,4,100,20.25 -35,4,100,14.62 -15,4,100,6.88 +50,4,100,20.29 +35,4,100,14.58 +15,4,100,6.92 5,4,100,3.12 -1,4,100,1.58 +1,4,100,1.54 diff --git a/benchmark/generated_tests/result_error16.cpp.csv b/benchmark/generated_tests/result_error16.cpp.csv index 7ed27c8..c27382f 100644 --- a/benchmark/generated_tests/result_error16.cpp.csv +++ b/benchmark/generated_tests/result_error16.cpp.csv @@ -1,20 +1,20 @@ depth,error_size,destructor_percentage,pulse_us 50,16,0,28.79 -35,16,0,20.58 +35,16,0,20.62 15,16,0,9.58 -5,16,0,3.96 +5,16,0,4.0 1,16,0,1.79 -50,16,25,29.54 -35,16,25,21.17 -15,16,25,9.75 +50,16,25,29.58 +35,16,25,21.21 +15,16,25,9.79 5,16,25,4.17 1,16,25,1.92 -50,16,50,30.33 +50,16,50,30.38 35,16,50,21.71 -15,16,50,10.0 +15,16,50,10.04 5,16,50,4.25 1,16,50,1.92 -50,16,100,32.08 +50,16,100,32.12 35,16,100,22.88 15,16,100,10.58 5,16,100,4.33 diff --git a/benchmark/generated_tests/result_error65.cpp.csv b/benchmark/generated_tests/result_error65.cpp.csv index add627a..57c5118 100644 --- a/benchmark/generated_tests/result_error65.cpp.csv +++ b/benchmark/generated_tests/result_error65.cpp.csv @@ -1,21 +1,21 @@ depth,error_size,destructor_percentage,pulse_us -50,65,0,975.12 -35,65,0,686.04 -15,65,0,300.21 -5,65,0,107.5 -1,65,0,30.29 -50,65,25,976.08 -35,65,25,686.75 -15,65,25,300.92 +50,65,0,975.38 +35,65,0,686.25 +15,65,0,300.33 +5,65,0,107.54 +1,65,0,30.33 +50,65,25,976.38 +35,65,25,686.96 +15,65,25,301.0 5,65,25,107.75 1,65,25,30.42 -50,65,50,976.58 -35,65,50,687.04 -15,65,50,300.75 +50,65,50,976.88 +35,65,50,687.17 +15,65,50,300.88 5,65,50,107.67 1,65,50,30.42 -50,65,100,978.38 -35,65,100,688.21 -15,65,100,301.42 -5,65,100,107.83 +50,65,100,978.71 +35,65,100,688.46 +15,65,100,301.46 +5,65,100,107.88 1,65,100,30.42 diff --git a/benchmark/nearpoint.cpp b/benchmark/nearpoint.cpp index 4c573f9..4e72e35 100644 --- a/benchmark/nearpoint.cpp +++ b/benchmark/nearpoint.cpp @@ -12,28 +12,28 @@ std::array const _near_point_descriptor_data = { }; std::array const _normal_table_data = { - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (1 << 11) | 1, // Block(start=1, count=1) - (1 << 11) | 1, // Block(start=1, count=1) - (2 << 11) | 2, // Block(start=2, count=2) - (3 << 11) | 3, // Block(start=3, count=3) - (5 << 11) | 3, // Block(start=5, count=3) - (7 << 11) | 6, // Block(start=7, count=6) - (12 << 11) | 14, // Block(start=12, count=14) - (25 << 11) | 20, // Block(start=25, count=20) - (44 << 11) | 27, // Block(start=44, count=27) - (70 << 11) | 28, // Block(start=70, count=28) - (97 << 11) | 32, // Block(start=97, count=32) - (128 << 11) | 26, // Block(start=128, count=26) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (1 << 11) | 1, // Block(start=1, count=1) + (1 << 11) | 1, // Block(start=1, count=1) + (2 << 11) | 2, // Block(start=2, count=2) + (3 << 11) | 3, // Block(start=3, count=3) + (5 << 11) | 3, // Block(start=5, count=3) + (7 << 11) | 6, // Block(start=7, count=6) + (12 << 11) | 14, // Block(start=12, count=14) + (25 << 11) | 20, // Block(start=25, count=20) + (44 << 11) | 27, // Block(start=44, count=27) + (70 << 11) | 28, // Block(start=70, count=28) + (97 << 11) | 32, // Block(start=97, count=32) + (128 << 11) | 26, // Block(start=128, count=26) }; - } // namespace -std::span near_point_descriptor = _near_point_descriptor_data; +std::span near_point_descriptor = + _near_point_descriptor_data; std::span normal_table = _normal_table_data; } // namespace ke::__except_abi::inline v1 diff --git a/benchmark/test_nearpoint.csv b/benchmark/test_nearpoint.csv new file mode 100644 index 0000000..b473e44 --- /dev/null +++ b/benchmark/test_nearpoint.csv @@ -0,0 +1,2 @@ +executable,pulse_order +build/stm32f103c8/estell/Release/nearpoint.cpp.elf.bin,generated_tests/nearpoint.cpp.csv diff --git a/src/arm_cortex/estell/exception.cpp b/src/arm_cortex/estell/exception.cpp index 38f4461..b64eeda 100644 --- a/src/arm_cortex/estell/exception.cpp +++ b/src/arm_cortex/estell/exception.cpp @@ -637,7 +637,7 @@ class action_decoder to_absolute_address(p_type_info_address)); } - static std::type_info const* install_context_type() + static std::type_info const* catch_all() { return reinterpret_cast(0xFFFF'FFFF); } @@ -653,7 +653,7 @@ class action_decoder auto const* current_type = &type_table[-m_filter]; if (*current_type == nullptr) { - return install_context_type(); + return catch_all(); } auto const* test = @@ -683,7 +683,7 @@ class action_decoder } while (m_filter < 0); if (m_filter == 0) { - return install_context_type(); + return catch_all(); } return get_current_type_info_from_filter(); @@ -783,14 +783,12 @@ inline void enter_function(exception_control_block& p_exception_object) catch_type != nullptr; catch_type = a_decoder.get_next_catch_type()) { - // This is our dynamic cast :P auto position = std::ranges::find_if( p_exception_object.type_info, [&catch_type](auto const& element) { return element.type_info == catch_type; }); - if (position == p_exception_object.type_info.end() && - catch_type != action_decoder::install_context_type()) { + if (position == p_exception_object.type_info.end()) { continue; } @@ -2042,9 +2040,13 @@ void flatten_rtti(exception_ptr p_thrown_exception, flattened_hierarchy& p_map, std::type_info const* p_type_info) { + // OPTIMIZATION: Add `catch_all` to list of allowed types so we don't need a + // separate branch in `enter_function()`. + p_map.push_back({ .type_info = action_decoder::catch_all(), .offset = 0 }); // Add first element to the list p_map.push_back({ .type_info = p_type_info, .offset = 0 }); - auto iter = p_map.begin(); + // Skip the catch all type + auto iter = p_map.begin() + 1; auto info = get_rtti_type(p_type_info); // If this is a non-class type, then there is no hierarchy and the first @@ -2053,7 +2055,7 @@ void flatten_rtti(exception_ptr p_thrown_exception, return; } - for (; iter != p_map.begin() + p_map.size; iter++) { + for (; iter != p_map.begin() + p_map.size(); iter++) { info = get_rtti_type(iter->type_info); if (info == rtti_type::class_type) { diff --git a/src/arm_cortex/estell/internal.hpp b/src/arm_cortex/estell/internal.hpp index 294c653..813d0d8 100644 --- a/src/arm_cortex/estell/internal.hpp +++ b/src/arm_cortex/estell/internal.hpp @@ -314,13 +314,13 @@ struct flattened_hierarchy static constexpr auto capacity = max_count; std::array bases{}; - std::uint32_t size = 0; + std::uint32_t m_size = 0; explicit constexpr flattened_hierarchy(std::type_info const* p_info) { bases[0].type_info = p_info; bases[0].offset = 0; - size++; + m_size++; } flattened_hierarchy() = default; @@ -332,7 +332,7 @@ struct flattened_hierarchy [[nodiscard]] constexpr auto end() { - return bases.begin() + size; + return bases.begin() + m_size; } [[nodiscard]] constexpr auto cbegin() const @@ -342,15 +342,15 @@ struct flattened_hierarchy [[nodiscard]] constexpr auto cend() const { - return bases.cbegin() + size; + return bases.cbegin() + m_size; } constexpr void push_back(base_class_type_info const& p_info) { - if (size > max_count) { + if (m_size > max_count) { std::terminate(); } - bases[size++] = p_info; + bases[m_size++] = p_info; } using iter = decltype(bases.end()); @@ -365,9 +365,14 @@ struct flattened_hierarchy return bases.end(); } + constexpr auto size() + { + return m_size; + } + constexpr void reset() { - size = 0; + m_size = 0; } }; From 2a39c88e50ad1ec9070b4e4a5a3062b5a36ba371 Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Tue, 2 Sep 2025 16:09:37 -0700 Subject: [PATCH 3/3] Cleaner and faster implementation --- .../generated_tests/estell_except.cpp.csv | 120 +++---- benchmark/generated_tests/except.cpp.csv | 118 +++---- benchmark/generated_tests/gcc_except_fast.csv | 114 +++---- benchmark/generated_tests/nearpoint.cpp.csv | 120 +++---- .../generated_tests/result_error04.cpp.csv | 16 +- .../generated_tests/result_error16.cpp.csv | 10 +- .../generated_tests/result_error65.cpp.csv | 22 +- benchmark/nearpoint.cpp | 40 +-- benchmark/order.ld | 7 +- benchmark/table_graph.csv | 307 +++++++++--------- src/arm_cortex/estell/exception.cpp | 40 +-- 11 files changed, 456 insertions(+), 458 deletions(-) diff --git a/benchmark/generated_tests/estell_except.cpp.csv b/benchmark/generated_tests/estell_except.cpp.csv index b3521bf..d54ab5c 100644 --- a/benchmark/generated_tests/estell_except.cpp.csv +++ b/benchmark/generated_tests/estell_except.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,341.71 -35,4,0,245.17 -15,4,0,117.54 -5,4,0,52.5 -1,4,0,26.96 -50,4,25,431.54 -35,4,25,308.33 -15,4,25,145.79 -5,4,25,67.38 -1,4,25,34.67 -50,4,50,513.96 -35,4,50,369.58 -15,4,50,172.75 -5,4,50,74.62 -1,4,50,34.67 -50,4,100,684.92 -35,4,100,486.08 -15,4,100,220.29 -5,4,100,88.0 -1,4,100,34.67 -50,16,0,341.62 -35,16,0,245.12 -15,16,0,117.5 -5,16,0,52.5 -1,16,0,26.88 -50,16,25,431.58 -35,16,25,308.71 -15,16,25,145.83 -5,16,25,67.04 -1,16,25,34.71 -50,16,50,514.04 -35,16,50,369.62 -15,16,50,172.75 -5,16,50,74.75 -1,16,50,34.71 -50,16,100,684.96 -35,16,100,486.12 -15,16,100,220.33 -5,16,100,88.04 -1,16,100,34.71 -50,65,0,352.12 -35,65,0,255.67 -15,65,0,128.0 -5,65,0,62.96 -1,65,0,37.38 -50,65,25,442.46 -35,65,25,319.08 -15,65,25,155.88 -5,65,25,77.42 -1,65,25,45.12 -50,65,50,524.5 -35,65,50,380.08 -15,65,50,183.21 -5,65,50,85.08 -1,65,50,45.12 -50,65,100,695.38 -35,65,100,496.58 -15,65,100,230.75 -5,65,100,98.46 -1,65,100,45.12 +50,4,0,341.33 +35,4,0,244.79 +15,4,0,117.21 +5,4,0,52.12 +1,4,0,26.54 +50,4,25,429.54 +35,4,25,306.83 +15,4,25,144.96 +5,4,25,66.79 +1,4,25,34.25 +50,4,50,510.33 +35,4,50,366.88 +15,4,50,171.33 +5,4,50,73.96 +1,4,50,34.25 +50,4,100,677.79 +35,4,100,480.96 +15,4,100,217.92 +5,4,100,86.96 +1,4,100,34.25 +50,16,0,341.33 +35,16,0,244.83 +15,16,0,117.12 +5,16,0,52.17 +1,16,0,26.58 +50,16,25,429.5 +35,16,25,307.21 +15,16,25,144.96 +5,16,25,66.42 +1,16,25,34.29 +50,16,50,510.33 +35,16,50,366.88 +15,16,50,171.38 +5,16,50,74.0 +1,16,50,34.25 +50,16,100,677.75 +35,16,100,481.0 +15,16,100,217.92 +5,16,100,87.04 +1,16,100,34.25 +50,65,0,357.0 +35,65,0,260.42 +15,65,0,132.75 +5,65,0,67.75 +1,65,0,42.17 +50,65,25,445.5 +35,65,25,322.75 +15,65,25,160.12 +5,65,25,81.96 +1,65,25,49.75 +50,65,50,525.88 +35,65,50,382.38 +15,65,50,186.88 +5,65,50,89.5 +1,65,50,49.75 +50,65,100,693.33 +35,65,100,496.54 +15,65,100,233.46 +5,65,100,102.5 +1,65,100,49.79 diff --git a/benchmark/generated_tests/except.cpp.csv b/benchmark/generated_tests/except.cpp.csv index 08cc934..064bcff 100644 --- a/benchmark/generated_tests/except.cpp.csv +++ b/benchmark/generated_tests/except.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,2309.83 -35,4,0,1659.38 -15,4,0,777.92 -5,4,0,335.17 -1,4,0,170.88 -50,4,25,2546.46 -35,4,25,1808.58 -15,4,25,832.75 -5,4,25,391.0 -1,4,25,194.38 -50,4,50,2867.42 -35,4,50,2056.79 -15,4,50,956.12 -5,4,50,415.21 -1,4,50,194.42 -50,4,100,3384.71 -35,4,100,2410.83 -15,4,100,1099.62 -5,4,100,456.04 -1,4,100,194.42 -50,16,0,2312.29 -35,16,0,1663.46 -15,16,0,776.21 -5,16,0,333.42 -1,16,0,169.29 -50,16,25,2544.75 -35,16,25,1806.62 -15,16,25,824.54 -5,16,25,393.25 -1,16,25,196.54 -50,16,50,2869.38 -35,16,50,2050.54 -15,16,50,961.79 -5,16,50,417.46 +50,4,0,2310.83 +35,4,0,1660.04 +15,4,0,778.21 +5,4,0,335.29 +1,4,0,170.96 +50,4,25,2547.5 +35,4,25,1809.08 +15,4,25,833.04 +5,4,25,391.12 +1,4,25,194.46 +50,4,50,2868.46 +35,4,50,2057.5 +15,4,50,956.62 +5,4,50,415.38 +1,4,50,194.5 +50,4,100,3386.04 +35,4,100,2411.58 +15,4,100,1100.08 +5,4,100,456.25 +1,4,100,194.46 +50,16,0,2313.04 +35,16,0,1664.12 +15,16,0,776.46 +5,16,0,333.5 +1,16,0,169.33 +50,16,25,2545.67 +35,16,25,1807.42 +15,16,25,824.96 +5,16,25,393.38 +1,16,25,196.58 +50,16,50,2870.5 +35,16,50,2051.46 +15,16,50,962.21 +5,16,50,417.62 1,16,50,196.54 -50,16,100,3390.17 -35,16,100,2409.04 -15,16,100,1101.92 -5,16,100,450.12 -1,16,100,196.5 -50,65,0,2319.33 -35,65,0,1677.17 -15,65,0,793.83 -5,65,0,351.08 -1,65,0,186.83 -50,65,25,2562.33 -35,65,25,1824.42 -15,65,25,845.58 -5,65,25,410.79 -1,65,25,214.25 -50,65,50,2887.04 -35,65,50,2070.12 -15,65,50,975.58 -5,65,50,435.08 -1,65,50,214.25 -50,65,100,3404.08 -35,65,100,2426.71 -15,65,100,1109.12 -5,65,100,469.42 -1,65,100,214.25 +50,16,100,3391.33 +35,16,100,2409.79 +15,16,100,1102.25 +5,16,100,450.21 +1,16,100,196.58 +50,65,0,2320.0 +35,65,0,1677.62 +15,65,0,794.08 +5,65,0,351.17 +1,65,0,186.88 +50,65,25,2563.29 +35,65,25,1824.96 +15,65,25,845.88 +5,65,25,410.96 +1,65,25,214.33 +50,65,50,2887.88 +35,65,50,2070.71 +15,65,50,975.75 +5,65,50,435.21 +1,65,50,214.29 +50,65,100,3405.0 +35,65,100,2427.42 +15,65,100,1109.62 +5,65,100,469.58 +1,65,100,214.29 diff --git a/benchmark/generated_tests/gcc_except_fast.csv b/benchmark/generated_tests/gcc_except_fast.csv index 080ce7c..a148e08 100644 --- a/benchmark/generated_tests/gcc_except_fast.csv +++ b/benchmark/generated_tests/gcc_except_fast.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,1646.21 -35,4,0,1194.0 -15,4,0,564.17 -5,4,0,260.38 -1,4,0,139.75 -50,4,25,1924.88 -35,4,25,1373.67 -15,4,25,658.12 -5,4,25,314.38 -1,4,25,161.42 -50,4,50,2204.5 -35,4,50,1576.58 -15,4,50,742.58 -5,4,50,330.71 -1,4,50,161.42 -50,4,100,2731.96 -35,4,100,1946.71 -15,4,100,890.17 -5,4,100,372.04 -1,4,100,161.42 -50,16,0,1638.17 -35,16,0,1192.38 -15,16,0,566.25 -5,16,0,262.46 +50,4,0,1646.75 +35,4,0,1194.5 +15,4,0,564.46 +5,4,0,260.5 +1,4,0,139.83 +50,4,25,1925.75 +35,4,25,1374.17 +15,4,25,658.38 +5,4,25,314.46 +1,4,25,161.46 +50,4,50,2205.29 +35,4,50,1577.17 +15,4,50,742.88 +5,4,50,330.88 +1,4,50,161.5 +50,4,100,2732.92 +35,4,100,1947.38 +15,4,100,890.5 +5,4,100,372.17 +1,4,100,161.46 +50,16,0,1638.79 +35,16,0,1192.75 +15,16,0,566.42 +5,16,0,262.58 1,16,0,141.96 -50,16,25,1927.12 -35,16,25,1375.79 -15,16,25,663.75 -5,16,25,316.67 -1,16,25,163.54 -50,16,50,2206.5 -35,16,50,1580.46 -15,16,50,741.08 -5,16,50,332.96 +50,16,25,1927.75 +35,16,25,1376.12 +15,16,25,663.88 +5,16,25,316.71 +1,16,25,163.58 +50,16,50,2207.12 +35,16,50,1580.92 +15,16,50,741.25 +5,16,50,333.0 1,16,50,163.54 -50,16,100,2737.5 -35,16,100,1944.96 -15,16,100,892.46 -5,16,100,366.12 -1,16,100,163.5 -50,65,0,1654.0 -35,65,0,1204.83 -15,65,0,578.88 -5,65,0,275.04 +50,16,100,2738.25 +35,16,100,1945.67 +15,16,100,892.62 +5,16,100,366.21 +1,16,100,163.58 +50,65,0,1654.38 +35,65,0,1205.17 +15,65,0,579.04 +5,65,0,275.21 1,65,0,154.46 -50,65,25,1933.67 -35,65,25,1388.42 -15,65,25,672.42 -5,65,25,310.12 -1,65,25,176.12 -50,65,50,2211.12 -35,65,50,1589.29 -15,65,50,753.5 -5,65,50,345.42 -1,65,50,176.17 -50,65,100,2746.21 -35,65,100,1957.63 -15,65,100,894.54 -5,65,100,380.29 -1,65,100,176.12 +50,65,25,1934.42 +35,65,25,1388.75 +15,65,25,672.62 +5,65,25,310.25 +1,65,25,176.25 +50,65,50,2211.58 +35,65,50,1589.71 +15,65,50,753.75 +5,65,50,345.54 +1,65,50,176.21 +50,65,100,2747.08 +35,65,100,1958.29 +15,65,100,894.92 +5,65,100,380.42 +1,65,100,176.25 diff --git a/benchmark/generated_tests/nearpoint.cpp.csv b/benchmark/generated_tests/nearpoint.cpp.csv index 3d8dbb5..5567198 100644 --- a/benchmark/generated_tests/nearpoint.cpp.csv +++ b/benchmark/generated_tests/nearpoint.cpp.csv @@ -1,61 +1,61 @@ depth,error_size,destructor_percentage,pulse_us -50,4,0,200.88 -35,4,0,143.54 -15,4,0,74.79 -5,4,0,40.04 -1,4,0,25.04 -50,4,25,305.58 -35,4,25,219.21 -15,4,25,111.38 -5,4,25,55.83 -1,4,25,30.25 -50,4,50,440.46 -35,4,50,325.04 -15,4,50,155.46 -5,4,50,68.92 -1,4,50,30.25 -50,4,100,725.83 -35,4,100,515.75 -15,4,100,230.42 -5,4,100,89.5 -1,4,100,30.25 -50,16,0,200.5 -35,16,0,145.04 -15,16,0,74.38 -5,16,0,39.62 -1,16,0,26.12 -50,16,25,305.29 -35,16,25,219.0 -15,16,25,112.42 -5,16,25,57.71 -1,16,25,33.38 -50,16,50,440.21 -35,16,50,324.75 -15,16,50,155.21 -5,16,50,68.83 -1,16,50,33.38 -50,16,100,725.67 -35,16,100,515.62 -15,16,100,230.38 -5,16,100,89.46 -1,16,100,33.38 -50,65,0,216.42 -35,65,0,160.96 -15,65,0,90.29 -5,65,0,55.54 -1,65,0,42.04 -50,65,25,321.08 -35,65,25,234.79 -15,65,25,128.21 -5,65,25,73.75 -1,65,25,49.42 -50,65,50,456.17 -35,65,50,340.75 -15,65,50,171.21 -5,65,50,84.67 -1,65,50,49.42 -50,65,100,741.5 -35,65,100,531.71 -15,65,100,244.67 -5,65,100,104.67 -1,65,100,49.42 +50,4,0,199.33 +35,4,0,142.0 +15,4,0,73.62 +5,4,0,39.12 +1,4,0,24.04 +50,4,25,299.08 +35,4,25,214.79 +15,4,25,109.25 +5,4,25,54.42 +1,4,25,29.25 +50,4,50,430.62 +35,4,50,317.67 +15,4,50,151.62 +5,4,50,66.96 +1,4,50,29.21 +50,4,100,706.67 +35,4,100,502.63 +15,4,100,224.46 +5,4,100,86.92 +1,4,100,29.25 +50,16,0,198.92 +35,16,0,143.46 +15,16,0,73.21 +5,16,0,38.67 +1,16,0,25.33 +50,16,25,298.75 +35,16,25,214.54 +15,16,25,110.04 +5,16,25,56.33 +1,16,25,32.46 +50,16,50,430.33 +35,16,50,317.38 +15,16,50,151.58 +5,16,50,67.12 +1,16,50,32.46 +50,16,100,706.79 +35,16,100,502.75 +15,16,100,224.62 +5,16,100,87.29 +1,16,100,32.46 +50,65,0,214.79 +35,65,0,159.42 +15,65,0,89.08 +5,65,0,54.62 +1,65,0,41.29 +50,65,25,314.62 +35,65,25,230.62 +15,65,25,126.12 +5,65,25,72.33 +1,65,25,48.5 +50,65,50,446.38 +35,65,50,333.46 +15,65,50,167.62 +5,65,50,82.96 +1,65,50,48.54 +50,65,100,722.83 +35,65,100,518.75 +15,65,100,238.92 +5,65,100,102.08 +1,65,100,48.46 diff --git a/benchmark/generated_tests/result_error04.cpp.csv b/benchmark/generated_tests/result_error04.cpp.csv index ecdaa57..2be0227 100644 --- a/benchmark/generated_tests/result_error04.cpp.csv +++ b/benchmark/generated_tests/result_error04.cpp.csv @@ -1,21 +1,21 @@ depth,error_size,destructor_percentage,pulse_us 50,4,0,16.25 -35,4,0,11.75 +35,4,0,11.71 15,4,0,5.75 5,4,0,2.71 1,4,0,1.5 50,4,25,17.29 -35,4,25,12.42 +35,4,25,12.46 15,4,25,6.08 5,4,25,2.88 -1,4,25,1.58 +1,4,25,1.54 50,4,50,18.38 35,4,50,13.29 15,4,50,6.33 5,4,50,2.92 -1,4,50,1.54 -50,4,100,20.29 -35,4,100,14.58 -15,4,100,6.92 +1,4,50,1.58 +50,4,100,20.25 +35,4,100,14.62 +15,4,100,6.88 5,4,100,3.12 -1,4,100,1.54 +1,4,100,1.58 diff --git a/benchmark/generated_tests/result_error16.cpp.csv b/benchmark/generated_tests/result_error16.cpp.csv index c27382f..f347ff0 100644 --- a/benchmark/generated_tests/result_error16.cpp.csv +++ b/benchmark/generated_tests/result_error16.cpp.csv @@ -1,8 +1,8 @@ depth,error_size,destructor_percentage,pulse_us -50,16,0,28.79 +50,16,0,28.83 35,16,0,20.62 15,16,0,9.58 -5,16,0,4.0 +5,16,0,3.96 1,16,0,1.79 50,16,25,29.58 35,16,25,21.21 @@ -10,9 +10,9 @@ depth,error_size,destructor_percentage,pulse_us 5,16,25,4.17 1,16,25,1.92 50,16,50,30.38 -35,16,50,21.71 -15,16,50,10.04 -5,16,50,4.25 +35,16,50,21.75 +15,16,50,10.0 +5,16,50,4.21 1,16,50,1.92 50,16,100,32.12 35,16,100,22.88 diff --git a/benchmark/generated_tests/result_error65.cpp.csv b/benchmark/generated_tests/result_error65.cpp.csv index 57c5118..e0771fb 100644 --- a/benchmark/generated_tests/result_error65.cpp.csv +++ b/benchmark/generated_tests/result_error65.cpp.csv @@ -1,21 +1,21 @@ depth,error_size,destructor_percentage,pulse_us -50,65,0,975.38 -35,65,0,686.25 +50,65,0,975.54 +35,65,0,686.46 15,65,0,300.33 -5,65,0,107.54 -1,65,0,30.33 -50,65,25,976.38 -35,65,25,686.96 +5,65,0,107.58 +1,65,0,30.29 +50,65,25,976.42 +35,65,25,687.0 15,65,25,301.0 5,65,25,107.75 1,65,25,30.42 -50,65,50,976.88 -35,65,50,687.17 +50,65,50,977.0 +35,65,50,687.29 15,65,50,300.88 -5,65,50,107.67 +5,65,50,107.75 1,65,50,30.42 -50,65,100,978.71 +50,65,100,978.87 35,65,100,688.46 15,65,100,301.46 -5,65,100,107.88 +5,65,100,107.92 1,65,100,30.42 diff --git a/benchmark/nearpoint.cpp b/benchmark/nearpoint.cpp index 4e72e35..3c49243 100644 --- a/benchmark/nearpoint.cpp +++ b/benchmark/nearpoint.cpp @@ -12,28 +12,28 @@ std::array const _near_point_descriptor_data = { }; std::array const _normal_table_data = { - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (0 << 11) | 1, // Block(start=0, count=1) - (1 << 11) | 1, // Block(start=1, count=1) - (1 << 11) | 1, // Block(start=1, count=1) - (2 << 11) | 2, // Block(start=2, count=2) - (3 << 11) | 3, // Block(start=3, count=3) - (5 << 11) | 3, // Block(start=5, count=3) - (7 << 11) | 6, // Block(start=7, count=6) - (12 << 11) | 14, // Block(start=12, count=14) - (25 << 11) | 20, // Block(start=25, count=20) - (44 << 11) | 27, // Block(start=44, count=27) - (70 << 11) | 28, // Block(start=70, count=28) - (97 << 11) | 32, // Block(start=97, count=32) - (128 << 11) | 26, // Block(start=128, count=26) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (0 << 11) | 1, // Block(start=0, count=1) + (1 << 11) | 1, // Block(start=1, count=1) + (1 << 11) | 1, // Block(start=1, count=1) + (2 << 11) | 2, // Block(start=2, count=2) + (3 << 11) | 3, // Block(start=3, count=3) + (5 << 11) | 3, // Block(start=5, count=3) + (7 << 11) | 7, // Block(start=7, count=7) + (13 << 11) | 14, // Block(start=13, count=14) + (26 << 11) | 20, // Block(start=26, count=20) + (45 << 11) | 27, // Block(start=45, count=27) + (71 << 11) | 29, // Block(start=71, count=29) + (99 << 11) | 31, // Block(start=99, count=31) + (129 << 11) | 26, // Block(start=129, count=26) }; + } // namespace -std::span near_point_descriptor = - _near_point_descriptor_data; +std::span near_point_descriptor = _near_point_descriptor_data; std::span normal_table = _normal_table_data; } // namespace ke::__except_abi::inline v1 diff --git a/benchmark/order.ld b/benchmark/order.ld index 593948b..21047b6 100644 --- a/benchmark/order.ld +++ b/benchmark/order.ld @@ -256,9 +256,6 @@ SECTIONS { /* Unwind info 0x8001aab0 */ *(.text._ZN3hal7stm32f113configure_pinENS0_10pin_selectENS0_12pin_config_tE) *(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEj) - /* Unwind info 0x8002afb0 */ - *(.text.__wrap___cxa_throw) - *(.text._ZNK10__cxxabiv121__vmi_class_type_info20__do_find_public_srcEiPKvPKNS_17__class_type_infoES2_) /* Unwind info 0x7ffff2c4 */ *(.text._Z20depth_41_percent_050v.isra.0) *(.text._Z20depth_17_percent_025v.isra.0) @@ -269,6 +266,8 @@ SECTIONS { *(.text._ZN3hal5delayERNS_12steady_clockENSt6chrono8durationIxSt5ratioILx1ELx1000000000EEEE.constprop.0) *(.text._ZNK10__cxxabiv120__si_class_type_info11__do_upcastEPKNS_17__class_type_infoEPKvRNS1_15__upcast_resultE) *(.text._ZN9__gnu_cxx15__snprintf_liteEPcjPKcSt9__va_list) + /* Unwind info 0x80b108af */ + *(.text.__wrap___cxa_throw) /* Unwind info 0x8008afb0 */ *(.text._ZNK10__cxxabiv121__vmi_class_type_info11__do_upcastEPKNS_17__class_type_infoEPKvRNS1_15__upcast_resultE) /* Unwind info 0x7ffff2b8 */ @@ -327,6 +326,8 @@ SECTIONS { *(.text._ZNKSt3_V214error_category10_M_messageB5cxx11Ei) /* Unwind info 0x80aab0b0 */ *(.text._ZN3hal7stm32f112gpio_manager6output16driver_configureERKNS_10output_pin8settingsE) + /* Unwind info 0x8002afb0 */ + *(.text._ZNK10__cxxabiv121__vmi_class_type_info20__do_find_public_srcEiPKvPKNS_17__class_type_infoES2_) /* Unwind info 0x7ffff790 */ *(.text._ZNSt11logic_errorC2EPKc) /* Unwind info 0x7ffff034 */ diff --git a/benchmark/table_graph.csv b/benchmark/table_graph.csv index 49a35f3..4ab169d 100644 --- a/benchmark/table_graph.csv +++ b/benchmark/table_graph.csv @@ -1,155 +1,156 @@ entry, address 0, 0 -1, 13396 -2, 17276 -3, 18756 -4, 20108 -5, 21300 -6, 22332 -7, 22908 -8, 23356 -9, 23724 -10, 24064 -11, 24380 -12, 24620 -13, 24820 -14, 25020 -15, 25204 -16, 25360 -17, 25516 -18, 25672 -19, 25828 -20, 25980 -21, 26132 -22, 26284 -23, 26436 -24, 26584 -25, 26732 -26, 26880 -27, 27028 -28, 27168 -29, 27304 -30, 27436 -31, 27564 -32, 27680 -33, 27788 -34, 27880 -35, 27964 -36, 28048 -37, 28132 -38, 28216 -39, 28300 -40, 28384 -41, 28468 -42, 28552 -43, 28632 -44, 28712 -45, 28792 -46, 28872 -47, 28952 -48, 29032 -49, 29112 -50, 29192 -51, 29272 -52, 29352 -53, 29432 -54, 29512 -55, 29592 -56, 29672 -57, 29752 -58, 29832 -59, 29912 -60, 29992 -61, 30068 -62, 30144 -63, 30220 -64, 30296 -65, 30372 -66, 30448 -67, 30524 -68, 30600 -69, 30676 -70, 30752 -71, 30828 -72, 30904 -73, 30980 -74, 31056 -75, 31132 -76, 31208 -77, 31284 -78, 31360 -79, 31436 -80, 31512 -81, 31588 -82, 31664 -83, 31740 -84, 31816 -85, 31892 -86, 31968 -87, 32044 -88, 32120 -89, 32196 -90, 32268 -91, 32340 -92, 32412 -93, 32484 -94, 32556 -95, 32628 -96, 32700 -97, 32772 -98, 32840 -99, 32908 -100, 32976 -101, 33044 -102, 33112 -103, 33180 -104, 33248 -105, 33316 -106, 33384 -107, 33452 -108, 33520 -109, 33588 -110, 33656 -111, 33724 -112, 33792 -113, 33860 -114, 33928 -115, 33996 -116, 34064 -117, 34132 -118, 34200 -119, 34268 -120, 34336 -121, 34404 -122, 34472 -123, 34540 -124, 34608 -125, 34676 -126, 34744 -127, 34812 -128, 34880 -129, 34948 -130, 35016 -131, 35084 -132, 35152 -133, 35220 -134, 35288 -135, 35356 -136, 35424 -137, 35492 -138, 35560 -139, 35628 -140, 35696 -141, 35764 -142, 35832 -143, 35900 -144, 35968 -145, 36036 -146, 36104 -147, 36172 -148, 36240 -149, 36300 -150, 36352 -151, 36400 -152, 36448 -153, 36492 +1, 13344 +2, 17224 +3, 18704 +4, 20056 +5, 21248 +6, 22280 +7, 22856 +8, 23224 +9, 23564 +10, 23904 +11, 24220 +12, 24460 +13, 24660 +14, 24860 +15, 25044 +16, 25200 +17, 25356 +18, 25512 +19, 25668 +20, 25820 +21, 25972 +22, 26124 +23, 26276 +24, 26424 +25, 26572 +26, 26720 +27, 26868 +28, 27008 +29, 27144 +30, 27276 +31, 27404 +32, 27532 +33, 27648 +34, 27756 +35, 27848 +36, 27932 +37, 28016 +38, 28100 +39, 28184 +40, 28268 +41, 28352 +42, 28436 +43, 28520 +44, 28600 +45, 28680 +46, 28760 +47, 28840 +48, 28920 +49, 29000 +50, 29080 +51, 29160 +52, 29240 +53, 29320 +54, 29400 +55, 29480 +56, 29560 +57, 29640 +58, 29720 +59, 29800 +60, 29880 +61, 29960 +62, 30036 +63, 30112 +64, 30188 +65, 30264 +66, 30340 +67, 30416 +68, 30492 +69, 30568 +70, 30644 +71, 30720 +72, 30796 +73, 30872 +74, 30948 +75, 31024 +76, 31100 +77, 31176 +78, 31252 +79, 31328 +80, 31404 +81, 31480 +82, 31556 +83, 31632 +84, 31708 +85, 31784 +86, 31860 +87, 31936 +88, 32012 +89, 32088 +90, 32164 +91, 32236 +92, 32308 +93, 32380 +94, 32452 +95, 32524 +96, 32596 +97, 32668 +98, 32740 +99, 32808 +100, 32876 +101, 32944 +102, 33012 +103, 33080 +104, 33148 +105, 33216 +106, 33284 +107, 33352 +108, 33420 +109, 33488 +110, 33556 +111, 33624 +112, 33692 +113, 33760 +114, 33828 +115, 33896 +116, 33964 +117, 34032 +118, 34100 +119, 34168 +120, 34236 +121, 34304 +122, 34372 +123, 34440 +124, 34508 +125, 34576 +126, 34644 +127, 34712 +128, 34780 +129, 34848 +130, 34916 +131, 34984 +132, 35052 +133, 35120 +134, 35188 +135, 35256 +136, 35324 +137, 35392 +138, 35460 +139, 35528 +140, 35596 +141, 35664 +142, 35732 +143, 35800 +144, 35868 +145, 35936 +146, 36004 +147, 36072 +148, 36140 +149, 36208 +150, 36268 +151, 36320 +152, 36368 +153, 36416 +154, 36460 diff --git a/src/arm_cortex/estell/exception.cpp b/src/arm_cortex/estell/exception.cpp index b64eeda..0b8a7f4 100644 --- a/src/arm_cortex/estell/exception.cpp +++ b/src/arm_cortex/estell/exception.cpp @@ -658,10 +658,11 @@ class action_decoder auto const* test = to_absolute_address_ptr(static_cast(current_type)); + return reinterpret_cast(test); } - std::type_info const* get_next_catch_type() + [[nodiscard]] std::type_info const* get_next_catch_type() { if (m_action_position == nullptr) { return nullptr; @@ -689,7 +690,7 @@ class action_decoder return get_current_type_info_from_filter(); } - std::uint8_t filter() + [[nodiscard]] constexpr auto filter() const { return m_filter; } @@ -783,29 +784,24 @@ inline void enter_function(exception_control_block& p_exception_object) catch_type != nullptr; catch_type = a_decoder.get_next_catch_type()) { - auto position = std::ranges::find_if( - p_exception_object.type_info, [&catch_type](auto const& element) { - return element.type_info == catch_type; - }); - - if (position == p_exception_object.type_info.end()) { - continue; - } + for (auto const& type_entry : p_exception_object.type_info) { + if (type_entry.type_info == catch_type) { + p_exception_object.choosen_type_offset = type_entry.offset; + // ====== Prepare to Install context!! ===== + cpu[0] = &p_exception_object; + cpu[1] = a_decoder.filter(); - p_exception_object.choosen_type_offset = position->offset; - // ====== Prepare to Install context!! ===== - cpu[0] = &p_exception_object; - cpu[1] = a_decoder.filter(); - - // LSB must be set to 1 to jump to an address - auto const final_destination = - (entry_ptr->function() + site_info.landing_pad) | 0b1; + // LSB must be set to 1 to jump to an address + auto const final_destination = + (entry_ptr->function() + site_info.landing_pad) | 0b1; - // Set PC to the cleanup destination - cpu.pc = final_destination; + // Set PC to the cleanup destination + cpu.pc = final_destination; - // Install CPU state - restore_cpu_core(cpu); + // Install CPU state + restore_cpu_core(cpu); + } + } } }