2008-09-09 20:08:45 +00:00
|
|
|
// Copyright 2006-2008 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2008-07-03 15:10:15 +00:00
|
|
|
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/isolate.h"
|
2011-03-18 20:35:07 +00:00
|
|
|
|
2008-07-03 15:10:15 +00:00
|
|
|
#ifndef V8_SNAPSHOT_H_
|
|
|
|
#define V8_SNAPSHOT_H_
|
|
|
|
|
2009-05-25 10:05:56 +00:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
2008-07-03 15:10:15 +00:00
|
|
|
|
2011-05-23 12:59:02 +00:00
|
|
|
class Snapshot {
|
2008-07-03 15:10:15 +00:00
|
|
|
public:
|
2014-09-19 08:01:35 +00:00
|
|
|
// Initialize the Isolate from the internal snapshot. Returns false if no
|
|
|
|
// snapshot could be found.
|
|
|
|
static bool Initialize(Isolate* isolate);
|
2008-07-03 15:10:15 +00:00
|
|
|
|
2012-06-19 18:38:03 +00:00
|
|
|
static bool HaveASnapshotToStartFrom();
|
|
|
|
|
2014-12-09 16:19:40 +00:00
|
|
|
// Create a new context using the internal partial snapshot.
|
|
|
|
static Handle<Context> NewContextFromSnapshot(Isolate* isolate);
|
2010-03-23 11:40:38 +00:00
|
|
|
|
2008-07-03 15:10:15 +00:00
|
|
|
private:
|
2014-12-09 16:19:40 +00:00
|
|
|
static const byte data_[];
|
|
|
|
static const int size_;
|
|
|
|
static const byte context_data_[];
|
|
|
|
static const int context_size_;
|
|
|
|
|
2008-07-03 15:10:15 +00:00
|
|
|
DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot);
|
|
|
|
};
|
|
|
|
|
2014-06-23 13:52:17 +00:00
|
|
|
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
|
|
|
|
void SetSnapshotFromFile(StartupData* snapshot_blob);
|
|
|
|
#endif
|
|
|
|
|
2008-07-03 15:10:15 +00:00
|
|
|
} } // namespace v8::internal
|
|
|
|
|
|
|
|
#endif // V8_SNAPSHOT_H_
|