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 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 63 matching lines...) Loading... | |
74 void Snapshot::ReserveSpaceForLinkedInSnapshot(Deserializer* deserializer) { | 74 void Snapshot::ReserveSpaceForLinkedInSnapshot(Deserializer* deserializer) { |
75 deserializer->set_reservation(NEW_SPACE, new_space_used_); | 75 deserializer->set_reservation(NEW_SPACE, new_space_used_); |
76 deserializer->set_reservation(OLD_POINTER_SPACE, pointer_space_used_); | 76 deserializer->set_reservation(OLD_POINTER_SPACE, pointer_space_used_); |
77 deserializer->set_reservation(OLD_DATA_SPACE, data_space_used_); | 77 deserializer->set_reservation(OLD_DATA_SPACE, data_space_used_); |
78 deserializer->set_reservation(CODE_SPACE, code_space_used_); | 78 deserializer->set_reservation(CODE_SPACE, code_space_used_); |
79 deserializer->set_reservation(MAP_SPACE, map_space_used_); | 79 deserializer->set_reservation(MAP_SPACE, map_space_used_); |
80 deserializer->set_reservation(CELL_SPACE, cell_space_used_); | 80 deserializer->set_reservation(CELL_SPACE, cell_space_used_); |
81 } | 81 } |
82 | 82 |
83 | 83 |
84 bool Snapshot::Initialize(const char* snapshot_file) { | 84 bool Snapshot::Initialize(const char* snapshot_file) { |
danno
2013/06/13 15:33:44
If you need the isolate, you should pass it in as
Sigurður Ásgeirsson
2013/06/19 20:51:51
Moved this to the sole non-test user of this funct
| |
85 // If the isolate has a function entry hook, it needs to re-build all its | |
86 // code stubs with entry hooks embedded. | |
87 Isolate* isolate = Isolate::UncheckedCurrent(); | |
88 if (isolate && isolate->HasFunctionEntryHook()) | |
danno
2013/06/13 15:33:44
nit: isolate != NULL
Sigurður Ásgeirsson
2013/06/19 20:51:51
Done.
| |
89 return false; | |
90 | |
85 if (snapshot_file) { | 91 if (snapshot_file) { |
86 int len; | 92 int len; |
87 byte* str = ReadBytes(snapshot_file, &len); | 93 byte* str = ReadBytes(snapshot_file, &len); |
88 if (!str) return false; | 94 if (!str) return false; |
89 bool success; | 95 bool success; |
90 { | 96 { |
91 SnapshotByteSource source(str, len); | 97 SnapshotByteSource source(str, len); |
92 Deserializer deserializer(&source); | 98 Deserializer deserializer(&source); |
93 ReserveSpaceForSnapshot(&deserializer, snapshot_file); | 99 ReserveSpaceForSnapshot(&deserializer, snapshot_file); |
94 success = V8::Initialize(&deserializer); | 100 success = V8::Initialize(&deserializer); |
(...skipping 28 matching lines...) Loading... | |
123 deserializer.set_reservation(OLD_DATA_SPACE, context_data_space_used_); | 129 deserializer.set_reservation(OLD_DATA_SPACE, context_data_space_used_); |
124 deserializer.set_reservation(CODE_SPACE, context_code_space_used_); | 130 deserializer.set_reservation(CODE_SPACE, context_code_space_used_); |
125 deserializer.set_reservation(MAP_SPACE, context_map_space_used_); | 131 deserializer.set_reservation(MAP_SPACE, context_map_space_used_); |
126 deserializer.set_reservation(CELL_SPACE, context_cell_space_used_); | 132 deserializer.set_reservation(CELL_SPACE, context_cell_space_used_); |
127 deserializer.DeserializePartial(&root); | 133 deserializer.DeserializePartial(&root); |
128 CHECK(root->IsContext()); | 134 CHECK(root->IsContext()); |
129 return Handle<Context>(Context::cast(root)); | 135 return Handle<Context>(Context::cast(root)); |
130 } | 136 } |
131 | 137 |
132 } } // namespace v8::internal | 138 } } // namespace v8::internal |
OLD | NEW |