Reviewers: William Hesse,

Message:
Small review.

Description:
X64: Fix bad value in stack layout constants.
Remove references to Array:kHeaderSize.

Please review this at http://codereview.chromium.org/150098

Affected files:
   M src/mark-compact.cc
   M src/spaces.h
   M src/spaces.cc
   M src/x64/frames-x64.h


Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index  
89d97e925e5f94f354b2770f85a244da77d14138..5e46f2ac3f886d6fd18be28b7206224373f67cd9
  
100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1141,7 +1141,7 @@ static void SweepSpace(NewSpace* space) {
        // We give non-live objects a map that will correctly give their  
size,
        // since their existing map might not be live after the collection.
        int size = object->Size();
-      if (size >= Array::kHeaderSize) {
+      if (size >= ByteArray::kHeaderSize) {
          object->set_map(Heap::byte_array_map());
          ByteArray::cast(object)->set_length(ByteArray::LengthFor(size));
        } else {
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index  
72b028cde61bcd4d6bb691371586a80baad9ba65..077bcab89d2975d8d166038f5110223bd2c5bbde
  
100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1265,7 +1265,7 @@ void FreeListNode::set_size(int size_in_bytes) {
    // If the block is too small (eg, one or two words), to hold both a size
    // field and a next pointer, we give it a filler map that gives it the
    // correct size.
-  if (size_in_bytes > Array::kHeaderSize) {
+  if (size_in_bytes > ByteArray::kHeaderSize) {
      set_map(Heap::byte_array_map());
      ByteArray::cast(this)->set_length(ByteArray::LengthFor(size_in_bytes));
    } else if (size_in_bytes == kPointerSize) {
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index  
0538c5f36676df57fa46f8bc384f34e37acb510d..8ce807fcd48b4ee571463d1057ed803c1933f50a
  
100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1270,7 +1270,7 @@ class FreeListNode: public HeapObject {
    inline void set_next(Address next);

   private:
-  static const int kNextOffset = Array::kHeaderSize;
+  static const int kNextOffset =  
POINTER_SIZE_ALIGN(ByteArray::kHeaderSize);

    DISALLOW_IMPLICIT_CONSTRUCTORS(FreeListNode);
  };
@@ -1304,7 +1304,8 @@ class OldSpaceFreeList BASE_EMBEDDED {
   private:
    // The size range of blocks, in bytes. (Smaller allocations are allowed,  
but
    // will always result in waste.)
-  static const int kMinBlockSize = Array::kHeaderSize + kPointerSize;
+  static const int kMinBlockSize =
+      POINTER_SIZE_ALIGN(ByteArray::kHeaderSize) + kPointerSize;
    static const int kMaxBlockSize = Page::kMaxHeapObjectSize;

    // The identity of the owning space, for building allocation Failure
Index: src/x64/frames-x64.h
diff --git a/src/x64/frames-x64.h b/src/x64/frames-x64.h
index  
d4ab2c62e7c7131171153410e5978689de1989ea..24c78da99e251029c0483484cb2575fd80276bae
  
100644
--- a/src/x64/frames-x64.h
+++ b/src/x64/frames-x64.h
@@ -59,12 +59,7 @@ class StackHandlerConstants : public AllStatic {

  class EntryFrameConstants : public AllStatic {
   public:
-  static const int kCallerFPOffset      = -6 * kPointerSize;
-
-  static const int kFunctionArgOffset   = +3 * kPointerSize;
-  static const int kReceiverArgOffset   = +4 * kPointerSize;
-  static const int kArgcOffset          = +5 * kPointerSize;
-  static const int kArgvOffset          = +6 * kPointerSize;
+  static const int kCallerFPOffset      = -10 * kPointerSize;
  };





--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to