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 7889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7900 HandleScope scope(isolate); | 7900 HandleScope scope(isolate); |
7901 ASSERT(args.length() == 1); | 7901 ASSERT(args.length() == 1); |
7902 isolate->counters()->math_floor()->Increment(); | 7902 isolate->counters()->math_floor()->Increment(); |
7903 | 7903 |
7904 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7904 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
7905 return *isolate->factory()->NewNumber(std::floor(x)); | 7905 return *isolate->factory()->NewNumber(std::floor(x)); |
7906 } | 7906 } |
7907 | 7907 |
7908 | 7908 |
7909 // Slow version of Math.pow. We check for fast paths for special cases. | 7909 // Slow version of Math.pow. We check for fast paths for special cases. |
7910 // Used if SSE2/VFP3 is not available. | 7910 // Used if VFP3 is not available. |
7911 RUNTIME_FUNCTION(RuntimeHidden_MathPowSlow) { | 7911 RUNTIME_FUNCTION(RuntimeHidden_MathPowSlow) { |
7912 HandleScope scope(isolate); | 7912 HandleScope scope(isolate); |
7913 ASSERT(args.length() == 2); | 7913 ASSERT(args.length() == 2); |
7914 isolate->counters()->math_pow()->Increment(); | 7914 isolate->counters()->math_pow()->Increment(); |
7915 | 7915 |
7916 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7916 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
7917 | 7917 |
7918 // If the second argument is a smi, it is much faster to call the | 7918 // If the second argument is a smi, it is much faster to call the |
7919 // custom powi() function than the generic pow(). | 7919 // custom powi() function than the generic pow(). |
7920 if (args[1]->IsSmi()) { | 7920 if (args[1]->IsSmi()) { |
(...skipping 7343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15264 } | 15264 } |
15265 return NULL; | 15265 return NULL; |
15266 } | 15266 } |
15267 | 15267 |
15268 | 15268 |
15269 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15269 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15270 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15270 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15271 } | 15271 } |
15272 | 15272 |
15273 } } // namespace v8::internal | 15273 } } // namespace v8::internal |
OLD | NEW |