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

Unified Diff: src/trig-table.h

Issue 78873006: Embed trigonometric lookup table. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: tiny fixes 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
« no previous file with comments | « src/runtime.cc ('k') | tools/generate-trig-table.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trig-table.h
diff --git a/src/hydrogen-dce.h b/src/trig-table.h
similarity index 75%
copy from src/hydrogen-dce.h
copy to src/trig-table.h
index 2d73b380e40831147e5b5e586f0c805d9c45f877..bd48ff7afd1d56c3c8880b3389d917996256aa8c 100644
--- a/src/hydrogen-dce.h
+++ b/src/trig-table.h
@@ -25,33 +25,34 @@
// (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_DCE_H_
-#define V8_HYDROGEN_DCE_H_
+#ifndef V8_TRIG_TABLE_H_
+#define V8_TRIG_TABLE_H_
-#include "hydrogen.h"
namespace v8 {
namespace internal {
-
-class HDeadCodeEliminationPhase : public HPhase {
+class TrigonometricLookupTable {
public:
Sven Panne 2013/11/21 12:25:45 Let's make all the members private and expose only
- explicit HDeadCodeEliminationPhase(HGraph* graph)
- : HPhase("H_Dead code elimination", graph) { }
+ static const double kSinTable[];
+ static const double kCosXIntervalTable[];
+ static const int kSamples;
+ static const int kTableSize;
+ static const double kSamplesOverPiHalf;
+
+ static int table_num_bytes() {
+ return kTableSize * sizeof(*kSinTable);
+ }
- void Run() {
- MarkLiveInstructions();
- RemoveDeadInstructions();
+ static void* sin_table() {
Sven Panne 2013/11/21 12:25:45 Add a small comment why we have to cast away const
+ return const_cast<double*>(&kSinTable[0]);
}
- private:
- void MarkLive(HValue* instr, ZoneList<HValue*>* worklist);
- void PrintLive(HValue* ref, HValue* instr);
- void MarkLiveInstructions();
- void RemoveDeadInstructions();
+ static void* cos_x_interval_table() {
+ return const_cast<double*>(&kCosXIntervalTable[0]);
+ }
};
-
} } // namespace v8::internal
-#endif // V8_HYDROGEN_DCE_H_
+#endif // V8_TRIG_TABLE_H_
« no previous file with comments | « src/runtime.cc ('k') | tools/generate-trig-table.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698