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

Side by Side Diff: src/runtime.cc

Issue 411263004: Implement trigonometric functions using a fdlibm port. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.h ('k') | src/trig-table.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 27 matching lines...) Expand all
38 #include "src/runtime.h" 38 #include "src/runtime.h"
39 #include "src/runtime-profiler.h" 39 #include "src/runtime-profiler.h"
40 #include "src/scopeinfo.h" 40 #include "src/scopeinfo.h"
41 #include "src/smart-pointers.h" 41 #include "src/smart-pointers.h"
42 #include "src/string-search.h" 42 #include "src/string-search.h"
43 #include "src/stub-cache.h" 43 #include "src/stub-cache.h"
44 #include "src/uri.h" 44 #include "src/uri.h"
45 #include "src/utils.h" 45 #include "src/utils.h"
46 #include "src/v8threads.h" 46 #include "src/v8threads.h"
47 #include "src/vm-state-inl.h" 47 #include "src/vm-state-inl.h"
48 #include "third_party/fdlibm/fdlibm.h"
48 49
49 #ifdef V8_I18N_SUPPORT 50 #ifdef V8_I18N_SUPPORT
50 #include "src/i18n.h" 51 #include "src/i18n.h"
51 #include "unicode/brkiter.h" 52 #include "unicode/brkiter.h"
52 #include "unicode/calendar.h" 53 #include "unicode/calendar.h"
53 #include "unicode/coll.h" 54 #include "unicode/coll.h"
54 #include "unicode/curramt.h" 55 #include "unicode/curramt.h"
55 #include "unicode/datefmt.h" 56 #include "unicode/datefmt.h"
56 #include "unicode/dcfmtsym.h" 57 #include "unicode/dcfmtsym.h"
57 #include "unicode/decimfmt.h" 58 #include "unicode/decimfmt.h"
(...skipping 7611 matching lines...) Expand 10 before | Expand all | Expand 10 after
7669 RUNTIME_FUNCTION(Runtime_ConstructDouble) { 7670 RUNTIME_FUNCTION(Runtime_ConstructDouble) {
7670 HandleScope scope(isolate); 7671 HandleScope scope(isolate);
7671 DCHECK(args.length() == 2); 7672 DCHECK(args.length() == 2);
7672 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); 7673 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]);
7673 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); 7674 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]);
7674 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; 7675 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo;
7675 return *isolate->factory()->NewNumber(uint64_to_double(result)); 7676 return *isolate->factory()->NewNumber(uint64_to_double(result));
7676 } 7677 }
7677 7678
7678 7679
7680 RUNTIME_FUNCTION(Runtime_RemPiO2) {
7681 HandleScope handle_scope(isolate);
7682 DCHECK(args.length() == 1);
7683 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
7684 Factory* factory = isolate->factory();
7685 double y[2];
7686 int n = rempio2(x, y);
7687 Handle<FixedArray> array = factory->NewFixedArray(3);
7688 array->set(0, Smi::FromInt(n));
7689 array->set(1, *factory->NewHeapNumber(y[0]));
7690 array->set(2, *factory->NewHeapNumber(y[1]));
7691 return *factory->NewJSArrayWithElements(array);
7692 }
7693
7694
7679 static const double kPiDividedBy4 = 0.78539816339744830962; 7695 static const double kPiDividedBy4 = 0.78539816339744830962;
7680 7696
7681 7697
7682 RUNTIME_FUNCTION(Runtime_MathAtan2) { 7698 RUNTIME_FUNCTION(Runtime_MathAtan2) {
7683 HandleScope scope(isolate); 7699 HandleScope scope(isolate);
7684 DCHECK(args.length() == 2); 7700 DCHECK(args.length() == 2);
7685 isolate->counters()->math_atan2()->Increment(); 7701 isolate->counters()->math_atan2()->Increment();
7686 7702
7687 CONVERT_DOUBLE_ARG_CHECKED(x, 0); 7703 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
7688 CONVERT_DOUBLE_ARG_CHECKED(y, 1); 7704 CONVERT_DOUBLE_ARG_CHECKED(y, 1);
(...skipping 7891 matching lines...) Expand 10 before | Expand all | Expand 10 after
15580 } 15596 }
15581 return NULL; 15597 return NULL;
15582 } 15598 }
15583 15599
15584 15600
15585 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15601 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15586 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15602 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15587 } 15603 }
15588 15604
15589 } } // namespace v8::internal 15605 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/trig-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698