Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: src/trig-table.h

Issue 78263005: Reland: Embed trigonometric lookup table. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-weaktypedarrays.cc » ('j') | tools/gyp/v8.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698