v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mksnapshot.cc
Go to the documentation of this file.
1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #include <errno.h>
29 #include <stdio.h>
30 #ifdef COMPRESS_STARTUP_DATA_BZ2
31 #include <bzlib.h>
32 #endif
33 #include <signal.h>
34 
35 #include "v8.h"
36 
37 #include "bootstrapper.h"
38 #include "flags.h"
39 #include "natives.h"
40 #include "platform.h"
41 #include "serialize.h"
42 #include "list.h"
43 
44 using namespace v8;
45 
46 
47 class Compressor {
48  public:
49  virtual ~Compressor() {}
50  virtual bool Compress(i::Vector<char> input) = 0;
51  virtual i::Vector<char>* output() = 0;
52 };
53 
54 
56  public:
57  PartialSnapshotSink() : data_(), raw_size_(-1) { }
58  virtual ~PartialSnapshotSink() { data_.Free(); }
59  virtual void Put(int byte, const char* description) {
60  data_.Add(byte);
61  }
62  virtual int Position() { return data_.length(); }
63  void Print(FILE* fp) {
64  int length = Position();
65  for (int j = 0; j < length; j++) {
66  if ((j & 0x1f) == 0x1f) {
67  fprintf(fp, "\n");
68  }
69  if (j != 0) {
70  fprintf(fp, ",");
71  }
72  fprintf(fp, "%u", static_cast<unsigned char>(at(j)));
73  }
74  }
75  char at(int i) { return data_[i]; }
76  bool Compress(Compressor* compressor) {
77  ASSERT_EQ(-1, raw_size_);
78  raw_size_ = data_.length();
79  if (!compressor->Compress(data_.ToVector())) return false;
80  data_.Clear();
81  data_.AddAll(*compressor->output());
82  return true;
83  }
84  int raw_size() { return raw_size_; }
85 
86  private:
87  i::List<char> data_;
88  int raw_size_;
89 };
90 
91 
93  public:
94  explicit CppByteSink(const char* snapshot_file) {
95  fp_ = i::OS::FOpen(snapshot_file, "wb");
96  if (fp_ == NULL) {
97  i::PrintF("Unable to write to snapshot file \"%s\"\n", snapshot_file);
98  exit(1);
99  }
100  fprintf(fp_, "// Autogenerated snapshot file. Do not edit.\n\n");
101  fprintf(fp_, "#include \"v8.h\"\n");
102  fprintf(fp_, "#include \"platform.h\"\n\n");
103  fprintf(fp_, "#include \"snapshot.h\"\n\n");
104  fprintf(fp_, "namespace v8 {\nnamespace internal {\n\n");
105  fprintf(fp_, "const byte Snapshot::data_[] = {");
106  }
107 
108  virtual ~CppByteSink() {
109  fprintf(fp_, "const int Snapshot::size_ = %d;\n", Position());
110 #ifdef COMPRESS_STARTUP_DATA_BZ2
111  fprintf(fp_, "const byte* Snapshot::raw_data_ = NULL;\n");
112  fprintf(fp_,
113  "const int Snapshot::raw_size_ = %d;\n\n",
114  raw_size());
115 #else
116  fprintf(fp_,
117  "const byte* Snapshot::raw_data_ = Snapshot::data_;\n");
118  fprintf(fp_,
119  "const int Snapshot::raw_size_ = Snapshot::size_;\n\n");
120 #endif
121  fprintf(fp_, "} } // namespace v8::internal\n");
122  fclose(fp_);
123  }
124 
126  const char* prefix,
127  int new_space_used,
128  int pointer_space_used,
129  int data_space_used,
130  int code_space_used,
131  int map_space_used,
132  int cell_space_used,
133  int property_cell_space_used) {
134  fprintf(fp_,
135  "const int Snapshot::%snew_space_used_ = %d;\n",
136  prefix,
137  new_space_used);
138  fprintf(fp_,
139  "const int Snapshot::%spointer_space_used_ = %d;\n",
140  prefix,
141  pointer_space_used);
142  fprintf(fp_,
143  "const int Snapshot::%sdata_space_used_ = %d;\n",
144  prefix,
145  data_space_used);
146  fprintf(fp_,
147  "const int Snapshot::%scode_space_used_ = %d;\n",
148  prefix,
149  code_space_used);
150  fprintf(fp_,
151  "const int Snapshot::%smap_space_used_ = %d;\n",
152  prefix,
153  map_space_used);
154  fprintf(fp_,
155  "const int Snapshot::%scell_space_used_ = %d;\n",
156  prefix,
157  cell_space_used);
158  fprintf(fp_,
159  "const int Snapshot::%sproperty_cell_space_used_ = %d;\n",
160  prefix,
161  property_cell_space_used);
162  }
163 
165  int length = partial_sink_.Position();
166  fprintf(fp_, "};\n\n");
167  fprintf(fp_, "const int Snapshot::context_size_ = %d;\n", length);
168 #ifdef COMPRESS_STARTUP_DATA_BZ2
169  fprintf(fp_,
170  "const int Snapshot::context_raw_size_ = %d;\n",
171  partial_sink_.raw_size());
172 #else
173  fprintf(fp_,
174  "const int Snapshot::context_raw_size_ = "
175  "Snapshot::context_size_;\n");
176 #endif
177  fprintf(fp_, "const byte Snapshot::context_data_[] = {\n");
178  partial_sink_.Print(fp_);
179  fprintf(fp_, "};\n\n");
180 #ifdef COMPRESS_STARTUP_DATA_BZ2
181  fprintf(fp_, "const byte* Snapshot::context_raw_data_ = NULL;\n");
182 #else
183  fprintf(fp_, "const byte* Snapshot::context_raw_data_ ="
184  " Snapshot::context_data_;\n");
185 #endif
186  }
187 
188  void WriteSnapshot() {
189  Print(fp_);
190  }
191 
192  PartialSnapshotSink* partial_sink() { return &partial_sink_; }
193 
194  private:
195  FILE* fp_;
196  PartialSnapshotSink partial_sink_;
197 };
198 
199 
200 #ifdef COMPRESS_STARTUP_DATA_BZ2
201 class BZip2Compressor : public Compressor {
202  public:
203  BZip2Compressor() : output_(NULL) {}
204  virtual ~BZip2Compressor() {
205  delete output_;
206  }
207  virtual bool Compress(i::Vector<char> input) {
208  delete output_;
209  output_ = new i::ScopedVector<char>((input.length() * 101) / 100 + 1000);
210  unsigned int output_length_ = output_->length();
211  int result = BZ2_bzBuffToBuffCompress(output_->start(), &output_length_,
212  input.start(), input.length(),
213  9, 1, 0);
214  if (result == BZ_OK) {
215  output_->Truncate(output_length_);
216  return true;
217  } else {
218  fprintf(stderr, "bzlib error code: %d\n", result);
219  return false;
220  }
221  }
222  virtual i::Vector<char>* output() { return output_; }
223 
224  private:
225  i::ScopedVector<char>* output_;
226 };
227 
228 
229 class BZip2Decompressor : public StartupDataDecompressor {
230  public:
231  virtual ~BZip2Decompressor() { }
232 
233  protected:
234  virtual int DecompressData(char* raw_data,
235  int* raw_data_size,
236  const char* compressed_data,
237  int compressed_data_size) {
240  unsigned int decompressed_size = *raw_data_size;
241  int result =
242  BZ2_bzBuffToBuffDecompress(raw_data,
243  &decompressed_size,
244  const_cast<char*>(compressed_data),
245  compressed_data_size,
246  0, 1);
247  if (result == BZ_OK) {
248  *raw_data_size = decompressed_size;
249  }
250  return result;
251  }
252 };
253 #endif
254 
255 
257  String::Utf8Value message_string(message->Get());
258  String::Utf8Value message_line(message->GetSourceLine());
259  fprintf(stderr, "%s at line %d\n", *message_string, message->GetLineNumber());
260  fprintf(stderr, "%s\n", *message_line);
261  for (int i = 0; i <= message->GetEndColumn(); ++i) {
262  fprintf(stderr, "%c", i < message->GetStartColumn() ? ' ' : '^');
263  }
264  fprintf(stderr, "\n");
265 }
266 
267 
268 int main(int argc, char** argv) {
271 
272  // By default, log code create information in the snapshot.
273  i::FLAG_log_code = true;
274 
275  // Print the usage if an error occurs when parsing the command line
276  // flags or if the help flag is set.
277  int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
278  if (result > 0 || argc != 2 || i::FLAG_help) {
279  ::printf("Usage: %s [flag] ... outfile\n", argv[0]);
280  i::FlagList::PrintHelp();
281  return !i::FLAG_help;
282  }
283 #ifdef COMPRESS_STARTUP_DATA_BZ2
284  BZip2Decompressor natives_decompressor;
285  int bz2_result = natives_decompressor.Decompress();
286  if (bz2_result != BZ_OK) {
287  fprintf(stderr, "bzip error code: %d\n", bz2_result);
288  exit(1);
289  }
290 #endif
291  i::FLAG_logfile_per_isolate = false;
292 
293  Isolate* isolate = v8::Isolate::New();
294  isolate->Enter();
295  i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
296  i::Serializer::Enable(internal_isolate);
297  Persistent<Context> context;
298  {
299  HandleScope handle_scope(isolate);
300  context.Reset(isolate, Context::New(isolate));
301  }
302 
303  if (context.IsEmpty()) {
304  fprintf(stderr,
305  "\nException thrown while compiling natives - see above.\n\n");
306  exit(1);
307  }
308  if (i::FLAG_extra_code != NULL) {
309  // Capture 100 frames if anything happens.
311  HandleScope scope(isolate);
312  v8::Context::Scope cscope(v8::Local<v8::Context>::New(isolate, context));
313  const char* name = i::FLAG_extra_code;
314  FILE* file = i::OS::FOpen(name, "rb");
315  if (file == NULL) {
316  fprintf(stderr, "Failed to open '%s': errno %d\n", name, errno);
317  exit(1);
318  }
319 
320  fseek(file, 0, SEEK_END);
321  int size = ftell(file);
322  rewind(file);
323 
324  char* chars = new char[size + 1];
325  chars[size] = '\0';
326  for (int i = 0; i < size;) {
327  int read = static_cast<int>(fread(&chars[i], 1, size - i, file));
328  if (read < 0) {
329  fprintf(stderr, "Failed to read '%s': errno %d\n", name, errno);
330  exit(1);
331  }
332  i += read;
333  }
334  fclose(file);
335  Local<String> source = String::NewFromUtf8(isolate, chars);
336  TryCatch try_catch;
337  Local<Script> script = Script::Compile(source);
338  if (try_catch.HasCaught()) {
339  fprintf(stderr, "Failure compiling '%s'\n", name);
340  DumpException(try_catch.Message());
341  exit(1);
342  }
343  script->Run();
344  if (try_catch.HasCaught()) {
345  fprintf(stderr, "Failure running '%s'\n", name);
346  DumpException(try_catch.Message());
347  exit(1);
348  }
349  }
350  // Make sure all builtin scripts are cached.
351  { HandleScope scope(isolate);
352  for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) {
353  internal_isolate->bootstrapper()->NativesSourceLookup(i);
354  }
355  }
356  // If we don't do this then we end up with a stray root pointing at the
357  // context even after we have disposed of the context.
358  internal_isolate->heap()->CollectAllGarbage(
359  i::Heap::kNoGCFlags, "mksnapshot");
360  i::Object* raw_context = *v8::Utils::OpenPersistent(context);
361  context.Reset();
362  CppByteSink sink(argv[1]);
363  // This results in a somewhat smaller snapshot, probably because it gets rid
364  // of some things that are cached between garbage collections.
365  i::StartupSerializer ser(internal_isolate, &sink);
367 
368  i::PartialSerializer partial_ser(
369  internal_isolate, &ser, sink.partial_sink());
370  partial_ser.Serialize(&raw_context);
371 
373 
374 #ifdef COMPRESS_STARTUP_DATA_BZ2
375  BZip2Compressor compressor;
376  if (!sink.Compress(&compressor))
377  return 1;
378  if (!sink.partial_sink()->Compress(&compressor))
379  return 1;
380 #endif
381  sink.WriteSnapshot();
382  sink.WritePartialSnapshot();
383 
384  sink.WriteSpaceUsed(
385  "context_",
386  partial_ser.CurrentAllocationAddress(i::NEW_SPACE),
387  partial_ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE),
388  partial_ser.CurrentAllocationAddress(i::OLD_DATA_SPACE),
389  partial_ser.CurrentAllocationAddress(i::CODE_SPACE),
390  partial_ser.CurrentAllocationAddress(i::MAP_SPACE),
391  partial_ser.CurrentAllocationAddress(i::CELL_SPACE),
392  partial_ser.CurrentAllocationAddress(i::PROPERTY_CELL_SPACE));
393  sink.WriteSpaceUsed(
394  "",
402  isolate->Exit();
403  isolate->Dispose();
404  V8::Dispose();
405  return 0;
406 }
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
int CurrentAllocationAddress(int space)
Definition: serialize.h:473
unsigned char byte
Definition: disasm.h:33
void Dispose()
Definition: api.cc:6592
void Exit()
Definition: api.cc:6609
void PrintF(const char *format,...)
Definition: v8utils.cc:40
void CollectAllGarbage(int flags, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
Definition: heap.cc:731
void WriteSnapshot()
Definition: mksnapshot.cc:188
virtual void Serialize(Object **o)
Definition: serialize.cc:1305
bool HasCaught() const
Definition: api.cc:1901
virtual bool Compress(i::Vector< char > input)=0
Local< String > Get() const
Definition: api.cc:1989
static void SetCaptureStackTraceForUncaughtExceptions(bool capture, int frame_limit=10, StackTrace::StackTraceOptions options=StackTrace::kOverview)
Definition: api.cc:6294
static v8::internal::Handle< v8::internal::Object > OpenPersistent(const v8::Persistent< T > &persistent)
Definition: api.h:295
virtual void SerializeStrongReferences()
Definition: serialize.cc:1290
void WritePartialSnapshot()
Definition: mksnapshot.cc:164
Bootstrapper * bootstrapper()
Definition: isolate.h:858
void DumpException(Handle< Message > message)
Definition: mksnapshot.cc:256
bool Compress(Compressor *compressor)
Definition: mksnapshot.cc:76
static void SetCrashIfDefaultIsolateInitialized()
Definition: isolate.cc:182
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage message
static bool Dispose()
Definition: api.cc:5028
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
int GetEndColumn() const
Definition: api.cc:2111
T * start() const
Definition: utils.h:426
PartialSnapshotSink * partial_sink()
Definition: mksnapshot.cc:192
static const int kNoGCFlags
Definition: heap.h:1257
virtual ~CppByteSink()
Definition: mksnapshot.cc:108
static FILE * FOpen(const char *path, const char *mode)
static Isolate * New()
Definition: api.cc:6586
int main(int argc, char **argv)
Definition: mksnapshot.cc:268
static Local< Script > Compile(Handle< String > source, ScriptOrigin *origin=NULL, ScriptData *script_data=NULL)
Definition: api.cc:1832
Handle< String > NativesSourceLookup(int index)
Definition: bootstrapper.cc:79
int length() const
Definition: utils.h:420
void Enter()
Definition: api.cc:6603
Definition: v8.h:123
int GetLineNumber() const
Definition: api.cc:2061
static void Enable(Isolate *isolate)
Definition: serialize.cc:761
static Local< Context > New(Isolate *isolate, ExtensionConfiguration *extensions=NULL, Handle< ObjectTemplate > global_template=Handle< ObjectTemplate >(), Handle< Value > global_object=Handle< Value >())
Definition: api.cc:5188
virtual ~Compressor()
Definition: mksnapshot.cc:49
void WriteSpaceUsed(const char *prefix, int new_space_used, int pointer_space_used, int data_space_used, int code_space_used, int map_space_used, int cell_space_used, int property_cell_space_used)
Definition: mksnapshot.cc:125
virtual ~PartialSnapshotSink()
Definition: mksnapshot.cc:58
V8_INLINE bool IsEmpty() const
Definition: v8.h:497
V8_INLINE void Reset()
Definition: v8.h:5808
static bool InitializeICU(const char *icu_data_file=NULL)
Definition: api.cc:5115
#define ASSERT_EQ(v1, v2)
Definition: checks.h:330
virtual void Put(int byte, const char *description)
Definition: mksnapshot.cc:59
void Print(const v8::FunctionCallbackInfo< v8::Value > &args)
Local< Value > Run()
Definition: api.cc:1686
CppByteSink(const char *snapshot_file)
Definition: mksnapshot.cc:94
const Register fp
void Print(FILE *fp)
Definition: mksnapshot.cc:63
virtual i::Vector< char > * output()=0
char at(int i)
Definition: mksnapshot.cc:75
static StartupData::CompressionAlgorithm GetCompressedStartupDataAlgorithm()
Definition: api.cc:306
virtual int Position()
Definition: mksnapshot.cc:62
Definition: v8.h:124
Local< v8::Message > Message() const
Definition: api.cc:1953
Local< String > GetSourceLine() const
Definition: api.cc:2143
static Local< String > NewFromUtf8(Isolate *isolate, const char *data, NewStringType type=kNormalString, int length=-1)
Definition: api.cc:5417