Revision: 3161
Author: [email protected]
Date: Wed Oct 28 05:37:54 2009
Log: * Fix new snapshot code on ARM.
Review URL: http://codereview.chromium.org/344011
http://code.google.com/p/v8/source/detail?r=3161

Modified:
  /branches/bleeding_edge/src/arm/assembler-arm-inl.h
  /branches/bleeding_edge/src/arm/assembler-arm.h
  /branches/bleeding_edge/src/ia32/assembler-ia32.h
  /branches/bleeding_edge/src/serialize.cc
  /branches/bleeding_edge/src/x64/assembler-x64.h
  /branches/bleeding_edge/test/cctest/cctest.status

=======================================
--- /branches/bleeding_edge/src/arm/assembler-arm-inl.h Thu Oct 15 04:52:53  
2009
+++ /branches/bleeding_edge/src/arm/assembler-arm-inl.h Wed Oct 28 05:37:54  
2009
@@ -243,6 +243,12 @@
  Address Assembler::target_address_at(Address pc) {
    return Memory::Address_at(target_address_address_at(pc));
  }
+
+
+void Assembler::set_target_at(Address constant_pool_entry,
+                              Address target) {
+  Memory::Address_at(constant_pool_entry) = target;
+}


  void Assembler::set_target_address_at(Address pc, Address target) {
=======================================
--- /branches/bleeding_edge/src/arm/assembler-arm.h     Tue Oct 27 04:54:01 2009
+++ /branches/bleeding_edge/src/arm/assembler-arm.h     Wed Oct 28 05:37:54 2009
@@ -437,6 +437,9 @@
    INLINE(static Address target_address_at(Address pc));
    INLINE(static void set_target_address_at(Address pc, Address target));

+  // Modify the code target address in a constant pool entry.
+  inline static void set_target_at(Address constant_pool_entry, Address  
target);
+
    // Here we are patching the address in the constant pool, not the actual  
call
    // instruction.  The address in the constant pool is the same size as a
    // pointer.
=======================================
--- /branches/bleeding_edge/src/ia32/assembler-ia32.h   Tue Oct 27 04:54:01  
2009
+++ /branches/bleeding_edge/src/ia32/assembler-ia32.h   Wed Oct 28 05:37:54  
2009
@@ -438,6 +438,12 @@
    // Read/Modify the code target in the branch/call instruction at pc.
    inline static Address target_address_at(Address pc);
    inline static void set_target_address_at(Address pc, Address target);
+
+  // This sets the branch destination (which is in the instruction on x86).
+  inline static void set_target_at(Address instruction_payload,
+                                   Address target) {
+    set_target_address_at(instruction_payload, target);
+  }

    static const int kCallTargetSize = kPointerSize;

=======================================
--- /branches/bleeding_edge/src/serialize.cc    Tue Oct 27 04:54:01 2009
+++ /branches/bleeding_edge/src/serialize.cc    Wed Oct 28 05:37:54 2009
@@ -1949,8 +1949,8 @@
          Code* code_object = reinterpret_cast<Code*>(new_code_object);
          // Setting a branch/call to another code object from code.
          Address location_of_branch_data =  
reinterpret_cast<Address>(current);
-        Assembler::set_target_address_at(location_of_branch_data,
-                                         code_object->instruction_start());
+        Assembler::set_target_at(location_of_branch_data,
+                                 code_object->instruction_start());
          location_of_branch_data += Assembler::kCallTargetSize;
          current = reinterpret_cast<Object**>(location_of_branch_data);
          break;
@@ -1972,8 +1972,8 @@
          Code* code_object =  
reinterpret_cast<Code*>(GetAddress(backref_space));
          // Setting a branch/call to previously decoded code object from  
code.
          Address location_of_branch_data =  
reinterpret_cast<Address>(current);
-        Assembler::set_target_address_at(location_of_branch_data,
-                                         code_object->instruction_start());
+        Assembler::set_target_at(location_of_branch_data,
+                                 code_object->instruction_start());
          location_of_branch_data += Assembler::kCallTargetSize;
          current = reinterpret_cast<Object**>(location_of_branch_data);
          break;
@@ -2173,6 +2173,8 @@
    Address object_start = object_->address();
    int up_to_offset = up_to - object_start;
    int skipped = up_to_offset - bytes_processed_so_far_;
+  // This assert will fail if the reloc info gives us the  
target_address_address
+  // locations in a non-ascending order.  Luckily that doesn't happen.
    ASSERT(skipped >= 0);
    if (skipped != 0) {
      sink_->Put(RAW_DATA_SERIALIZATION, "raw data");
=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.h     Tue Oct 27 04:54:01 2009
+++ /branches/bleeding_edge/src/x64/assembler-x64.h     Wed Oct 28 05:37:54 2009
@@ -458,6 +458,11 @@
    // the relative displacements stored in the code.
    static inline Address target_address_at(Address pc);
    static inline void set_target_address_at(Address pc, Address target);
+  // This sets the branch destination (which is in the instruction on x64).
+  inline static void set_target_at(Address instruction_payload,
+                                   Address target) {
+    set_target_address_at(instruction_payload, target);
+  }
    inline Handle<Object> code_target_object_handle_at(Address pc);
    // Number of bytes taken up by the branch target in the code.
    static const int kCallTargetSize = 4;  // Use 32-bit displacement.
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.status   Tue Oct 27 04:54:01  
2009
+++ /branches/bleeding_edge/test/cctest/cctest.status   Wed Oct 28 05:37:54  
2009
@@ -47,10 +47,6 @@

  [ $arch == arm ]

-# New serialization doesn't work on ARM yet.
-test-serialize/Deserialize2: SKIP
-test-serialize/DeserializeAndRunScript2: SKIP
-
  # BUG(113): Test seems flaky on ARM.
  test-spaces/LargeObjectSpace: PASS || FAIL


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

Reply via email to