Reviewers: ulan, jochen (OOO), Hannes Payer (OOO), danno, Jakob, paul.l..., akos.palfi.imgtec, balazs.kilvady,

Description:
Make NextCodeLink pointer 8-byte aligned after GC pointer updating uses atomics.

After r24737 pointer updating is done by atomic operations which strictly
require target address to be 8-byte alignment on MIPS64.

The alignment is broken on 64-bit arches because InstructionSize is first field
and has Int size.

Order of fields in object layout are changed to make kNextCodeLinkOffset
divisible by 8. The size of code object header remains the same.

TEST=cctest/test-debug/* on MIPS64
BUG=

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

Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+5, -6 lines):
  M src/mips64/builtins-mips64.cc
  M src/mips64/macro-assembler-mips64.cc
  M src/objects.h


Index: src/mips64/builtins-mips64.cc
diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc
index 51a1265604d2207448c0ba132c22974de9826bef..e5f733c1a971d8f8718dbd1f56617b62bb72f0d7 100644
--- a/src/mips64/builtins-mips64.cc
+++ b/src/mips64/builtins-mips64.cc
@@ -1044,7 +1044,7 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {

   // Load deoptimization data from the code object.
   // <deopt_data> = <code>[#deoptimization_data_offset]
- __ Uld(a1, MemOperand(v0, Code::kDeoptimizationDataOffset - kHeapObjectTag)); + __ ld(a1, MemOperand(v0, Code::kDeoptimizationDataOffset - kHeapObjectTag));

   // Load the OSR entrypoint offset from the deoptimization data.
   // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset]
Index: src/mips64/macro-assembler-mips64.cc
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc index d398f6f8a1978f73e421c9cb78c17e47dd10e7be..466906ae2daa907036524ac296c929c352fa3f90 100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -3091,7 +3091,7 @@ void MacroAssembler::JumpToHandlerEntry() {
// Compute the handler entry address and jump to it. The handler table is
   // a fixed array of (smi-tagged) code offsets.
   // v0 = exception, a1 = code object, a2 = state.
-  Uld(a3, FieldMemOperand(a1, Code::kHandlerTableOffset));
+  ld(a3, FieldMemOperand(a1, Code::kHandlerTableOffset));
   Daddu(a3, a3, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
   dsrl(a2, a2, StackHandler::kKindWidth);  // Handler index.
   dsll(a2, a2, kPointerSizeLog2);
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 6ecbdf2d8b26717a0d7df679081b556293621de2..882062d807c4851e23e9f64b9973bb431365ba6d 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5380,8 +5380,7 @@ class Code: public HeapObject {
   static const int kMaxLoopNestingMarker = 6;

   // Layout description.
-  static const int kInstructionSizeOffset = HeapObject::kHeaderSize;
- static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize;
+  static const int kRelocationInfoOffset = HeapObject::kHeaderSize;
static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize;
   static const int kDeoptimizationDataOffset =
       kHandlerTableOffset + kPointerSize;
@@ -5390,8 +5389,8 @@ class Code: public HeapObject {
       kDeoptimizationDataOffset + kPointerSize;
static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize;
   static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize;
-  static const int kICAgeOffset =
-      kGCMetadataOffset + kPointerSize;
+ static const int kInstructionSizeOffset = kGCMetadataOffset + kPointerSize;
+  static const int kICAgeOffset = kInstructionSizeOffset + kIntSize;
   static const int kFlagsOffset = kICAgeOffset + kIntSize;
   static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize;
   static const int kKindSpecificFlags2Offset =


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