| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_api.h" | 5 #include "include/dart_api.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 return Api::NewError("%s: A script has already been loaded from '%s'.", | 2283 return Api::NewError("%s: A script has already been loaded from '%s'.", |
| 2284 CURRENT_FUNC, library_url.ToCString()); | 2284 CURRENT_FUNC, library_url.ToCString()); |
| 2285 } | 2285 } |
| 2286 SnapshotReader reader(snapshot, isolate); | 2286 SnapshotReader reader(snapshot, isolate); |
| 2287 const Object& tmp = Object::Handle(reader.ReadObject()); | 2287 const Object& tmp = Object::Handle(reader.ReadObject()); |
| 2288 if (!tmp.IsLibrary()) { | 2288 if (!tmp.IsLibrary()) { |
| 2289 return Api::NewError("%s: Unable to deserialize snapshot correctly.", | 2289 return Api::NewError("%s: Unable to deserialize snapshot correctly.", |
| 2290 CURRENT_FUNC); | 2290 CURRENT_FUNC); |
| 2291 } | 2291 } |
| 2292 library ^= tmp.raw(); | 2292 library ^= tmp.raw(); |
| 2293 library.Register(); | |
| 2294 isolate->object_store()->set_root_library(library); | 2293 isolate->object_store()->set_root_library(library); |
| 2295 return Api::NewLocalHandle(library); | 2294 return Api::NewLocalHandle(library); |
| 2296 } | 2295 } |
| 2297 | 2296 |
| 2298 | 2297 |
| 2299 static void CompileAll(Isolate* isolate, Dart_Handle* result) { | 2298 static void CompileAll(Isolate* isolate, Dart_Handle* result) { |
| 2300 *result = Api::Success(); | 2299 *result = Api::Success(); |
| 2301 ASSERT(isolate != NULL); | 2300 ASSERT(isolate != NULL); |
| 2302 LongJump* base = isolate->long_jump_base(); | 2301 LongJump* base = isolate->long_jump_base(); |
| 2303 LongJump jump; | 2302 LongJump jump; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 } | 2491 } |
| 2493 delete debug_region; | 2492 delete debug_region; |
| 2494 } else { | 2493 } else { |
| 2495 *buffer = NULL; | 2494 *buffer = NULL; |
| 2496 *buffer_size = 0; | 2495 *buffer_size = 0; |
| 2497 } | 2496 } |
| 2498 } | 2497 } |
| 2499 | 2498 |
| 2500 | 2499 |
| 2501 } // namespace dart | 2500 } // namespace dart |
| OLD | NEW |