Revision: 15850
Author:   [email protected]
Date:     Wed Jul 24 02:36:58 2013
Log:      Merged r15848, r15849 into trunk branch.

[email protected]
BUG=

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

Modified:
 /trunk/src/mark-compact.cc
 /trunk/src/spaces.h
 /trunk/src/version.cc

=======================================
--- /trunk/src/mark-compact.cc  Wed Jul 24 01:18:28 2013
+++ /trunk/src/mark-compact.cc  Wed Jul 24 02:36:58 2013
@@ -2722,7 +2722,23 @@
                                          int size,
                                          AllocationSpace dest) {
   HEAP_PROFILE(heap(), ObjectMoveEvent(src, dst));
-  if (dest == OLD_POINTER_SPACE || dest == LO_SPACE) {
+  // TODO(hpayer): Replace that check with an assert.
+  CHECK(dest != LO_SPACE && size <= Page::kMaxNonCodeHeapObjectSize);
+  // Objects in old pointer space and old data space can just be moved by
+  // compaction to a different page in the same space.
+  // TODO(hpayer): Replace that following checks with asserts.
+  CHECK(!heap_->old_pointer_space()->Contains(src) ||
+        (heap_->old_pointer_space()->Contains(dst) &&
+        heap_->TargetSpace(HeapObject::FromAddress(src)) ==
+        heap_->old_pointer_space()));
+  CHECK(!heap_->old_data_space()->Contains(src) ||
+        (heap_->old_data_space()->Contains(dst) &&
+        heap_->TargetSpace(HeapObject::FromAddress(src)) ==
+        heap_->old_data_space()));
+  if (dest == OLD_POINTER_SPACE) {
+    // TODO(hpayer): Replace this check with an assert.
+    CHECK(heap_->TargetSpace(HeapObject::FromAddress(src)) ==
+          heap_->old_pointer_space());
     Address src_slot = src;
     Address dst_slot = dst;
     ASSERT(IsAligned(size, kPointerSize));
@@ -2894,37 +2910,24 @@

 bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
                                             int object_size) {
-  Object* result;
+  // TODO(hpayer): Replace that check with an assert.
+  CHECK(object_size <= Page::kMaxNonCodeHeapObjectSize);

-  if (object_size > Page::kMaxNonCodeHeapObjectSize) {
-    MaybeObject* maybe_result =
-        heap()->lo_space()->AllocateRaw(object_size, NOT_EXECUTABLE);
-    if (maybe_result->ToObject(&result)) {
-      HeapObject* target = HeapObject::cast(result);
-      MigrateObject(target->address(),
-                    object->address(),
-                    object_size,
-                    LO_SPACE);
-      heap()->mark_compact_collector()->tracer()->
-          increment_promoted_objects_size(object_size);
-      return true;
-    }
-  } else {
-    OldSpace* target_space = heap()->TargetSpace(object);
+  OldSpace* target_space = heap()->TargetSpace(object);

-    ASSERT(target_space == heap()->old_pointer_space() ||
-           target_space == heap()->old_data_space());
-    MaybeObject* maybe_result = target_space->AllocateRaw(object_size);
-    if (maybe_result->ToObject(&result)) {
-      HeapObject* target = HeapObject::cast(result);
-      MigrateObject(target->address(),
-                    object->address(),
-                    object_size,
-                    target_space->identity());
-      heap()->mark_compact_collector()->tracer()->
-          increment_promoted_objects_size(object_size);
-      return true;
-    }
+  ASSERT(target_space == heap()->old_pointer_space() ||
+         target_space == heap()->old_data_space());
+  Object* result;
+  MaybeObject* maybe_result = target_space->AllocateRaw(object_size);
+  if (maybe_result->ToObject(&result)) {
+    HeapObject* target = HeapObject::cast(result);
+    MigrateObject(target->address(),
+                  object->address(),
+                  object_size,
+                  target_space->identity());
+    heap()->mark_compact_collector()->tracer()->
+        increment_promoted_objects_size(object_size);
+    return true;
   }

   return false;
=======================================
--- /trunk/src/spaces.h Fri Jul  5 00:09:57 2013
+++ /trunk/src/spaces.h Wed Jul 24 02:36:58 2013
@@ -781,7 +781,10 @@
   // Object area size in bytes.
   static const int kNonCodeObjectAreaSize = kPageSize - kObjectStartOffset;

-  // Maximum object size that fits in a page.
+  // 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.
   static const int kMaxNonCodeHeapObjectSize = kNonCodeObjectAreaSize;

   // Page size mask.
=======================================
--- /trunk/src/version.cc       Wed Jul 24 01:18:28 2013
+++ /trunk/src/version.cc       Wed Jul 24 02:36:58 2013
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     20
 #define BUILD_NUMBER      8
-#define PATCH_LEVEL       0
+#define PATCH_LEVEL       1
 // 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/groups/opt_out.


Reply via email to