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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
992 return result; | 992 return result; |
993 } | 993 } |
994 | 994 |
995 | 995 |
996 Thread* Isolate::mutator_thread() const { | 996 Thread* Isolate::mutator_thread() const { |
997 ASSERT(thread_registry() != NULL); | 997 ASSERT(thread_registry() != NULL); |
998 return thread_registry()->mutator_thread(); | 998 return thread_registry()->mutator_thread(); |
999 } | 999 } |
1000 | 1000 |
1001 | 1001 |
1002 void Isolate::SetupInstructionsSnapshotPage( | 1002 void Isolate::SetupImagePage(const uint8_t* image_buffer, bool is_executable) { |
1003 const uint8_t* instructions_snapshot_buffer) { | 1003 Image image(image_buffer); |
1004 InstructionsSnapshot snapshot(instructions_snapshot_buffer); | 1004 heap_->SetupImagePage(image.object_start(), image.object_size(), |
1005 #if defined(DEBUG) | 1005 is_executable); |
1006 if (FLAG_trace_isolates) { | |
1007 OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n", | |
1008 reinterpret_cast<uword>(snapshot.instructions_start()), | |
1009 reinterpret_cast<uword>(snapshot.instructions_start()) + | |
1010 snapshot.instructions_size()); | |
1011 } | |
1012 #endif | |
siva
2017/01/26 01:07:30
Why did you delete these trace messages?
rmacnak
2017/01/26 17:39:00
This was helpful for low-level debugging at the be
| |
1013 heap_->SetupExternalPage(snapshot.instructions_start(), | |
1014 snapshot.instructions_size(), | |
1015 /* is_executable = */ true); | |
1016 } | 1006 } |
1017 | 1007 |
1018 | 1008 |
1019 void Isolate::SetupDataSnapshotPage(const uint8_t* data_snapshot_buffer) { | |
1020 DataSnapshot snapshot(data_snapshot_buffer); | |
1021 #if defined(DEBUG) | |
1022 if (FLAG_trace_isolates) { | |
1023 OS::Print( | |
1024 "Precompiled rodata are at [0x%" Px ", 0x%" Px ")\n", | |
1025 reinterpret_cast<uword>(snapshot.data_start()), | |
1026 reinterpret_cast<uword>(snapshot.data_start()) + snapshot.data_size()); | |
1027 } | |
1028 #endif | |
siva
2017/01/26 01:07:30
Ditto?
| |
1029 heap_->SetupExternalPage(snapshot.data_start(), snapshot.data_size(), | |
1030 /* is_executable = */ false); | |
1031 } | |
1032 | |
1033 | |
1034 void Isolate::ScheduleMessageInterrupts() { | 1009 void Isolate::ScheduleMessageInterrupts() { |
1035 // We take the threads lock here to ensure that the mutator thread does not | 1010 // We take the threads lock here to ensure that the mutator thread does not |
1036 // exit the isolate while we are trying to schedule interrupts on it. | 1011 // exit the isolate while we are trying to schedule interrupts on it. |
1037 MonitorLocker ml(threads_lock()); | 1012 MonitorLocker ml(threads_lock()); |
1038 Thread* mthread = mutator_thread(); | 1013 Thread* mthread = mutator_thread(); |
1039 if (mthread != NULL) { | 1014 if (mthread != NULL) { |
1040 mthread->ScheduleInterrupts(Thread::kMessageInterrupt); | 1015 mthread->ScheduleInterrupts(Thread::kMessageInterrupt); |
1041 } | 1016 } |
1042 } | 1017 } |
1043 | 1018 |
(...skipping 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2973 void IsolateSpawnState::DecrementSpawnCount() { | 2948 void IsolateSpawnState::DecrementSpawnCount() { |
2974 ASSERT(spawn_count_monitor_ != NULL); | 2949 ASSERT(spawn_count_monitor_ != NULL); |
2975 ASSERT(spawn_count_ != NULL); | 2950 ASSERT(spawn_count_ != NULL); |
2976 MonitorLocker ml(spawn_count_monitor_); | 2951 MonitorLocker ml(spawn_count_monitor_); |
2977 ASSERT(*spawn_count_ > 0); | 2952 ASSERT(*spawn_count_ > 0); |
2978 *spawn_count_ = *spawn_count_ - 1; | 2953 *spawn_count_ = *spawn_count_ - 1; |
2979 ml.Notify(); | 2954 ml.Notify(); |
2980 } | 2955 } |
2981 | 2956 |
2982 } // namespace dart | 2957 } // namespace dart |
OLD | NEW |