This way we get all the Crankshaft goodness and avoid always going
through the runtime: Less code + even some small speedup in Kraken.
R=jkummerow@chromium.org
Review URL: https://codereview.chromium.org/
88053002
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18072
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
// ECMA 262 - 15.8.2.6
function MathCeil(x) {
- return %Math_ceil(TO_NUMBER_INLINE(x));
+ return -MathFloor(-x);
}
// ECMA 262 - 15.8.2.7
"imul", MathImul
));
+ %SetInlineBuiltinFlag(MathCeil);
%SetInlineBuiltinFlag(MathRandom);
%SetInlineBuiltinFlag(MathSin);
%SetInlineBuiltinFlag(MathCos);
}
-RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_ceil) {
- SealHandleScope shs(isolate);
- ASSERT(args.length() == 1);
- isolate->counters()->math_ceil()->Increment();
-
- CONVERT_DOUBLE_ARG_CHECKED(x, 0);
- return isolate->heap()->NumberFromDouble(ceiling(x));
-}
-
-
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_cos) {
SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
F(Math_asin, 1, 1) \
F(Math_atan, 1, 1) \
F(Math_atan2, 2, 1) \
- F(Math_ceil, 1, 1) \
F(Math_cos, 1, 1) \
F(Math_exp, 1, 1) \
F(Math_floor, 1, 1) \
SC(math_asin, V8.MathAsin) \
SC(math_atan, V8.MathAtan) \
SC(math_atan2, V8.MathAtan2) \
- SC(math_ceil, V8.MathCeil) \
SC(math_cos, V8.MathCos) \
SC(math_exp, V8.MathExp) \
SC(math_floor, V8.MathFloor) \