LOG=y
BUG=347906
R=yangguo@chromium.org
Review URL: https://codereview.chromium.org/
184353002
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19609
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
case kMathFloor:
return H_CONSTANT_DOUBLE(std::floor(d));
case kMathClz32: {
- uint32_t i = static_cast<uint32_t>(constant->Integer32Value());
+ uint32_t i = DoubleToUint32(d);
return H_CONSTANT_INT(
(i == 0) ? 32 : CompilerIntrinsics::CountLeadingZeros(i));
}
--- /dev/null
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax --harmony
+
+function foo() {
+ return Math.clz32(12.34);
+}
+
+foo();
+foo();
+%OptimizeFunctionOnNextCall(foo);
+foo();