Index: src/heap/mark-compact-inl.h |
diff --git a/src/heap/mark-compact-inl.h b/src/heap/mark-compact-inl.h |
index a539c64b1408bb4b881c80154028d480e64aaa02..6e3ebd7fc7ffbee83b1209679bd9d87e65a0f77c 100644 |
--- a/src/heap/mark-compact-inl.h |
+++ b/src/heap/mark-compact-inl.h |
@@ -99,6 +99,14 @@ |
} |
+void CodeFlusher::AddOptimizedCodeMap(SharedFunctionInfo* code_map_holder) { |
+ if (GetNextCodeMap(code_map_holder)->IsUndefined()) { |
+ SetNextCodeMap(code_map_holder, optimized_code_map_holder_head_); |
+ optimized_code_map_holder_head_ = code_map_holder; |
+ } |
+} |
+ |
+ |
JSFunction** CodeFlusher::GetNextCandidateSlot(JSFunction* candidate) { |
return reinterpret_cast<JSFunction**>( |
HeapObject::RawField(candidate, JSFunction::kNextFunctionLinkOffset)); |
@@ -140,6 +148,26 @@ |
candidate->code()->set_gc_metadata(NULL, SKIP_WRITE_BARRIER); |
} |
+ |
+SharedFunctionInfo* CodeFlusher::GetNextCodeMap(SharedFunctionInfo* holder) { |
+ FixedArray* code_map = FixedArray::cast(holder->optimized_code_map()); |
+ Object* next_map = code_map->get(SharedFunctionInfo::kNextMapIndex); |
+ return reinterpret_cast<SharedFunctionInfo*>(next_map); |
+} |
+ |
+ |
+void CodeFlusher::SetNextCodeMap(SharedFunctionInfo* holder, |
+ SharedFunctionInfo* next_holder) { |
+ FixedArray* code_map = FixedArray::cast(holder->optimized_code_map()); |
+ code_map->set(SharedFunctionInfo::kNextMapIndex, next_holder); |
+} |
+ |
+ |
+void CodeFlusher::ClearNextCodeMap(SharedFunctionInfo* holder) { |
+ FixedArray* code_map = FixedArray::cast(holder->optimized_code_map()); |
+ code_map->set_undefined(SharedFunctionInfo::kNextMapIndex); |
+} |
+ |
} // namespace internal |
} // namespace v8 |