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 7873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7884 HandleScope scope(isolate); | 7884 HandleScope scope(isolate); |
7885 ASSERT(args.length() == 1); | 7885 ASSERT(args.length() == 1); |
7886 isolate->counters()->math_floor()->Increment(); | 7886 isolate->counters()->math_floor()->Increment(); |
7887 | 7887 |
7888 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7888 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
7889 return *isolate->factory()->NewNumber(std::floor(x)); | 7889 return *isolate->factory()->NewNumber(std::floor(x)); |
7890 } | 7890 } |
7891 | 7891 |
7892 | 7892 |
7893 // Slow version of Math.pow. We check for fast paths for special cases. | 7893 // Slow version of Math.pow. We check for fast paths for special cases. |
7894 // Used if SSE2/VFP3 is not available. | 7894 // Used if VFP3 is not available. |
7895 RUNTIME_FUNCTION(RuntimeHidden_MathPowSlow) { | 7895 RUNTIME_FUNCTION(RuntimeHidden_MathPowSlow) { |
7896 HandleScope scope(isolate); | 7896 HandleScope scope(isolate); |
7897 ASSERT(args.length() == 2); | 7897 ASSERT(args.length() == 2); |
7898 isolate->counters()->math_pow()->Increment(); | 7898 isolate->counters()->math_pow()->Increment(); |
7899 | 7899 |
7900 CONVERT_DOUBLE_ARG_CHECKED(x, 0); | 7900 CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
7901 | 7901 |
7902 // If the second argument is a smi, it is much faster to call the | 7902 // If the second argument is a smi, it is much faster to call the |
7903 // custom powi() function than the generic pow(). | 7903 // custom powi() function than the generic pow(). |
7904 if (args[1]->IsSmi()) { | 7904 if (args[1]->IsSmi()) { |
(...skipping 7335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15240 } | 15240 } |
15241 return NULL; | 15241 return NULL; |
15242 } | 15242 } |
15243 | 15243 |
15244 | 15244 |
15245 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15245 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15246 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15246 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15247 } | 15247 } |
15248 | 15248 |
15249 } } // namespace v8::internal | 15249 } } // namespace v8::internal |
OLD | NEW |