Commit c88f993f authored by ulan@chromium.org's avatar ulan@chromium.org

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
parent 508f7d25
...@@ -794,6 +794,15 @@ Deserializer::Deserializer(SnapshotByteSource* source) ...@@ -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) { void Deserializer::Deserialize(Isolate* isolate) {
isolate_ = isolate; isolate_ = isolate;
ASSERT(isolate_ != NULL); ASSERT(isolate_ != NULL);
...@@ -830,6 +839,8 @@ void Deserializer::Deserialize(Isolate* isolate) { ...@@ -830,6 +839,8 @@ void Deserializer::Deserialize(Isolate* isolate) {
} }
} }
FlushICacheForNewCodeObjects();
// Issue code events for newly deserialized code objects. // Issue code events for newly deserialized code objects.
LOG_CODE_EVENT(isolate_, LogCodeObjects()); LOG_CODE_EVENT(isolate_, LogCodeObjects());
LOG_CODE_EVENT(isolate_, LogCompiledFunctions()); LOG_CODE_EVENT(isolate_, LogCompiledFunctions());
......
...@@ -377,6 +377,7 @@ class Deserializer: public SerializerDeserializer { ...@@ -377,6 +377,7 @@ class Deserializer: public SerializerDeserializer {
return HeapObject::FromAddress(high_water_[space] - offset); return HeapObject::FromAddress(high_water_[space] - offset);
} }
void FlushICacheForNewCodeObjects();
// Cached current isolate. // Cached current isolate.
Isolate* isolate_; Isolate* isolate_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment