Flush instruction cache for deserialized code objects.
authorulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 16 Dec 2013 13:08:24 +0000 (13:08 +0000)
committerulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 16 Dec 2013 13:08:24 +0000 (13:08 +0000)
This fixes the flaky crashes on ARM when running preparser test suite in
optdebug mode.

R=svenpanne@chromium.org

Review URL: https://chromiumcodereview.appspot.com/107543003

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

src/serialize.cc
src/serialize.h

index a8df238..a0a66f9 100644 (file)
@@ -794,6 +794,15 @@ Deserializer::Deserializer(SnapshotByteSource* source)
 }
 
 
+void Deserializer::FlushICacheForNewCodeObjects() {
+  PageIterator it(isolate_->heap()->code_space());
+  while (it.has_next()) {
+    Page* p = it.next();
+    CPU::FlushICache(p->area_start(), p->area_end() - p->area_start());
+  }
+}
+
+
 void Deserializer::Deserialize(Isolate* isolate) {
   isolate_ = isolate;
   ASSERT(isolate_ != NULL);
@@ -830,6 +839,8 @@ void Deserializer::Deserialize(Isolate* isolate) {
     }
   }
 
+  FlushICacheForNewCodeObjects();
+
   // Issue code events for newly deserialized code objects.
   LOG_CODE_EVENT(isolate_, LogCodeObjects());
   LOG_CODE_EVENT(isolate_, LogCompiledFunctions());
index 90f78bf..ee9df39 100644 (file)
@@ -377,6 +377,7 @@ class Deserializer: public SerializerDeserializer {
     return HeapObject::FromAddress(high_water_[space] - offset);
   }
 
+  void FlushICacheForNewCodeObjects();
 
   // Cached current isolate.
   Isolate* isolate_;