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

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

Issue 1480003002: [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: Add patch from Orion for interpreter cementation test. Disable obsolete/invalid tests. 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.
1856 if (obj->IsContext() && 1858 if (obj->IsContext() &&
1857 Context::cast(obj)->global_object() == global_object_) { 1859 Context::cast(obj)->global_object() == global_object_) {
1858 // Context refers to the current global object. This reference will 1860 // Context refers to the current global object. This reference will
1859 // become outdated after deserialization. 1861 // become outdated after deserialization.
1860 outdated_contexts_.Add(Context::cast(obj)); 1862 outdated_contexts_.Add(Context::cast(obj));
1861 } 1863 }
1862 } 1864 }
1863 1865
1864 1866
1865 void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space, 1867 void Serializer::ObjectSerializer::SerializePrologue(AllocationSpace space,
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
2856 SerializedCodeData* scd = new SerializedCodeData(cached_data); 2858 SerializedCodeData* scd = new SerializedCodeData(cached_data);
2857 SanityCheckResult r = scd->SanityCheck(isolate, source); 2859 SanityCheckResult r = scd->SanityCheck(isolate, source);
2858 if (r == CHECK_SUCCESS) return scd; 2860 if (r == CHECK_SUCCESS) return scd;
2859 cached_data->Reject(); 2861 cached_data->Reject();
2860 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); 2862 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r);
2861 delete scd; 2863 delete scd;
2862 return NULL; 2864 return NULL;
2863 } 2865 }
2864 } // namespace internal 2866 } // namespace internal
2865 } // namespace v8 2867 } // 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