d4b533d41b
R=svenpanne@chromium.org Review URL: https://codereview.chromium.org/259183002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21035 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
// Copyright 2013 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef V8_TRIG_TABLE_H_
|
|
#define V8_TRIG_TABLE_H_
|
|
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
class TrigonometricLookupTable : public AllStatic {
|
|
public:
|
|
// Casting away const-ness to use as argument for typed array constructor.
|
|
static void* sin_table() {
|
|
return const_cast<double*>(&kSinTable[0]);
|
|
}
|
|
|
|
static void* cos_x_interval_table() {
|
|
return const_cast<double*>(&kCosXIntervalTable[0]);
|
|
}
|
|
|
|
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; }
|
|
|
|
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_TRIG_TABLE_H_
|