From: ulan@chromium.org Date: Mon, 16 Dec 2013 13:08:24 +0000 (+0000) Subject: Flush instruction cache for deserialized code objects. X-Git-Tag: upstream/4.7.83~11375 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c88f993ffcae8797e5770ee77e207e9dc9fa3dc2;p=platform%2Fupstream%2Fv8.git Flush instruction cache for deserialized code objects. 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 --- diff --git a/src/serialize.cc b/src/serialize.cc index a8df238..a0a66f9 100644 --- a/src/serialize.cc +++ b/src/serialize.cc @@ -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()); diff --git a/src/serialize.h b/src/serialize.h index 90f78bf..ee9df39 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -377,6 +377,7 @@ class Deserializer: public SerializerDeserializer { return HeapObject::FromAddress(high_water_[space] - offset); } + void FlushICacheForNewCodeObjects(); // Cached current isolate. Isolate* isolate_;