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

Unified Diff: src/bootstrapper.cc

Issue 448633002: Revert "Implement trigonometric functions using a fdlibm port." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months 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 | « DEPS ('k') | src/math.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index c297a37e1ceef40c9be1c3e4d0e016301a3b110f..a746c904fa8257151c8c797bf355e1cb2dd488e7 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -14,7 +14,7 @@
#include "src/isolate-inl.h"
#include "src/natives.h"
#include "src/snapshot.h"
-#include "third_party/fdlibm/fdlibm.h"
+#include "src/trig-table.h"
namespace v8 {
namespace internal {
@@ -121,7 +121,7 @@ char* Bootstrapper::AllocateAutoDeletedArray(int bytes) {
void Bootstrapper::TearDown() {
if (delete_these_non_arrays_on_tear_down_ != NULL) {
int len = delete_these_non_arrays_on_tear_down_->length();
- DCHECK(len < 25); // Don't use this mechanism for unbounded allocations.
+ DCHECK(len < 24); // Don't use this mechanism for unbounded allocations.
for (int i = 0; i < len; i++) {
delete delete_these_non_arrays_on_tear_down_->at(i);
delete_these_non_arrays_on_tear_down_->at(i) = NULL;
@@ -2651,19 +2651,43 @@ Genesis::Genesis(Isolate* isolate,
NONE).Assert();
// Initialize trigonometric lookup tables and constants.
- const int constants_size = ARRAY_SIZE(TrigonometricConstants::constants);
- const int table_num_bytes = constants_size * kDoubleSize;
- v8::Local<v8::ArrayBuffer> trig_buffer = v8::ArrayBuffer::New(
+ const int table_num_bytes = TrigonometricLookupTable::table_num_bytes();
+ v8::Local<v8::ArrayBuffer> sin_buffer = v8::ArrayBuffer::New(
reinterpret_cast<v8::Isolate*>(isolate),
- const_cast<double*>(TrigonometricConstants::constants),
- table_num_bytes);
- v8::Local<v8::Float64Array> trig_table =
- v8::Float64Array::New(trig_buffer, 0, constants_size);
+ TrigonometricLookupTable::sin_table(), table_num_bytes);
+ v8::Local<v8::ArrayBuffer> cos_buffer = v8::ArrayBuffer::New(
+ reinterpret_cast<v8::Isolate*>(isolate),
+ TrigonometricLookupTable::cos_x_interval_table(), table_num_bytes);
+ v8::Local<v8::Float64Array> sin_table = v8::Float64Array::New(
+ sin_buffer, 0, TrigonometricLookupTable::table_size());
+ v8::Local<v8::Float64Array> cos_table = v8::Float64Array::New(
+ cos_buffer, 0, TrigonometricLookupTable::table_size());
+ Runtime::DefineObjectProperty(builtins,
+ factory()->InternalizeOneByteString(
+ STATIC_ASCII_VECTOR("kSinTable")),
+ Utils::OpenHandle(*sin_table),
+ NONE).Assert();
+ Runtime::DefineObjectProperty(
+ builtins,
+ factory()->InternalizeOneByteString(
+ STATIC_ASCII_VECTOR("kCosXIntervalTable")),
+ Utils::OpenHandle(*cos_table),
+ NONE).Assert();
+ Runtime::DefineObjectProperty(
+ builtins,
+ factory()->InternalizeOneByteString(
+ STATIC_ASCII_VECTOR("kSamples")),
+ factory()->NewHeapNumber(
+ TrigonometricLookupTable::samples()),
+ NONE).Assert();
Runtime::DefineObjectProperty(
builtins,
- factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("kTrig")),
- Utils::OpenHandle(*trig_table), NONE).Assert();
+ factory()->InternalizeOneByteString(
+ STATIC_ASCII_VECTOR("kIndexConvert")),
+ factory()->NewHeapNumber(
+ TrigonometricLookupTable::samples_over_pi_half()),
+ NONE).Assert();
}
result_ = native_context();
« no previous file with comments | « DEPS ('k') | src/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698