41 static void ReserveSpaceForSnapshot(Deserializer* deserializer,
42 const char* file_name) {
43 int file_name_length =
StrLength(file_name) + 10;
48 int new_size, pointer_size, data_size, code_size, map_size, cell_size;
52 #define fscanf fscanf_s
54 CHECK_EQ(1, fscanf(fp,
"new %d\n", &new_size));
55 CHECK_EQ(1, fscanf(fp,
"pointer %d\n", &pointer_size));
56 CHECK_EQ(1, fscanf(fp,
"data %d\n", &data_size));
57 CHECK_EQ(1, fscanf(fp,
"code %d\n", &code_size));
58 CHECK_EQ(1, fscanf(fp,
"map %d\n", &map_size));
59 CHECK_EQ(1, fscanf(fp,
"cell %d\n", &cell_size));
64 deserializer->set_reservation(
NEW_SPACE, new_size);
67 deserializer->set_reservation(
CODE_SPACE, code_size);
68 deserializer->set_reservation(
MAP_SPACE, map_size);
69 deserializer->set_reservation(
CELL_SPACE, cell_size);
74 void Snapshot::ReserveSpaceForLinkedInSnapshot(Deserializer* deserializer) {
75 deserializer->set_reservation(
NEW_SPACE, new_space_used_);
78 deserializer->set_reservation(
CODE_SPACE, code_space_used_);
79 deserializer->set_reservation(
MAP_SPACE, map_space_used_);
80 deserializer->set_reservation(
CELL_SPACE, cell_space_used_);
88 if (!str)
return false;
93 ReserveSpaceForSnapshot(&deserializer, snapshot_file);
98 }
else if (size_ > 0) {
101 ReserveSpaceForLinkedInSnapshot(&deserializer);
114 if (context_size_ == 0) {
128 CHECK(root->IsContext());
static bool Initialize(Deserializer *des)
#define CHECK_EQ(expected, value)
static Handle< Context > NewContextFromSnapshot()
static Context * cast(Object *context)
void DeserializePartial(Object **root)
byte * ReadBytes(const char *filename, int *size, bool verbose)
void set_reservation(int space_number, int reservation)
static FILE * FOpen(const char *path, const char *mode)
static Vector< T > New(int length)
#define CHECK_NE(unexpected, value)
int StrLength(const char *string)
static int SNPrintF(Vector< char > str, const char *format,...)
static bool HaveASnapshotToStartFrom()
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit 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 SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available 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 MIPS FPU instructions if NULL
void DeleteArray(T *array)
static bool Initialize(const char *snapshot_file=NULL)