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

Side by Side Diff: src/runtime.cc

Issue 305403002: fdlibm: reduce accuracy slightly in favor of performance. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "accessors.h" 10 #include "accessors.h"
(...skipping 7761 matching lines...) Expand 10 before | Expand all | Expand 10 after
7772 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; 7772 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo;
7773 return *isolate->factory()->NewNumber(uint64_to_double(result)); 7773 return *isolate->factory()->NewNumber(uint64_to_double(result));
7774 } 7774 }
7775 7775
7776 7776
7777 RUNTIME_FUNCTION(Runtime_RemPiO2) { 7777 RUNTIME_FUNCTION(Runtime_RemPiO2) {
7778 HandleScope handle_scope(isolate); 7778 HandleScope handle_scope(isolate);
7779 ASSERT(args.length() == 1); 7779 ASSERT(args.length() == 1);
7780 CONVERT_DOUBLE_ARG_CHECKED(x, 0); 7780 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
7781 Factory* factory = isolate->factory(); 7781 Factory* factory = isolate->factory();
7782 double y[2]; 7782 double y;
7783 int n = rempio2(x, y); 7783 int n = rempio2(x, &y);
7784 Handle<FixedArray> array = factory->NewFixedArray(3); 7784 Handle<FixedArray> array = factory->NewFixedArray(2);
7785 array->set(0, Smi::FromInt(n)); 7785 array->set(0, Smi::FromInt(n));
7786 array->set(1, *factory->NewHeapNumber(y[0])); 7786 array->set(1, *factory->NewHeapNumber(y));
7787 array->set(2, *factory->NewHeapNumber(y[1]));
7788 return *factory->NewJSArrayWithElements(array); 7787 return *factory->NewJSArrayWithElements(array);
7789 } 7788 }
7790 7789
7791 7790
7792 static const double kPiDividedBy4 = 0.78539816339744830962; 7791 static const double kPiDividedBy4 = 0.78539816339744830962;
7793 7792
7794 7793
7795 RUNTIME_FUNCTION(Runtime_MathAtan2) { 7794 RUNTIME_FUNCTION(Runtime_MathAtan2) {
7796 HandleScope scope(isolate); 7795 HandleScope scope(isolate);
7797 ASSERT(args.length() == 2); 7796 ASSERT(args.length() == 2);
(...skipping 7336 matching lines...) Expand 10 before | Expand all | Expand 10 after
15134 } 15133 }
15135 return NULL; 15134 return NULL;
15136 } 15135 }
15137 15136
15138 15137
15139 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15138 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15140 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15139 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15141 } 15140 }
15142 15141
15143 } } // namespace v8::internal 15142 } } // namespace v8::internal
OLDNEW
« src/math.js ('K') | « src/rempio2.cc ('k') | test/mjsunit/sin-cos.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698