Revision: 19630
Author:   [email protected]
Date:     Fri Feb 28 20:18:06 2014 UTC
Log:      Merged r19591, r19599 into 3.23 branch.

HAllocate should never generate allocation code if the requested size does not fit into page. Regression test included.

Fix representation generalization for doubles.

BUG=347543
LOG=N
[email protected]

Review URL: https://codereview.chromium.org/180703004
http://code.google.com/p/v8/source/detail?r=19630

Added:
 /branches/3.23/test/mjsunit/regress/regress-347909.js
Modified:
 /branches/3.23/src/arm/lithium-codegen-arm.cc
 /branches/3.23/src/ia32/lithium-codegen-ia32.cc
 /branches/3.23/src/mips/lithium-codegen-mips.cc
 /branches/3.23/src/property-details.h
 /branches/3.23/src/spaces.h
 /branches/3.23/src/version.cc
 /branches/3.23/src/x64/lithium-codegen-x64.cc

=======================================
--- /dev/null
+++ /branches/3.23/test/mjsunit/regress/regress-347909.js Fri Feb 28 20:18:06 2014 UTC
@@ -0,0 +1,19 @@
+// 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
+
+var a = {y:1.5};
+a.y = 0;
+var b = a.y;
+a.y = {};
+var d = 1;
+function f() {
+  d = 0;
+  return {y: b};
+}
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+f();
=======================================
--- /branches/3.23/src/arm/lithium-codegen-arm.cc Wed Jan 8 10:34:14 2014 UTC +++ /branches/3.23/src/arm/lithium-codegen-arm.cc Fri Feb 28 20:18:06 2014 UTC
@@ -5397,7 +5397,11 @@

   if (instr->size()->IsConstantOperand()) {
     int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
-    __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
+    if (size <= Page::kMaxRegularHeapObjectSize) {
+ __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
+    } else {
+      __ jmp(deferred->entry());
+    }
   } else {
     Register size = ToRegister(instr->size());
     __ Allocate(size,
=======================================
--- /branches/3.23/src/ia32/lithium-codegen-ia32.cc Tue Dec 3 08:00:39 2013 UTC +++ /branches/3.23/src/ia32/lithium-codegen-ia32.cc Fri Feb 28 20:18:06 2014 UTC
@@ -5948,7 +5948,11 @@

   if (instr->size()->IsConstantOperand()) {
     int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
-    __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
+    if (size <= Page::kMaxRegularHeapObjectSize) {
+      __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
+    } else {
+      __ jmp(deferred->entry());
+    }
   } else {
     Register size = ToRegister(instr->size());
     __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
=======================================
--- /branches/3.23/src/mips/lithium-codegen-mips.cc Wed Jan 8 21:55:03 2014 UTC +++ /branches/3.23/src/mips/lithium-codegen-mips.cc Fri Feb 28 20:18:06 2014 UTC
@@ -5350,7 +5350,11 @@
   }
   if (instr->size()->IsConstantOperand()) {
     int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
-    __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
+    if (size <= Page::kMaxRegularHeapObjectSize) {
+ __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
+    } else {
+      __ jmp(deferred->entry());
+    }
   } else {
     Register size = ToRegister(instr->size());
     __ Allocate(size,
=======================================
--- /branches/3.23/src/property-details.h       Tue Nov 26 13:50:38 2013 UTC
+++ /branches/3.23/src/property-details.h       Fri Feb 28 20:18:06 2014 UTC
@@ -137,7 +137,7 @@

     ASSERT(kind_ != kExternal);
     ASSERT(other.kind_ != kExternal);
-    if (IsHeapObject()) return other.IsDouble() || other.IsNone();
+    if (IsHeapObject()) return other.IsNone();
     if (kind_ == kUInteger8 && other.kind_ == kInteger8) return false;
     if (kind_ == kUInteger16 && other.kind_ == kInteger16) return false;
     return kind_ > other.kind_;
=======================================
--- /branches/3.23/src/spaces.h Fri Nov 15 10:32:41 2013 UTC
+++ /branches/3.23/src/spaces.h Fri Feb 28 20:18:06 2014 UTC
@@ -782,6 +782,12 @@
   // Object area size in bytes.
   static const int kNonCodeObjectAreaSize = kPageSize - kObjectStartOffset;

+ // Maximum object size that fits in a page. Objects larger than that size are + // allocated in large object space and are never moved in memory. This also + // applies to new space allocation, since objects are never migrated from new
+  // space to large object space.  Takes double alignment into account.
+ static const int kMaxRegularHeapObjectSize = kPageSize - kObjectStartOffset;
+
   // Maximum object size that fits in a page. Objects larger than that size
// are allocated in large object space and are never moved in memory. This
   // also applies to new space allocation, since objects are never migrated
=======================================
--- /branches/3.23/src/version.cc       Fri Feb 28 15:07:30 2014 UTC
+++ /branches/3.23/src/version.cc       Fri Feb 28 20:18:06 2014 UTC
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     23
 #define BUILD_NUMBER      17
-#define PATCH_LEVEL       19
+#define PATCH_LEVEL       20
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
=======================================
--- /branches/3.23/src/x64/lithium-codegen-x64.cc Tue Dec 3 08:00:39 2013 UTC +++ /branches/3.23/src/x64/lithium-codegen-x64.cc Fri Feb 28 20:18:06 2014 UTC
@@ -5150,7 +5150,11 @@

   if (instr->size()->IsConstantOperand()) {
     int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
-    __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
+    if (size <= Page::kMaxRegularHeapObjectSize) {
+      __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
+    } else {
+      __ jmp(deferred->entry());
+    }
   } else {
     Register size = ToRegister(instr->size());
     __ Allocate(size, result, temp, no_reg, deferred->entry(), flags);

--
--
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/groups/opt_out.

Reply via email to