Index: src/trig-table.h |
diff --git a/src/hydrogen-bch.h b/src/trig-table.h |
similarity index 67% |
copy from src/hydrogen-bch.h |
copy to src/trig-table.h |
index a22dacdd4229748e2735b3c0d8519c927b2f617d..081c0389ae2d8d1b1c652404162e7ea0d8c4fec6 100644 |
--- a/src/hydrogen-bch.h |
+++ b/src/trig-table.h |
@@ -25,31 +25,37 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#ifndef V8_HYDROGEN_BCH_H_ |
-#define V8_HYDROGEN_BCH_H_ |
+#ifndef V8_TRIG_TABLE_H_ |
+#define V8_TRIG_TABLE_H_ |
-#include "hydrogen.h" |
namespace v8 { |
namespace internal { |
- |
-class HBoundsCheckHoistingPhase : public HPhase { |
+class TrigonometricLookupTable : public AllStatic { |
public: |
- explicit HBoundsCheckHoistingPhase(HGraph* graph) |
- : HPhase("H_Bounds checks hoisting", graph) { } |
+ // Casting away const-ness to use as argument for typed array constructor. |
+ static void* sin_table() { |
+ return const_cast<double*>(&kSinTable[0]); |
+ } |
- void Run() { |
- HoistRedundantBoundsChecks(); |
+ static void* cos_x_interval_table() { |
+ return const_cast<double*>(&kCosXIntervalTable[0]); |
} |
- private: |
- void HoistRedundantBoundsChecks(); |
+ static double samples_over_pi_half() { return kSamplesOverPiHalf; } |
+ static int samples() { return kSamples; } |
+ static int table_num_bytes() { return kTableSize * sizeof(*kSinTable); } |
+ static int table_size() { return kTableSize; } |
- DISALLOW_COPY_AND_ASSIGN(HBoundsCheckHoistingPhase); |
+ private: |
+ static const double kSinTable[]; |
+ static const double kCosXIntervalTable[]; |
+ static const int kSamples; |
+ static const int kTableSize; |
+ static const double kSamplesOverPiHalf; |
}; |
- |
} } // namespace v8::internal |
-#endif // V8_HYDROGEN_BCE_H_ |
+#endif // V8_TRIG_TABLE_H_ |