| 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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 result->LowLevelShutdown(); | 962 result->LowLevelShutdown(); |
| 963 Thread::ExitIsolate(); | 963 Thread::ExitIsolate(); |
| 964 delete result; | 964 delete result; |
| 965 return NULL; | 965 return NULL; |
| 966 } | 966 } |
| 967 | 967 |
| 968 return result; | 968 return result; |
| 969 } | 969 } |
| 970 | 970 |
| 971 | 971 |
| 972 void Isolate::SetupInstructionsSnapshotPage( | |
| 973 const uint8_t* instructions_snapshot_buffer) { | |
| 974 InstructionsSnapshot snapshot(instructions_snapshot_buffer); | |
| 975 #if defined(DEBUG) | |
| 976 if (FLAG_trace_isolates) { | |
| 977 OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n", | |
| 978 reinterpret_cast<uword>(snapshot.instructions_start()), | |
| 979 reinterpret_cast<uword>(snapshot.instructions_start()) + | |
| 980 snapshot.instructions_size()); | |
| 981 } | |
| 982 #endif | |
| 983 heap_->SetupExternalPage(snapshot.instructions_start(), | |
| 984 snapshot.instructions_size(), | |
| 985 /* is_executable = */ true); | |
| 986 } | |
| 987 | |
| 988 | |
| 989 void Isolate::SetupDataSnapshotPage(const uint8_t* data_snapshot_buffer) { | 972 void Isolate::SetupDataSnapshotPage(const uint8_t* data_snapshot_buffer) { |
| 990 DataSnapshot snapshot(data_snapshot_buffer); | 973 DataSnapshot snapshot(data_snapshot_buffer); |
| 991 #if defined(DEBUG) | 974 #if defined(DEBUG) |
| 992 if (FLAG_trace_isolates) { | 975 if (FLAG_trace_isolates) { |
| 993 OS::Print("Precompiled rodata are at [0x%" Px ", 0x%" Px ")\n", | 976 OS::Print("Precompiled rodata are at [0x%" Px ", 0x%" Px ")\n", |
| 994 reinterpret_cast<uword>(snapshot.data_start()), | 977 reinterpret_cast<uword>(snapshot.data_start()), |
| 995 reinterpret_cast<uword>(snapshot.data_start()) + | 978 reinterpret_cast<uword>(snapshot.data_start()) + |
| 996 snapshot.data_size()); | 979 snapshot.data_size()); |
| 997 } | 980 } |
| 998 #endif | 981 #endif |
| (...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2689 void IsolateSpawnState::DecrementSpawnCount() { | 2672 void IsolateSpawnState::DecrementSpawnCount() { |
| 2690 ASSERT(spawn_count_monitor_ != NULL); | 2673 ASSERT(spawn_count_monitor_ != NULL); |
| 2691 ASSERT(spawn_count_ != NULL); | 2674 ASSERT(spawn_count_ != NULL); |
| 2692 MonitorLocker ml(spawn_count_monitor_); | 2675 MonitorLocker ml(spawn_count_monitor_); |
| 2693 ASSERT(*spawn_count_ > 0); | 2676 ASSERT(*spawn_count_ > 0); |
| 2694 *spawn_count_ = *spawn_count_ - 1; | 2677 *spawn_count_ = *spawn_count_ - 1; |
| 2695 ml.Notify(); | 2678 ml.Notify(); |
| 2696 } | 2679 } |
| 2697 | 2680 |
| 2698 } // namespace dart | 2681 } // namespace dart |
| OLD | NEW |