Reviewers: ,

Message:
With recent GC changes updating this field with compare and swap, we starting having new failures on PowerPC 64bit as that platform is alignment sensitive.

Tests such as
out/ppc64.debug/cctest  test-decls/ExistsInPrototype
were failing

This small change addresses that.

Description:
Fix alignment of Code::kConstantPoolOffset.

This is needed for 64bit alignment sensitive platforms (PowerPC)
Exposed bugs with new GC compare and swap changes updating the
field.

Example failing test:
out/ppc64.debug/cctest  test-decls/ExistsInPrototype

BUG=

Please review this at https://codereview.chromium.org/740443002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+3, -1 lines):
  M src/objects.h


Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 66b9b8d21bbf19e01a4800964f4ea76543639f96..ab3e4a343e99616cd81b1de0fe48d7cfc431c9eb 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5370,7 +5370,7 @@ class Code: public HeapObject {
       kKindSpecificFlags1Offset + kIntSize;
   // Note: We might be able to squeeze this into the flags above.
   static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize;
-  static const int kConstantPoolOffset = kPrologueOffset + kPointerSize;
+  static const int kConstantPoolOffset = kPrologueOffset + kIntSize;

static const int kHeaderPaddingStart = kConstantPoolOffset + kPointerSize;

@@ -5378,6 +5378,8 @@ class Code: public HeapObject {
   // the Code object header.
   static const int kHeaderSize =
       (kHeaderPaddingStart + kCodeAlignmentMask) & ~kCodeAlignmentMask;
+  // Ensure that the slot for the constant pool pointer is aligned.
+  STATIC_ASSERT((kConstantPoolOffset & kPointerAlignmentMask) == 0);

   // Byte offsets within kKindSpecificFlags1Offset.
   static const int kOptimizableOffset = kKindSpecificFlags1Offset;


--
--
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