Chromium Code Reviews| Index: runtime/vm/isolate.cc |
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
| index 379287a67b4f94a77a36c0263c45cb0529b70d12..ed654ee467bdd22846484189225af3536fe2deb0 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 word is the size of the snapshot, including the header. |
| + uword header_size = OS::kMaxPreferredCodeAlignment; |
| + uword snapshot_size = static_cast<uword>( |
| + *reinterpret_cast<const uword*>(instructions_snapshot)); |
| + uword instructions_size = snapshot_size - header_size; |
| + void* instructions_start = reinterpret_cast<void*>( |
| + reinterpret_cast<uword>(instructions_snapshot) + header_size); |
|
siva
2015/09/15 23:22:01
As discussed offline it might be more readable to
|
| +#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); |