Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 8f4c4ca7373a817753168bcba05f316ba8b6daef..dfdd4925bdf79c1befe063b104dcae3ba6acf696 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -7759,22 +7759,30 @@ RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_StringCompare) { |
| } |
| -#define RUNTIME_UNARY_MATH(NAME) \ |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_##NAME) { \ |
| +#define RUNTIME_UNARY_MATH(Name, name) \ |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_Math##Name) { \ |
| SealHandleScope shs(isolate); \ |
| ASSERT(args.length() == 1); \ |
| - isolate->counters()->math_##NAME()->Increment(); \ |
| + isolate->counters()->math_##name()->Increment(); \ |
| CONVERT_DOUBLE_ARG_CHECKED(x, 0); \ |
| - return isolate->heap()->AllocateHeapNumber(std::NAME(x)); \ |
| + return isolate->heap()->AllocateHeapNumber(std::name(x)); \ |
| } |
| -RUNTIME_UNARY_MATH(acos) |
| -RUNTIME_UNARY_MATH(asin) |
| -RUNTIME_UNARY_MATH(atan) |
| -RUNTIME_UNARY_MATH(log) |
| +RUNTIME_UNARY_MATH(Acos, acos) |
| +RUNTIME_UNARY_MATH(Asin, asin) |
| +RUNTIME_UNARY_MATH(Atan, atan) |
| #undef RUNTIME_UNARY_MATH |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_MathLog) { |
|
Dmitry Lomov
2014/03/27 14:11:03
Isn't this a RUNTIME_UNARY_MATH(Log, log)?
Yang
2014/03/27 14:45:29
Correct. At some point I was playing with marking
|
| + SealHandleScope shs(isolate); |
| + ASSERT(args.length() == 1); |
| + isolate->counters()->math_log()->Increment(); |
| + CONVERT_DOUBLE_ARG_CHECKED(x, 0); |
| + return isolate->heap()->AllocateHeapNumber(std::log(x)); |
| +} |
| + |
| + |
| RUNTIME_FUNCTION(MaybeObject*, Runtime_DoubleHi) { |
| SealHandleScope shs(isolate); |
| ASSERT(args.length() == 1); |
| @@ -7807,7 +7815,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ConstructDouble) { |
| static const double kPiDividedBy4 = 0.78539816339744830962; |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_atan2) { |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_MathAtan2) { |
| SealHandleScope shs(isolate); |
| ASSERT(args.length() == 2); |
| isolate->counters()->math_atan2()->Increment(); |
| @@ -7830,7 +7838,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_atan2) { |
| } |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_exp) { |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_MathExp) { |
| SealHandleScope shs(isolate); |
| ASSERT(args.length() == 1); |
| isolate->counters()->math_exp()->Increment(); |
| @@ -7841,7 +7849,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_exp) { |
| } |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_floor) { |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_MathFloor) { |
| SealHandleScope shs(isolate); |
| ASSERT(args.length() == 1); |
| isolate->counters()->math_floor()->Increment(); |
| @@ -7853,7 +7861,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_floor) { |
| // Slow version of Math.pow. We check for fast paths for special cases. |
| // Used if SSE2/VFP3 is not available. |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) { |
| +RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_MathPowSlow) { |
| SealHandleScope shs(isolate); |
| ASSERT(args.length() == 2); |
| isolate->counters()->math_pow()->Increment(); |
| @@ -7876,7 +7884,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) { |
| // Fast version of Math.pow if we know that y is not an integer and y is not |
| // -0.5 or 0.5. Used as slow case from full codegen. |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow_cfunction) { |
| +RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_MathPow) { |
| SealHandleScope shs(isolate); |
| ASSERT(args.length() == 2); |
| isolate->counters()->math_pow()->Increment(); |
| @@ -7936,7 +7944,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RoundNumber) { |
| } |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sqrt) { |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_MathSqrt) { |
| SealHandleScope shs(isolate); |
| ASSERT(args.length() == 1); |
| isolate->counters()->math_sqrt()->Increment(); |
| @@ -7946,7 +7954,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sqrt) { |
| } |
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_fround) { |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_MathFround) { |
| SealHandleScope shs(isolate); |
| ASSERT(args.length() == 1); |