Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Unified Diff: src/isolate.cc

Issue 946073003: Remove reinvented wheel for partial snapshot cache. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.h ('k') | src/serialize.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/isolate.h ('k') | src/serialize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698