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

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

Issue 2622053002: Refactor snapshots pieces to include a section for loading instructions into the heap of a regular … (Closed)
Patch Set: . Created 3 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
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/tools/create_snapshot_bin.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "include/dart_native_api.h" 5 #include "include/dart_native_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/bootstrap_natives.h" 7 #include "vm/bootstrap_natives.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart.h" 9 #include "vm/dart.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(6)); 333 GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(6));
334 334
335 GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(7)); 335 GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(7));
336 GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(8)); 336 GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(8));
337 337
338 GET_NATIVE_ARGUMENT(Array, environment, arguments->NativeArgAt(9)); 338 GET_NATIVE_ARGUMENT(Array, environment, arguments->NativeArgAt(9));
339 339
340 GET_NATIVE_ARGUMENT(String, packageRoot, arguments->NativeArgAt(10)); 340 GET_NATIVE_ARGUMENT(String, packageRoot, arguments->NativeArgAt(10));
341 GET_NATIVE_ARGUMENT(String, packageConfig, arguments->NativeArgAt(11)); 341 GET_NATIVE_ARGUMENT(String, packageConfig, arguments->NativeArgAt(11));
342 342
343 if (Dart::snapshot_kind() == Snapshot::kAppAOT) { 343 if (Dart::vm_snapshot_kind() == Snapshot::kAppAOT) {
344 const Array& args = Array::Handle(Array::New(1)); 344 const Array& args = Array::Handle(Array::New(1));
345 args.SetAt( 345 args.SetAt(
346 0, String::Handle(String::New( 346 0,
347 "Isolate.spawnUri not supported when using AOT compilation"))); 347 String::Handle(String::New(
348 "Isolate.spawnUri is not supported when using AOT compilation")));
348 Exceptions::ThrowByType(Exceptions::kUnsupported, args); 349 Exceptions::ThrowByType(Exceptions::kUnsupported, args);
349 UNREACHABLE(); 350 UNREACHABLE();
350 } 351 }
351 352
352 // Canonicalize the uri with respect to the current isolate. 353 // Canonicalize the uri with respect to the current isolate.
353 const Library& root_lib = 354 const Library& root_lib =
354 Library::Handle(isolate->object_store()->root_library()); 355 Library::Handle(isolate->object_store()->root_library());
355 char* error = NULL; 356 char* error = NULL;
356 const char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error); 357 const char* canonical_uri = CanonicalizeUri(thread, root_lib, uri, &error);
357 if (canonical_uri == NULL) { 358 if (canonical_uri == NULL) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 uint8_t* data = NULL; 435 uint8_t* data = NULL;
435 MessageWriter writer(&data, &malloc_allocator, &malloc_deallocator, false); 436 MessageWriter writer(&data, &malloc_allocator, &malloc_deallocator, false);
436 writer.WriteMessage(msg); 437 writer.WriteMessage(msg);
437 438
438 PortMap::PostMessage(new Message(port.Id(), data, writer.BytesWritten(), 439 PortMap::PostMessage(new Message(port.Id(), data, writer.BytesWritten(),
439 Message::kOOBPriority)); 440 Message::kOOBPriority));
440 return Object::null(); 441 return Object::null();
441 } 442 }
442 443
443 } // namespace dart 444 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/tools/create_snapshot_bin.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698