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 "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/text_buffer.h" | 10 #include "platform/text_buffer.h" |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 const uint8_t* instructions_snapshot_buffer) { | 1006 const uint8_t* instructions_snapshot_buffer) { |
1007 InstructionsSnapshot snapshot(instructions_snapshot_buffer); | 1007 InstructionsSnapshot snapshot(instructions_snapshot_buffer); |
1008 #if defined(DEBUG) | 1008 #if defined(DEBUG) |
1009 if (FLAG_trace_isolates) { | 1009 if (FLAG_trace_isolates) { |
1010 OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n", | 1010 OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n", |
1011 reinterpret_cast<uword>(snapshot.instructions_start()), | 1011 reinterpret_cast<uword>(snapshot.instructions_start()), |
1012 reinterpret_cast<uword>(snapshot.instructions_start()) + | 1012 reinterpret_cast<uword>(snapshot.instructions_start()) + |
1013 snapshot.instructions_size()); | 1013 snapshot.instructions_size()); |
1014 } | 1014 } |
1015 #endif | 1015 #endif |
1016 heap_->SetupInstructionsSnapshotPage(snapshot.instructions_start(), | 1016 heap_->SetupExternalPage(snapshot.instructions_start(), |
1017 snapshot.instructions_size()); | 1017 snapshot.instructions_size(), |
| 1018 /* is_executable = */ true); |
1018 } | 1019 } |
1019 | 1020 |
1020 | 1021 |
| 1022 void Isolate::SetupDataSnapshotPage(const uint8_t* data_snapshot_buffer) { |
| 1023 DataSnapshot snapshot(data_snapshot_buffer); |
| 1024 #if defined(DEBUG) |
| 1025 if (FLAG_trace_isolates) { |
| 1026 OS::Print("Precompiled rodata are at [0x%" Px ", 0x%" Px ")\n", |
| 1027 reinterpret_cast<uword>(snapshot.data_start()), |
| 1028 reinterpret_cast<uword>(snapshot.data_start()) + |
| 1029 snapshot.data_size()); |
| 1030 } |
| 1031 #endif |
| 1032 heap_->SetupExternalPage(snapshot.data_start(), |
| 1033 snapshot.data_size(), |
| 1034 /* is_executable = */ false); |
| 1035 } |
| 1036 |
| 1037 |
| 1038 |
1021 void Isolate::set_debugger_name(const char* name) { | 1039 void Isolate::set_debugger_name(const char* name) { |
1022 free(debugger_name_); | 1040 free(debugger_name_); |
1023 debugger_name_ = strdup(name); | 1041 debugger_name_ = strdup(name); |
1024 } | 1042 } |
1025 | 1043 |
1026 | 1044 |
1027 void Isolate::BuildName(const char* name_prefix) { | 1045 void Isolate::BuildName(const char* name_prefix) { |
1028 ASSERT(name_ == NULL); | 1046 ASSERT(name_ == NULL); |
1029 if (name_prefix == NULL) { | 1047 if (name_prefix == NULL) { |
1030 name_prefix = "isolate"; | 1048 name_prefix = "isolate"; |
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2795 void IsolateSpawnState::DecrementSpawnCount() { | 2813 void IsolateSpawnState::DecrementSpawnCount() { |
2796 ASSERT(spawn_count_monitor_ != NULL); | 2814 ASSERT(spawn_count_monitor_ != NULL); |
2797 ASSERT(spawn_count_ != NULL); | 2815 ASSERT(spawn_count_ != NULL); |
2798 MonitorLocker ml(spawn_count_monitor_); | 2816 MonitorLocker ml(spawn_count_monitor_); |
2799 ASSERT(*spawn_count_ > 0); | 2817 ASSERT(*spawn_count_ > 0); |
2800 *spawn_count_ = *spawn_count_ - 1; | 2818 *spawn_count_ = *spawn_count_ - 1; |
2801 ml.Notify(); | 2819 ml.Notify(); |
2802 } | 2820 } |
2803 | 2821 |
2804 } // namespace dart | 2822 } // namespace dart |
OLD | NEW |