Add I-cache flushing to Code::Relocate. No need to call it
authorkasperl@chromium.org <kasperl@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 5 Sep 2008 11:23:00 +0000 (11:23 +0000)
committerkasperl@chromium.org <kasperl@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 5 Sep 2008 11:23:00 +0000 (11:23 +0000)
from Heap::CopyCode anymore.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@161 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

AUTHORS
src/heap.cc
src/objects.cc

diff --git a/AUTHORS b/AUTHORS
index fc32ddc..2e85278 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,3 +7,4 @@ Google Inc.
 
 Rene Rebe <rene@exactcode.de>
 Rafal Krypa <rafal@krypa.net>
+Jay Freeman <saurik@saurik.com>
index b04b4c1..395a6b0 100644 (file)
@@ -1530,9 +1530,6 @@ Object* Heap::CreateCode(const CodeDesc& desc,
 #ifdef DEBUG
   code->Verify();
 #endif
-
-  CPU::FlushICache(code->instruction_start(), code->instruction_size());
-
   return code;
 }
 
@@ -1553,9 +1550,6 @@ Object* Heap::CopyCode(Code* code) {
   // Relocate the copy.
   Code* new_code = Code::cast(result);
   new_code->Relocate(new_addr - old_addr);
-
-  CPU::FlushICache(new_code->instruction_start(), new_code->instruction_size());
-
   return new_code;
 }
 
index 2be4ccd..00ee12a 100644 (file)
@@ -4072,6 +4072,7 @@ void Code::Relocate(int delta) {
   for (RelocIterator it(this, RelocInfo::kApplyMask); !it.done(); it.next()) {
     it.rinfo()->apply(delta);
   }
+  CPU::FlushICache(instruction_start(), instruction_size());
 }
 
 
@@ -4112,6 +4113,7 @@ void Code::CopyFrom(const CodeDesc& desc) {
       it.rinfo()->apply(delta);
     }
   }
+  CPU::FlushICache(instruction_start(), instruction_size());
 }