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

Side by Side Diff: src/snapshot/snapshot-common.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/snapshot/serialize.cc ('k') | src/x64/builtins-x64.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 // The common functionality when building with or without snapshots. 5 // The common functionality when building with or without snapshots.
6 6
7 #include "src/snapshot/snapshot.h" 7 #include "src/snapshot/snapshot.h"
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const v8::StartupData* blob = isolate->snapshot_blob(); 75 const v8::StartupData* blob = isolate->snapshot_blob();
76 Vector<const byte> context_data = ExtractContextData(blob); 76 Vector<const byte> context_data = ExtractContextData(blob);
77 SnapshotData snapshot_data(context_data); 77 SnapshotData snapshot_data(context_data);
78 Deserializer deserializer(&snapshot_data); 78 Deserializer deserializer(&snapshot_data);
79 79
80 MaybeHandle<Object> maybe_context = deserializer.DeserializePartial( 80 MaybeHandle<Object> maybe_context = deserializer.DeserializePartial(
81 isolate, global_proxy, outdated_contexts_out); 81 isolate, global_proxy, outdated_contexts_out);
82 Handle<Object> result; 82 Handle<Object> result;
83 if (!maybe_context.ToHandle(&result)) return MaybeHandle<Context>(); 83 if (!maybe_context.ToHandle(&result)) return MaybeHandle<Context>();
84 CHECK(result->IsContext()); 84 CHECK(result->IsContext());
85 // If the snapshot does not contain a custom script, we need to update
86 // the global object for exactly two contexts: the builtins context and the
87 // script context that has the global "this" binding.
88 CHECK(EmbedsScript(isolate) || (*outdated_contexts_out)->length() == 2);
89 if (FLAG_profile_deserialization) { 85 if (FLAG_profile_deserialization) {
90 double ms = timer.Elapsed().InMillisecondsF(); 86 double ms = timer.Elapsed().InMillisecondsF();
91 int bytes = context_data.length(); 87 int bytes = context_data.length();
92 PrintF("[Deserializing context (%d bytes) took %0.3f ms]\n", bytes, ms); 88 PrintF("[Deserializing context (%d bytes) took %0.3f ms]\n", bytes, ms);
93 } 89 }
94 return Handle<Context>::cast(result); 90 return Handle<Context>::cast(result);
95 } 91 }
96 92
97 93
98 void CalculateFirstPageSizes(bool is_default_snapshot, 94 void CalculateFirstPageSizes(bool is_default_snapshot,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 memcpy(&startup_length, data->data + kStartupLengthOffset, kIntSize); 224 memcpy(&startup_length, data->data + kStartupLengthOffset, kIntSize);
229 int context_offset = ContextOffset(startup_length); 225 int context_offset = ContextOffset(startup_length);
230 const byte* context_data = 226 const byte* context_data =
231 reinterpret_cast<const byte*>(data->data + context_offset); 227 reinterpret_cast<const byte*>(data->data + context_offset);
232 DCHECK_LT(context_offset, data->raw_size); 228 DCHECK_LT(context_offset, data->raw_size);
233 int context_length = data->raw_size - context_offset; 229 int context_length = data->raw_size - context_offset;
234 return Vector<const byte>(context_data, context_length); 230 return Vector<const byte>(context_data, context_length);
235 } 231 }
236 } // namespace internal 232 } // namespace internal
237 } // namespace v8 233 } // namespace v8
OLDNEW
« no previous file with comments | « src/snapshot/serialize.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698