Chromium Code Reviews| Index: runtime/vm/isolate.cc |
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
| index 0c992e107299e90b5e28aabe6b28ebb5fd0192bd..943e3cc29574e55c5378c4dd0cc7b27d10cd72ad 100644 |
| --- a/runtime/vm/isolate.cc |
| +++ b/runtime/vm/isolate.cc |
| @@ -880,6 +880,24 @@ uword Isolate::GetCurrentStackPointer() { |
| } |
| +void Isolate::SetupInstructionsSnapshotPage( |
| + const uint8_t* instructions_snapshot) { |
| + // First uint64_t is the size of the snapshot, including the header. |
| + uword header_size = OS::kMaxPreferredCodeAlignment; |
| + uword snapshot_size = static_cast<uword>( |
| + *reinterpret_cast<const uint64_t*>(instructions_snapshot)); |
|
siva
2015/09/14 21:29:33
Would be better to do
Snapshot* instr_snapshot =
|
| + uword instructions_size = snapshot_size - header_size; |
| + void* instructions_start = reinterpret_cast<void*>( |
| + reinterpret_cast<uword>(instructions_snapshot) + header_size); |
| +#if defined(DEBUG) |
| + OS::Print("Precompiled instructions are at [%" Px ", %" Px ")\n", |
| + reinterpret_cast<uword>(instructions_start), |
| + reinterpret_cast<uword>(instructions_start) + instructions_size); |
| +#endif |
| + heap_->SetupInstructionsSnapshotPage(instructions_start, instructions_size); |
| +} |
| + |
| + |
| void Isolate::set_debugger_name(const char* name) { |
| free(debugger_name_); |
| debugger_name_ = strdup(name); |