| 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 "v8.h" | 8 #include "v8.h" |
| 9 | 9 |
| 10 #include "accessors.h" | 10 #include "accessors.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "isolate-inl.h" | 28 #include "isolate-inl.h" |
| 29 #include "jsregexp.h" | 29 #include "jsregexp.h" |
| 30 #include "jsregexp-inl.h" | 30 #include "jsregexp-inl.h" |
| 31 #include "json-parser.h" | 31 #include "json-parser.h" |
| 32 #include "json-stringifier.h" | 32 #include "json-stringifier.h" |
| 33 #include "liveedit.h" | 33 #include "liveedit.h" |
| 34 #include "misc-intrinsics.h" | 34 #include "misc-intrinsics.h" |
| 35 #include "parser.h" | 35 #include "parser.h" |
| 36 #include "platform.h" | 36 #include "platform.h" |
| 37 #include "runtime-profiler.h" | 37 #include "runtime-profiler.h" |
| 38 #include "rempio2.h" |
| 38 #include "runtime.h" | 39 #include "runtime.h" |
| 39 #include "scopeinfo.h" | 40 #include "scopeinfo.h" |
| 40 #include "smart-pointers.h" | 41 #include "smart-pointers.h" |
| 41 #include "string-search.h" | 42 #include "string-search.h" |
| 42 #include "stub-cache.h" | 43 #include "stub-cache.h" |
| 43 #include "uri.h" | 44 #include "uri.h" |
| 44 #include "v8threads.h" | 45 #include "v8threads.h" |
| 45 #include "vm-state-inl.h" | 46 #include "vm-state-inl.h" |
| 46 | 47 |
| 47 #ifdef V8_I18N_SUPPORT | 48 #ifdef V8_I18N_SUPPORT |
| (...skipping 7718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7766 RUNTIME_FUNCTION(Runtime_ConstructDouble) { | 7767 RUNTIME_FUNCTION(Runtime_ConstructDouble) { |
| 7767 HandleScope scope(isolate); | 7768 HandleScope scope(isolate); |
| 7768 ASSERT(args.length() == 2); | 7769 ASSERT(args.length() == 2); |
| 7769 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); | 7770 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); |
| 7770 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); | 7771 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); |
| 7771 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; | 7772 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; |
| 7772 return *isolate->factory()->NewNumber(uint64_to_double(result)); | 7773 return *isolate->factory()->NewNumber(uint64_to_double(result)); |
| 7773 } | 7774 } |
| 7774 | 7775 |
| 7775 | 7776 |
| 7777 RUNTIME_FUNCTION(Runtime_RemPiO2) { |
| 7778 HandleScope handle_scope(isolate); |
| 7779 ASSERT(args.length() == 1); |
| 7780 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 7781 Factory* factory = isolate->factory(); |
| 7782 double y[2]; |
| 7783 int n = rempio2(x, y); |
| 7784 Handle<FixedArray> array = factory->NewFixedArray(3); |
| 7785 array->set(0, Smi::FromInt(n)); |
| 7786 array->set(1, *factory->NewHeapNumber(y[0])); |
| 7787 array->set(2, *factory->NewHeapNumber(y[1])); |
| 7788 return *factory->NewJSArrayWithElements(array); |
| 7789 } |
| 7790 |
| 7791 |
| 7776 static const double kPiDividedBy4 = 0.78539816339744830962; | 7792 static const double kPiDividedBy4 = 0.78539816339744830962; |
| 7777 | 7793 |
| 7778 | 7794 |
| 7779 RUNTIME_FUNCTION(Runtime_MathAtan2) { | 7795 RUNTIME_FUNCTION(Runtime_MathAtan2) { |
| 7780 HandleScope scope(isolate); | 7796 HandleScope scope(isolate); |
| 7781 ASSERT(args.length() == 2); | 7797 ASSERT(args.length() == 2); |
| 7782 isolate->counters()->math_atan2()->Increment(); | 7798 isolate->counters()->math_atan2()->Increment(); |
| 7783 | 7799 |
| 7784 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7800 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| 7785 CONVERT_DOUBLE_ARG_CHECKED(y, 1); | 7801 CONVERT_DOUBLE_ARG_CHECKED(y, 1); |
| (...skipping 7372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15158 } | 15174 } |
| 15159 return NULL; | 15175 return NULL; |
| 15160 } | 15176 } |
| 15161 | 15177 |
| 15162 | 15178 |
| 15163 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15179 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15164 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15180 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15165 } | 15181 } |
| 15166 | 15182 |
| 15167 } } // namespace v8::internal | 15183 } } // namespace v8::internal |
| OLD | NEW |