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

Side by Side Diff: src/snapshot/serialize.cc

Issue 1478303002: Revert of [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/snapshot/snapshot-common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/snapshot/serialize.h" 5 #include "src/snapshot/serialize.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 // Clear literal boilerplates. 1846 // Clear literal boilerplates.
1847 if (obj->IsJSFunction() && !JSFunction::cast(obj)->shared()->bound()) { 1847 if (obj->IsJSFunction() && !JSFunction::cast(obj)->shared()->bound()) {
1848 FixedArray* literals = JSFunction::cast(obj)->literals(); 1848 FixedArray* literals = JSFunction::cast(obj)->literals();
1849 for (int i = 0; i < literals->length(); i++) literals->set_undefined(i); 1849 for (int i = 0; i < literals->length(); i++) literals->set_undefined(i);
1850 } 1850 }
1851 1851
1852 // Object has not yet been serialized. Serialize it here. 1852 // Object has not yet been serialized. Serialize it here.
1853 ObjectSerializer serializer(this, obj, sink_, how_to_code, where_to_point); 1853 ObjectSerializer serializer(this, obj, sink_, how_to_code, where_to_point);
1854 serializer.Serialize(); 1854 serializer.Serialize();
1855 1855
1856 // TODO(yangguo): We probably only need ScriptContext here for post-
1857 // processing in Genesis::HookUpGlobalThisBinding.
1858 if (obj->IsContext() && 1856 if (obj->IsContext() &&
1859 Context::cast(obj)->global_object() == global_object_) { 1857 Context::cast(obj)->global_object() == global_object_) {
1860 // Context refers to the current global object. This reference will 1858 // Context refers to the current global object. This reference will
1861 // become outdated after deserialization. 1859 // become outdated after deserialization.
1862 outdated_contexts_.Add(Context::cast(obj)); 1860 outdated_contexts_.Add(Context::cast(obj));
1863 } 1861 }
1864 } 1862 }
1865 1863
1866 1864
1867 void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space, 1865 void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space,
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 SerializedCodeData* scd = new SerializedCodeData(cached_data); 2856 SerializedCodeData* scd = new SerializedCodeData(cached_data);
2859 SanityCheckResult r = scd->SanityCheck(isolate, source); 2857 SanityCheckResult r = scd->SanityCheck(isolate, source);
2860 if (r == CHECK_SUCCESS) return scd; 2858 if (r == CHECK_SUCCESS) return scd;
2861 cached_data->Reject(); 2859 cached_data->Reject();
2862 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); 2860 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r);
2863 delete scd; 2861 delete scd;
2864 return NULL; 2862 return NULL;
2865 } 2863 }
2866 } // namespace internal 2864 } // namespace internal
2867 } // namespace v8 2865 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/snapshot/snapshot-common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698