OLD | NEW |
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 Loading... |
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 7618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7676 RUNTIME_FUNCTION(Runtime_ConstructDouble) { | 7677 RUNTIME_FUNCTION(Runtime_ConstructDouble) { |
7677 HandleScope scope(isolate); | 7678 HandleScope scope(isolate); |
7678 DCHECK(args.length() == 2); | 7679 DCHECK(args.length() == 2); |
7679 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); | 7680 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); |
7680 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); | 7681 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); |
7681 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; | 7682 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; |
7682 return *isolate->factory()->NewNumber(uint64_to_double(result)); | 7683 return *isolate->factory()->NewNumber(uint64_to_double(result)); |
7683 } | 7684 } |
7684 | 7685 |
7685 | 7686 |
| 7687 RUNTIME_FUNCTION(Runtime_RemPiO2) { |
| 7688 HandleScope handle_scope(isolate); |
| 7689 DCHECK(args.length() == 1); |
| 7690 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 7691 Factory* factory = isolate->factory(); |
| 7692 double y[2]; |
| 7693 int n = rempio2(x, y); |
| 7694 Handle<FixedArray> array = factory->NewFixedArray(3); |
| 7695 Handle<HeapNumber> y0 = factory->NewHeapNumber(y[0]); |
| 7696 Handle<HeapNumber> y1 = factory->NewHeapNumber(y[1]); |
| 7697 array->set(0, Smi::FromInt(n)); |
| 7698 array->set(1, *y0); |
| 7699 array->set(2, *y1); |
| 7700 return *factory->NewJSArrayWithElements(array); |
| 7701 } |
| 7702 |
| 7703 |
7686 static const double kPiDividedBy4 = 0.78539816339744830962; | 7704 static const double kPiDividedBy4 = 0.78539816339744830962; |
7687 | 7705 |
7688 | 7706 |
7689 RUNTIME_FUNCTION(Runtime_MathAtan2) { | 7707 RUNTIME_FUNCTION(Runtime_MathAtan2) { |
7690 HandleScope scope(isolate); | 7708 HandleScope scope(isolate); |
7691 DCHECK(args.length() == 2); | 7709 DCHECK(args.length() == 2); |
7692 isolate->counters()->math_atan2()->Increment(); | 7710 isolate->counters()->math_atan2()->Increment(); |
7693 | 7711 |
7694 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7712 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
7695 CONVERT_DOUBLE_ARG_CHECKED(y, 1); | 7713 CONVERT_DOUBLE_ARG_CHECKED(y, 1); |
(...skipping 7891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15587 } | 15605 } |
15588 return NULL; | 15606 return NULL; |
15589 } | 15607 } |
15590 | 15608 |
15591 | 15609 |
15592 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15610 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15593 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15611 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15594 } | 15612 } |
15595 | 15613 |
15596 } } // namespace v8::internal | 15614 } } // namespace v8::internal |
OLD | NEW |