| OLD | NEW |
| 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 "vm/unit_test.h" | 5 #include "vm/unit_test.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 273 } |
| 274 ASSERT(script_reload_key != kUnsetThreadLocalKey); | 274 ASSERT(script_reload_key != kUnsetThreadLocalKey); |
| 275 ASSERT(OSThread::GetThreadLocal(script_reload_key) == 0); | 275 ASSERT(OSThread::GetThreadLocal(script_reload_key) == 0); |
| 276 // Store the new script in TLS. | 276 // Store the new script in TLS. |
| 277 OSThread::SetThreadLocal(script_reload_key, reinterpret_cast<uword>(script)); | 277 OSThread::SetThreadLocal(script_reload_key, reinterpret_cast<uword>(script)); |
| 278 } | 278 } |
| 279 | 279 |
| 280 | 280 |
| 281 Dart_Handle TestCase::TriggerReload() { | 281 Dart_Handle TestCase::TriggerReload() { |
| 282 Isolate* isolate = Isolate::Current(); | 282 Isolate* isolate = Isolate::Current(); |
| 283 JSONStream js; |
| 283 | 284 |
| 284 { | 285 { |
| 285 TransitionNativeToVM transition(Thread::Current()); | 286 TransitionNativeToVM transition(Thread::Current()); |
| 286 isolate->ReloadSources(false, // force_reload | 287 isolate->ReloadSources(&js, |
| 288 false, // force_reload |
| 287 true); // dont_delete_reload_context | 289 true); // dont_delete_reload_context |
| 290 fprintf(stderr, "RELOAD REPORT:\n%s\n", js.ToCString()); |
| 288 } | 291 } |
| 289 | 292 |
| 290 return Dart_FinalizeLoading(false); | 293 return Dart_FinalizeLoading(false); |
| 291 } | 294 } |
| 292 | 295 |
| 293 | 296 |
| 294 Dart_Handle TestCase::GetReloadErrorOrRootLibrary() { | 297 Dart_Handle TestCase::GetReloadErrorOrRootLibrary() { |
| 295 Isolate* isolate = Isolate::Current(); | 298 Isolate* isolate = Isolate::Current(); |
| 296 | 299 |
| 297 if (isolate->reload_context() != NULL && | 300 if (isolate->reload_context() != NULL && |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 } | 477 } |
| 475 // Copy the remainder of in to out. | 478 // Copy the remainder of in to out. |
| 476 while (*in != '\0') { | 479 while (*in != '\0') { |
| 477 *out++ = *in++; | 480 *out++ = *in++; |
| 478 } | 481 } |
| 479 *out = '\0'; | 482 *out = '\0'; |
| 480 } | 483 } |
| 481 | 484 |
| 482 | 485 |
| 483 } // namespace dart | 486 } // namespace dart |
| OLD | NEW |