| 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 16 matching lines...) Expand all Loading... |
| 27 #include "src/global-handles.h" | 27 #include "src/global-handles.h" |
| 28 #include "src/isolate-inl.h" | 28 #include "src/isolate-inl.h" |
| 29 #include "src/jsregexp.h" | 29 #include "src/jsregexp.h" |
| 30 #include "src/jsregexp-inl.h" | 30 #include "src/jsregexp-inl.h" |
| 31 #include "src/json-parser.h" | 31 #include "src/json-parser.h" |
| 32 #include "src/json-stringifier.h" | 32 #include "src/json-stringifier.h" |
| 33 #include "src/liveedit.h" | 33 #include "src/liveedit.h" |
| 34 #include "src/misc-intrinsics.h" | 34 #include "src/misc-intrinsics.h" |
| 35 #include "src/parser.h" | 35 #include "src/parser.h" |
| 36 #include "src/platform.h" | 36 #include "src/platform.h" |
| 37 #include "src/rempio2.h" |
| 37 #include "src/runtime-profiler.h" | 38 #include "src/runtime-profiler.h" |
| 38 #include "src/runtime.h" | 39 #include "src/runtime.h" |
| 39 #include "src/scopeinfo.h" | 40 #include "src/scopeinfo.h" |
| 40 #include "src/smart-pointers.h" | 41 #include "src/smart-pointers.h" |
| 41 #include "src/string-search.h" | 42 #include "src/string-search.h" |
| 42 #include "src/stub-cache.h" | 43 #include "src/stub-cache.h" |
| 43 #include "src/uri.h" | 44 #include "src/uri.h" |
| 44 #include "src/v8threads.h" | 45 #include "src/v8threads.h" |
| 45 #include "src/vm-state-inl.h" | 46 #include "src/vm-state-inl.h" |
| 46 | 47 |
| (...skipping 7738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7785 RUNTIME_FUNCTION(Runtime_ConstructDouble) { | 7786 RUNTIME_FUNCTION(Runtime_ConstructDouble) { |
| 7786 HandleScope scope(isolate); | 7787 HandleScope scope(isolate); |
| 7787 ASSERT(args.length() == 2); | 7788 ASSERT(args.length() == 2); |
| 7788 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); | 7789 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); |
| 7789 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); | 7790 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); |
| 7790 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; | 7791 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; |
| 7791 return *isolate->factory()->NewNumber(uint64_to_double(result)); | 7792 return *isolate->factory()->NewNumber(uint64_to_double(result)); |
| 7792 } | 7793 } |
| 7793 | 7794 |
| 7794 | 7795 |
| 7796 RUNTIME_FUNCTION(Runtime_RemPiO2) { |
| 7797 HandleScope handle_scope(isolate); |
| 7798 ASSERT(args.length() == 1); |
| 7799 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 7800 Factory* factory = isolate->factory(); |
| 7801 double y[2]; |
| 7802 int n = rempio2(x, y); |
| 7803 Handle<FixedArray> array = factory->NewFixedArray(3); |
| 7804 array->set(0, Smi::FromInt(n)); |
| 7805 array->set(1, *factory->NewHeapNumber(y[0])); |
| 7806 array->set(2, *factory->NewHeapNumber(y[1])); |
| 7807 return *factory->NewJSArrayWithElements(array); |
| 7808 } |
| 7809 |
| 7810 |
| 7795 static const double kPiDividedBy4 = 0.78539816339744830962; | 7811 static const double kPiDividedBy4 = 0.78539816339744830962; |
| 7796 | 7812 |
| 7797 | 7813 |
| 7798 RUNTIME_FUNCTION(Runtime_MathAtan2) { | 7814 RUNTIME_FUNCTION(Runtime_MathAtan2) { |
| 7799 HandleScope scope(isolate); | 7815 HandleScope scope(isolate); |
| 7800 ASSERT(args.length() == 2); | 7816 ASSERT(args.length() == 2); |
| 7801 isolate->counters()->math_atan2()->Increment(); | 7817 isolate->counters()->math_atan2()->Increment(); |
| 7802 | 7818 |
| 7803 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7819 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 7804 CONVERT_DOUBLE_ARG_CHECKED(y, 1); | 7820 CONVERT_DOUBLE_ARG_CHECKED(y, 1); |
| (...skipping 7338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15143 } | 15159 } |
| 15144 return NULL; | 15160 return NULL; |
| 15145 } | 15161 } |
| 15146 | 15162 |
| 15147 | 15163 |
| 15148 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15164 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15149 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15165 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15150 } | 15166 } |
| 15151 | 15167 |
| 15152 } } // namespace v8::internal | 15168 } } // namespace v8::internal |
| OLD | NEW |