OLD | NEW |
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/v8.h" | 7 #include "src/v8.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" |
11 #include "src/full-codegen.h" | 11 #include "src/full-codegen/full-codegen.h" |
12 #include "src/snapshot/snapshot.h" | 12 #include "src/snapshot/snapshot.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 #ifdef DEBUG | 17 #ifdef DEBUG |
18 bool Snapshot::SnapshotIsValid(v8::StartupData* snapshot_blob) { | 18 bool Snapshot::SnapshotIsValid(v8::StartupData* snapshot_blob) { |
19 return !Snapshot::ExtractStartupData(snapshot_blob).is_empty() && | 19 return !Snapshot::ExtractStartupData(snapshot_blob).is_empty() && |
20 !Snapshot::ExtractContextData(snapshot_blob).is_empty(); | 20 !Snapshot::ExtractContextData(snapshot_blob).is_empty(); |
21 } | 21 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 memcpy(&startup_length, data->data + kStartupLengthOffset, kIntSize); | 222 memcpy(&startup_length, data->data + kStartupLengthOffset, kIntSize); |
223 int context_offset = ContextOffset(startup_length); | 223 int context_offset = ContextOffset(startup_length); |
224 const byte* context_data = | 224 const byte* context_data = |
225 reinterpret_cast<const byte*>(data->data + context_offset); | 225 reinterpret_cast<const byte*>(data->data + context_offset); |
226 DCHECK_LT(context_offset, data->raw_size); | 226 DCHECK_LT(context_offset, data->raw_size); |
227 int context_length = data->raw_size - context_offset; | 227 int context_length = data->raw_size - context_offset; |
228 return Vector<const byte>(context_data, context_length); | 228 return Vector<const byte>(context_data, context_length); |
229 } | 229 } |
230 } // namespace internal | 230 } // namespace internal |
231 } // namespace v8 | 231 } // namespace v8 |
OLD | NEW |