Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 2c8367d7a1b26a480dd9be27dc0ff14fc2ac0fda..203ad1f6a06a576f7ccc561699c84dcf992b8d79 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -1757,11 +1757,6 @@ void Isolate::TearDown() { |
thread_data_table_->RemoveAllThreads(this); |
} |
- if (serialize_partial_snapshot_cache_ != NULL) { |
- delete[] serialize_partial_snapshot_cache_; |
- serialize_partial_snapshot_cache_ = NULL; |
- } |
- |
delete this; |
// Restore the previous current isolate. |
@@ -1825,26 +1820,6 @@ void Isolate::Deinit() { |
} |
-void Isolate::PushToPartialSnapshotCache(Object* obj) { |
- int length = serialize_partial_snapshot_cache_length(); |
- int capacity = serialize_partial_snapshot_cache_capacity(); |
- |
- if (length >= capacity) { |
- int new_capacity = static_cast<int>((capacity + 10) * 1.2); |
- Object** new_array = new Object*[new_capacity]; |
- for (int i = 0; i < length; i++) { |
- new_array[i] = serialize_partial_snapshot_cache()[i]; |
- } |
- if (capacity != 0) delete[] serialize_partial_snapshot_cache(); |
- set_serialize_partial_snapshot_cache(new_array); |
- set_serialize_partial_snapshot_cache_capacity(new_capacity); |
- } |
- |
- serialize_partial_snapshot_cache()[length] = obj; |
- set_serialize_partial_snapshot_cache_length(length + 1); |
-} |
- |
- |
void Isolate::SetIsolateThreadLocals(Isolate* isolate, |
PerIsolateThreadData* data) { |
base::Thread::SetThreadLocal(isolate_key_, isolate); |
@@ -2088,7 +2063,7 @@ bool Isolate::Init(Deserializer* des) { |
if (create_heap_objects) { |
// Terminate the cache array with the sentinel so we can iterate. |
- PushToPartialSnapshotCache(heap_.undefined_value()); |
+ partial_snapshot_cache_.Add(heap_.undefined_value()); |
} |
InitializeThreadLocal(); |