Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 873 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); | 873 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); |
| 874 return stack_allocated_local_address; | 874 return stack_allocated_local_address; |
| 875 #endif | 875 #endif |
| 876 #else | 876 #else |
| 877 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); | 877 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); |
| 878 return stack_allocated_local_address; | 878 return stack_allocated_local_address; |
| 879 #endif | 879 #endif |
| 880 } | 880 } |
| 881 | 881 |
| 882 | 882 |
| 883 void Isolate::SetupInstructionsSnapshotPage( | |
| 884 const uint8_t* instructions_snapshot) { | |
| 885 // First word is the size of the snapshot, including the header. | |
| 886 uword header_size = OS::kMaxPreferredCodeAlignment; | |
| 887 uword snapshot_size = static_cast<uword>( | |
| 888 *reinterpret_cast<const uword*>(instructions_snapshot)); | |
| 889 uword instructions_size = snapshot_size - header_size; | |
| 890 void* instructions_start = reinterpret_cast<void*>( | |
| 891 reinterpret_cast<uword>(instructions_snapshot) + header_size); | |
|
siva
2015/09/15 23:22:01
As discussed offline it might be more readable to
| |
| 892 #if defined(DEBUG) | |
| 893 OS::Print("Precompiled instructions are at [%" Px ", %" Px ")\n", | |
| 894 reinterpret_cast<uword>(instructions_start), | |
| 895 reinterpret_cast<uword>(instructions_start) + instructions_size); | |
| 896 #endif | |
| 897 heap_->SetupInstructionsSnapshotPage(instructions_start, instructions_size); | |
| 898 } | |
| 899 | |
| 900 | |
| 883 void Isolate::set_debugger_name(const char* name) { | 901 void Isolate::set_debugger_name(const char* name) { |
| 884 free(debugger_name_); | 902 free(debugger_name_); |
| 885 debugger_name_ = strdup(name); | 903 debugger_name_ = strdup(name); |
| 886 } | 904 } |
| 887 | 905 |
| 888 | 906 |
| 889 void Isolate::BuildName(const char* name_prefix) { | 907 void Isolate::BuildName(const char* name_prefix) { |
| 890 ASSERT(name_ == NULL); | 908 ASSERT(name_ == NULL); |
| 891 if (name_prefix == NULL) { | 909 if (name_prefix == NULL) { |
| 892 name_prefix = "isolate"; | 910 name_prefix = "isolate"; |
| (...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2346 serialized_message_, serialized_message_len_); | 2364 serialized_message_, serialized_message_len_); |
| 2347 } | 2365 } |
| 2348 | 2366 |
| 2349 | 2367 |
| 2350 void IsolateSpawnState::Cleanup() { | 2368 void IsolateSpawnState::Cleanup() { |
| 2351 SwitchIsolateScope switch_scope(I); | 2369 SwitchIsolateScope switch_scope(I); |
| 2352 Dart::ShutdownIsolate(); | 2370 Dart::ShutdownIsolate(); |
| 2353 } | 2371 } |
| 2354 | 2372 |
| 2355 } // namespace dart | 2373 } // namespace dart |
| OLD | NEW |