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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 const uint8_t* instructions_snapshot_buffer) { | 1010 const uint8_t* instructions_snapshot_buffer) { |
1011 InstructionsSnapshot snapshot(instructions_snapshot_buffer); | 1011 InstructionsSnapshot snapshot(instructions_snapshot_buffer); |
1012 #if defined(DEBUG) | 1012 #if defined(DEBUG) |
1013 if (FLAG_trace_isolates) { | 1013 if (FLAG_trace_isolates) { |
1014 OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n", | 1014 OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n", |
1015 reinterpret_cast<uword>(snapshot.instructions_start()), | 1015 reinterpret_cast<uword>(snapshot.instructions_start()), |
1016 reinterpret_cast<uword>(snapshot.instructions_start()) + | 1016 reinterpret_cast<uword>(snapshot.instructions_start()) + |
1017 snapshot.instructions_size()); | 1017 snapshot.instructions_size()); |
1018 } | 1018 } |
1019 #endif | 1019 #endif |
1020 heap_->SetupInstructionsSnapshotPage(snapshot.instructions_start(), | 1020 heap_->SetupExternalPage(snapshot.instructions_start(), |
1021 snapshot.instructions_size()); | 1021 snapshot.instructions_size(), |
| 1022 /* is_executable = */ true); |
1022 } | 1023 } |
1023 | 1024 |
1024 | 1025 |
| 1026 void Isolate::SetupDataSnapshotPage(const uint8_t* data_snapshot_buffer) { |
| 1027 DataSnapshot snapshot(data_snapshot_buffer); |
| 1028 #if defined(DEBUG) |
| 1029 if (FLAG_trace_isolates) { |
| 1030 OS::Print("Precompiled rodata are at [0x%" Px ", 0x%" Px ")\n", |
| 1031 reinterpret_cast<uword>(snapshot.data_start()), |
| 1032 reinterpret_cast<uword>(snapshot.data_start()) + |
| 1033 snapshot.data_size()); |
| 1034 } |
| 1035 #endif |
| 1036 heap_->SetupExternalPage(snapshot.data_start(), |
| 1037 snapshot.data_size(), |
| 1038 /* is_executable = */ false); |
| 1039 } |
| 1040 |
| 1041 |
| 1042 |
1025 void Isolate::set_debugger_name(const char* name) { | 1043 void Isolate::set_debugger_name(const char* name) { |
1026 free(debugger_name_); | 1044 free(debugger_name_); |
1027 debugger_name_ = strdup(name); | 1045 debugger_name_ = strdup(name); |
1028 } | 1046 } |
1029 | 1047 |
1030 | 1048 |
1031 void Isolate::BuildName(const char* name_prefix) { | 1049 void Isolate::BuildName(const char* name_prefix) { |
1032 ASSERT(name_ == NULL); | 1050 ASSERT(name_ == NULL); |
1033 if (name_prefix == NULL) { | 1051 if (name_prefix == NULL) { |
1034 name_prefix = "isolate"; | 1052 name_prefix = "isolate"; |
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2775 void IsolateSpawnState::DecrementSpawnCount() { | 2793 void IsolateSpawnState::DecrementSpawnCount() { |
2776 ASSERT(spawn_count_monitor_ != NULL); | 2794 ASSERT(spawn_count_monitor_ != NULL); |
2777 ASSERT(spawn_count_ != NULL); | 2795 ASSERT(spawn_count_ != NULL); |
2778 MonitorLocker ml(spawn_count_monitor_); | 2796 MonitorLocker ml(spawn_count_monitor_); |
2779 ASSERT(*spawn_count_ > 0); | 2797 ASSERT(*spawn_count_ > 0); |
2780 *spawn_count_ = *spawn_count_ - 1; | 2798 *spawn_count_ = *spawn_count_ - 1; |
2781 ml.Notify(); | 2799 ml.Notify(); |
2782 } | 2800 } |
2783 | 2801 |
2784 } // namespace dart | 2802 } // namespace dart |
OLD | NEW |