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 7795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7806 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; | 7806 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; |
7807 return *isolate->factory()->NewNumber(uint64_to_double(result)); | 7807 return *isolate->factory()->NewNumber(uint64_to_double(result)); |
7808 } | 7808 } |
7809 | 7809 |
7810 | 7810 |
7811 RUNTIME_FUNCTION(Runtime_RemPiO2) { | 7811 RUNTIME_FUNCTION(Runtime_RemPiO2) { |
7812 HandleScope handle_scope(isolate); | 7812 HandleScope handle_scope(isolate); |
7813 DCHECK(args.length() == 1); | 7813 DCHECK(args.length() == 1); |
7814 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7814 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
7815 Factory* factory = isolate->factory(); | 7815 Factory* factory = isolate->factory(); |
7816 double y[2]; | 7816 double y[2] = {0.0, 0.0}; |
7817 int n = fdlibm::rempio2(x, y); | 7817 int n = fdlibm::rempio2(x, y); |
7818 Handle<FixedArray> array = factory->NewFixedArray(3); | 7818 Handle<FixedArray> array = factory->NewFixedArray(3); |
7819 Handle<HeapNumber> y0 = factory->NewHeapNumber(y[0]); | 7819 Handle<HeapNumber> y0 = factory->NewHeapNumber(y[0]); |
7820 Handle<HeapNumber> y1 = factory->NewHeapNumber(y[1]); | 7820 Handle<HeapNumber> y1 = factory->NewHeapNumber(y[1]); |
7821 array->set(0, Smi::FromInt(n)); | 7821 array->set(0, Smi::FromInt(n)); |
7822 array->set(1, *y0); | 7822 array->set(1, *y0); |
7823 array->set(2, *y1); | 7823 array->set(2, *y1); |
7824 return *factory->NewJSArrayWithElements(array); | 7824 return *factory->NewJSArrayWithElements(array); |
7825 } | 7825 } |
7826 | 7826 |
(...skipping 7935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15762 } | 15762 } |
15763 return NULL; | 15763 return NULL; |
15764 } | 15764 } |
15765 | 15765 |
15766 | 15766 |
15767 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15767 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15768 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15768 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15769 } | 15769 } |
15770 | 15770 |
15771 } } // namespace v8::internal | 15771 } } // namespace v8::internal |
OLD | NEW |