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_ |