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

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

Issue 2240283002: Reload: Don't free the saved class table while another thread may be reading it. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 4 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
« runtime/vm/isolate_reload.cc ('K') | « runtime/vm/isolate_reload.cc ('k') | no next file » | 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 "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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 Dart_Handle TestCase::ReloadTestScript(const char* script) { 324 Dart_Handle TestCase::ReloadTestScript(const char* script) {
325 SetReloadTestScript(script); 325 SetReloadTestScript(script);
326 326
327 Dart_Handle result = TriggerReload(); 327 Dart_Handle result = TriggerReload();
328 if (Dart_IsError(result)) { 328 if (Dart_IsError(result)) {
329 return result; 329 return result;
330 } 330 }
331 331
332 result = GetReloadErrorOrRootLibrary(); 332 result = GetReloadErrorOrRootLibrary();
333 333
334 Isolate* isolate = Isolate::Current(); 334 {
335 if (isolate->reload_context() != NULL) { 335 Thread* thread = Thread::Current();
336 isolate->DeleteReloadContext(); 336 TransitionNativeToVM transition(thread);
337 Isolate* isolate = thread->isolate();
338 if (isolate->reload_context() != NULL) {
339 isolate->DeleteReloadContext();
340 }
337 } 341 }
338 342
339 return result; 343 return result;
340 } 344 }
341 345
342 346
343 #endif // !PRODUCT 347 #endif // !PRODUCT
344 348
345 349
346 Dart_Handle TestCase::LoadCoreTestScript(const char* script, 350 Dart_Handle TestCase::LoadCoreTestScript(const char* script,
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 495 }
492 // Copy the remainder of in to out. 496 // Copy the remainder of in to out.
493 while (*in != '\0') { 497 while (*in != '\0') {
494 *out++ = *in++; 498 *out++ = *in++;
495 } 499 }
496 *out = '\0'; 500 *out = '\0';
497 } 501 }
498 502
499 503
500 } // namespace dart 504 } // namespace dart
OLDNEW
« runtime/vm/isolate_reload.cc ('K') | « runtime/vm/isolate_reload.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698