Version 4.1.0.14 (cherry-pick)

Merged d1c1a3c48f1a5aa3e14a4bea4930e769856c0e83

[turbofan] Fix bit representation of NumberConstant.

R=jarin@chromium.org
BUG=v8:3830
LOG=y

Review URL: https://codereview.chromium.org/882013003

Cr-Commit-Position: refs/branch-heads/4.1@{#15}
Cr-Branched-From: 2e08d2a7aa9d65d269d8c57aba82eb38a8cb0a18-refs/heads/candidates@{#25353}
diff --git a/src/compiler/representation-change.h b/src/compiler/representation-change.h
index e4c257f..8720afd 100644
--- a/src/compiler/representation-change.h
+++ b/src/compiler/representation-change.h
@@ -296,6 +296,13 @@
         if (value == 0 || value == 1) return node;
         return jsgraph()->Int32Constant(1);  // value != 0
       }
+      case IrOpcode::kNumberConstant: {
+        double value = OpParameter<double>(node);
+        if (std::isnan(value) || value == 0.0) {
+          return jsgraph()->Int32Constant(0);
+        }
+        return jsgraph()->Int32Constant(1);
+      }
       case IrOpcode::kHeapConstant: {
         Handle<Object> handle = OpParameter<Unique<Object> >(node).handle();
         DCHECK(*handle == isolate()->heap()->true_value() ||
diff --git a/src/version.cc b/src/version.cc
index 514cf3f..3b1c220 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     4
 #define MINOR_VERSION     1
 #define BUILD_NUMBER      0
-#define PATCH_LEVEL       13
+#define PATCH_LEVEL       14
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
diff --git a/test/mjsunit/compiler/regress-bit-number-constant.js b/test/mjsunit/compiler/regress-bit-number-constant.js
new file mode 100644
index 0000000..d36fe30
--- /dev/null
+++ b/test/mjsunit/compiler/regress-bit-number-constant.js
@@ -0,0 +1,17 @@
+// Copyright 2015 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.
+
+var stdlib = this;
+var buffer = new ArrayBuffer(64 * 1024);
+var foreign = {}
+
+var foo = (function Module(stdlib, foreign, heap) {
+  "use asm";
+  function foo(i) {
+    return !(i ? 1 : false);
+  }
+  return {foo:foo};
+})(stdlib, foreign, buffer).foo;
+
+assertFalse(foo(1));