Revision: 23644
Author:   [email protected]
Date:     Wed Sep  3 11:55:50 2014 UTC
Log:      Version 3.28.71.7 (merged r23397)

Fixed inlining of constant values

BUG=v8:3529
LOG=Y
[email protected]

Review URL: https://codereview.chromium.org/535093002
https://code.google.com/p/v8/source/detail?r=23644

Added:
/branches/3.28/test/mjsunit/regress/regress-force-constant-representation.js
Modified:
 /branches/3.28/src/hydrogen-instructions.cc
 /branches/3.28/src/property-details-inl.h
 /branches/3.28/src/property-details.h
 /branches/3.28/src/version.cc

=======================================
--- /dev/null
+++ /branches/3.28/test/mjsunit/regress/regress-force-constant-representation.js Wed Sep 3 11:55:50 2014 UTC
@@ -0,0 +1,18 @@
+// 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
+
+// Test push double as tagged.
+var a = [{}];
+function f(a) {
+  a.push(Infinity);
+}
+
+f(a);
+f(a);
+f(a);
+%OptimizeFunctionOnNextCall(f);
+f(a);
+assertEquals([{}, Infinity, Infinity, Infinity, Infinity], a);
=======================================
--- /branches/3.28/src/hydrogen-instructions.cc Tue Aug  5 00:05:55 2014 UTC
+++ /branches/3.28/src/hydrogen-instructions.cc Wed Sep  3 11:55:50 2014 UTC
@@ -1511,17 +1511,8 @@
        HValue* value, Representation representation) {
   if (FLAG_fold_constants && value->IsConstant()) {
     HConstant* c = HConstant::cast(value);
-    if (c->HasNumberValue()) {
-      double double_res = c->DoubleValue();
-      if (representation.IsDouble()) {
-        return HConstant::New(zone, context, double_res);
-
-      } else if (representation.CanContainDouble(double_res)) {
-        return HConstant::New(zone, context,
-                              static_cast<int32_t>(double_res),
-                              representation);
-      }
-    }
+    c = c->CopyToRepresentation(representation, zone);
+    if (c != NULL) return c;
   }
   return new(zone) HForceRepresentation(value, representation);
 }
=======================================
--- /branches/3.28/src/property-details-inl.h   Wed Jun  4 00:06:13 2014 UTC
+++ /branches/3.28/src/property-details-inl.h   Wed Sep  3 11:55:50 2014 UTC
@@ -13,18 +13,6 @@
 namespace v8 {
 namespace internal {

-inline bool Representation::CanContainDouble(double value) {
-  if (IsDouble() || is_more_general_than(Representation::Double())) {
-    return true;
-  }
-  if (IsInt32Double(value)) {
-    if (IsInteger32()) return true;
-    if (IsSmi()) return Smi::IsValid(static_cast<int32_t>(value));
-  }
-  return false;
-}
-
-
 Representation Representation::FromType(Type* type) {
   DisallowHeapAllocation no_allocation;
   if (type->Is(Type::None())) return Representation::None();
=======================================
--- /branches/3.28/src/property-details.h       Tue Aug  5 00:05:55 2014 UTC
+++ /branches/3.28/src/property-details.h       Wed Sep  3 11:55:50 2014 UTC
@@ -123,8 +123,6 @@
   bool fits_into(const Representation& other) const {
     return other.is_more_general_than(*this) || other.Equals(*this);
   }
-
-  bool CanContainDouble(double value);

   Representation generalize(Representation other) {
     if (other.fits_into(*this)) return *this;
=======================================
--- /branches/3.28/src/version.cc       Mon Sep  1 11:03:15 2014 UTC
+++ /branches/3.28/src/version.cc       Wed Sep  3 11:55:50 2014 UTC
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     28
 #define BUILD_NUMBER      71
-#define PATCH_LEVEL 6
+#define PATCH_LEVEL 7
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to