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" | |
49 | 48 |
50 #ifdef V8_I18N_SUPPORT | 49 #ifdef V8_I18N_SUPPORT |
51 #include "src/i18n.h" | 50 #include "src/i18n.h" |
52 #include "unicode/brkiter.h" | 51 #include "unicode/brkiter.h" |
53 #include "unicode/calendar.h" | 52 #include "unicode/calendar.h" |
54 #include "unicode/coll.h" | 53 #include "unicode/coll.h" |
55 #include "unicode/curramt.h" | 54 #include "unicode/curramt.h" |
56 #include "unicode/datefmt.h" | 55 #include "unicode/datefmt.h" |
57 #include "unicode/dcfmtsym.h" | 56 #include "unicode/dcfmtsym.h" |
58 #include "unicode/decimfmt.h" | 57 #include "unicode/decimfmt.h" |
(...skipping 7618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7677 RUNTIME_FUNCTION(Runtime_ConstructDouble) { | 7676 RUNTIME_FUNCTION(Runtime_ConstructDouble) { |
7678 HandleScope scope(isolate); | 7677 HandleScope scope(isolate); |
7679 DCHECK(args.length() == 2); | 7678 DCHECK(args.length() == 2); |
7680 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); | 7679 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); |
7681 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); | 7680 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); |
7682 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; | 7681 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; |
7683 return *isolate->factory()->NewNumber(uint64_to_double(result)); | 7682 return *isolate->factory()->NewNumber(uint64_to_double(result)); |
7684 } | 7683 } |
7685 | 7684 |
7686 | 7685 |
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 array->set(0, Smi::FromInt(n)); | |
7696 array->set(1, *factory->NewHeapNumber(y[0])); | |
7697 array->set(2, *factory->NewHeapNumber(y[1])); | |
7698 return *factory->NewJSArrayWithElements(array); | |
7699 } | |
7700 | |
7701 | |
7702 static const double kPiDividedBy4 = 0.78539816339744830962; | 7686 static const double kPiDividedBy4 = 0.78539816339744830962; |
7703 | 7687 |
7704 | 7688 |
7705 RUNTIME_FUNCTION(Runtime_MathAtan2) { | 7689 RUNTIME_FUNCTION(Runtime_MathAtan2) { |
7706 HandleScope scope(isolate); | 7690 HandleScope scope(isolate); |
7707 DCHECK(args.length() == 2); | 7691 DCHECK(args.length() == 2); |
7708 isolate->counters()->math_atan2()->Increment(); | 7692 isolate->counters()->math_atan2()->Increment(); |
7709 | 7693 |
7710 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7694 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
7711 CONVERT_DOUBLE_ARG_CHECKED(y, 1); | 7695 CONVERT_DOUBLE_ARG_CHECKED(y, 1); |
(...skipping 7891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15603 } | 15587 } |
15604 return NULL; | 15588 return NULL; |
15605 } | 15589 } |
15606 | 15590 |
15607 | 15591 |
15608 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15592 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15609 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15593 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15610 } | 15594 } |
15611 | 15595 |
15612 } } // namespace v8::internal | 15596 } } // namespace v8::internal |
OLD | NEW |