Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index deb33653f7844c70ae9d848f5a59e62cbbe43989..761e32fa2bad05db2015aaedca786922bb4574e4 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -5322,6 +5322,17 @@ ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) |
ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) |
+void Code::WipeOutHeader() { |
+ WRITE_FIELD(this, kRelocationInfoOffset, NULL); |
+ WRITE_FIELD(this, kHandlerTableOffset, NULL); |
+ WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); |
+ // Do not wipe out e.g. a minor key. |
+ if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { |
+ WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); |
+ } |
+} |
+ |
+ |
// Type feedback slot: type_feedback_info for FUNCTIONs, stub_info for STUBs. |
void Code::InitializeTypeFeedbackInfoNoWriteBarrier(Object* value) { |
WRITE_FIELD(this, kTypeFeedbackInfoOffset, value); |