Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: runtime/vm/isolate.cc

Issue 1584443002: VM: Precompiled rodata snapshot. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: win32, android build Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 InstructionsSnapshot snapshot(instructions_snapshot_buffer); 967 InstructionsSnapshot snapshot(instructions_snapshot_buffer);
968 #if defined(DEBUG) 968 #if defined(DEBUG)
969 if (FLAG_trace_isolates) { 969 if (FLAG_trace_isolates) {
970 OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n", 970 OS::Print("Precompiled instructions are at [0x%" Px ", 0x%" Px ")\n",
971 reinterpret_cast<uword>(snapshot.instructions_start()), 971 reinterpret_cast<uword>(snapshot.instructions_start()),
972 reinterpret_cast<uword>(snapshot.instructions_start()) + 972 reinterpret_cast<uword>(snapshot.instructions_start()) +
973 snapshot.instructions_size()); 973 snapshot.instructions_size());
974 } 974 }
975 #endif 975 #endif
976 heap_->SetupInstructionsSnapshotPage(snapshot.instructions_start(), 976 heap_->SetupInstructionsSnapshotPage(snapshot.instructions_start(),
977 snapshot.instructions_size()); 977 snapshot.instructions_size(),
978 /* is_executable = */ true);
978 } 979 }
979 980
980 981
982 void Isolate::SetupDataSnapshotPage(const uint8_t* data_snapshot_buffer) {
983 DataSnapshot snapshot(data_snapshot_buffer);
984 #if defined(DEBUG)
985 if (FLAG_trace_isolates) {
986 OS::Print("Precompiled rodata are at [0x%" Px ", 0x%" Px ")\n",
987 reinterpret_cast<uword>(snapshot.data_start()),
988 reinterpret_cast<uword>(snapshot.data_start()) +
989 snapshot.data_size());
990 }
991 #endif
992 heap_->SetupInstructionsSnapshotPage(snapshot.data_start(),
993 snapshot.data_size(),
994 /* is_executable = */ false);
995 }
996
997
998
981 void Isolate::set_debugger_name(const char* name) { 999 void Isolate::set_debugger_name(const char* name) {
982 free(debugger_name_); 1000 free(debugger_name_);
983 debugger_name_ = strdup(name); 1001 debugger_name_ = strdup(name);
984 } 1002 }
985 1003
986 1004
987 void Isolate::BuildName(const char* name_prefix) { 1005 void Isolate::BuildName(const char* name_prefix) {
988 ASSERT(name_ == NULL); 1006 ASSERT(name_ == NULL);
989 if (name_prefix == NULL) { 1007 if (name_prefix == NULL) {
990 name_prefix = "isolate"; 1008 name_prefix = "isolate";
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 void IsolateSpawnState::DecrementSpawnCount() { 2571 void IsolateSpawnState::DecrementSpawnCount() {
2554 ASSERT(spawn_count_monitor_ != NULL); 2572 ASSERT(spawn_count_monitor_ != NULL);
2555 ASSERT(spawn_count_ != NULL); 2573 ASSERT(spawn_count_ != NULL);
2556 MonitorLocker ml(spawn_count_monitor_); 2574 MonitorLocker ml(spawn_count_monitor_);
2557 ASSERT(*spawn_count_ > 0); 2575 ASSERT(*spawn_count_ > 0);
2558 *spawn_count_ = *spawn_count_ - 1; 2576 *spawn_count_ = *spawn_count_ - 1;
2559 ml.Notify(); 2577 ml.Notify();
2560 } 2578 }
2561 2579
2562 } // namespace dart 2580 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698