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

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

Issue 1336763002: Last snapshot bits to get working precompiled hello_world on x64. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 5 years, 3 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 "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "vm/code_observers.h" 10 #include "vm/code_observers.h"
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); 873 uword stack_allocated_local_address = reinterpret_cast<uword>(&func);
874 return stack_allocated_local_address; 874 return stack_allocated_local_address;
875 #endif 875 #endif
876 #else 876 #else
877 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); 877 uword stack_allocated_local_address = reinterpret_cast<uword>(&func);
878 return stack_allocated_local_address; 878 return stack_allocated_local_address;
879 #endif 879 #endif
880 } 880 }
881 881
882 882
883 void Isolate::SetupInstructionsSnapshotPage(
884 const uint8_t* instructions_snapshot) {
885 // First uint64_t is the size of the snapshot, including the header.
886 uword header_size = OS::kMaxPreferredCodeAlignment;
887 uword snapshot_size = static_cast<uword>(
888 *reinterpret_cast<const uint64_t*>(instructions_snapshot));
siva 2015/09/14 21:29:33 Would be better to do Snapshot* instr_snapshot =
889 uword instructions_size = snapshot_size - header_size;
890 void* instructions_start = reinterpret_cast<void*>(
891 reinterpret_cast<uword>(instructions_snapshot) + header_size);
892 #if defined(DEBUG)
893 OS::Print("Precompiled instructions are at [%" Px ", %" Px ")\n",
894 reinterpret_cast<uword>(instructions_start),
895 reinterpret_cast<uword>(instructions_start) + instructions_size);
896 #endif
897 heap_->SetupInstructionsSnapshotPage(instructions_start, instructions_size);
898 }
899
900
883 void Isolate::set_debugger_name(const char* name) { 901 void Isolate::set_debugger_name(const char* name) {
884 free(debugger_name_); 902 free(debugger_name_);
885 debugger_name_ = strdup(name); 903 debugger_name_ = strdup(name);
886 } 904 }
887 905
888 906
889 void Isolate::BuildName(const char* name_prefix) { 907 void Isolate::BuildName(const char* name_prefix) {
890 ASSERT(name_ == NULL); 908 ASSERT(name_ == NULL);
891 if (name_prefix == NULL) { 909 if (name_prefix == NULL) {
892 name_prefix = "isolate"; 910 name_prefix = "isolate";
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 serialized_message_, serialized_message_len_); 2367 serialized_message_, serialized_message_len_);
2350 } 2368 }
2351 2369
2352 2370
2353 void IsolateSpawnState::Cleanup() { 2371 void IsolateSpawnState::Cleanup() {
2354 SwitchIsolateScope switch_scope(I); 2372 SwitchIsolateScope switch_scope(I);
2355 Dart::ShutdownIsolate(); 2373 Dart::ShutdownIsolate();
2356 } 2374 }
2357 2375
2358 } // namespace dart 2376 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698