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

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

Issue 1880233002: Address Siva's comments from https://codereview.chromium.org/1877973002/ (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Adjust assert: Protect may be called while mutator_thread does not exist" Created 4 years, 8 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/vm/compiler.cc ('k') | runtime/vm/isolate.h » ('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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/class_finalizer.h" 6 #include "vm/class_finalizer.h"
7 #include "vm/code_patcher.h" 7 #include "vm/code_patcher.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 #endif 102 #endif
103 BackgroundCompiler::EnsureInit(thread); 103 BackgroundCompiler::EnsureInit(thread);
104 Isolate* isolate = thread->isolate(); 104 Isolate* isolate = thread->isolate();
105 ASSERT(isolate->background_compiler() != NULL); 105 ASSERT(isolate->background_compiler() != NULL);
106 isolate->background_compiler()->CompileOptimized(func); 106 isolate->background_compiler()->CompileOptimized(func);
107 Monitor* m = new Monitor(); 107 Monitor* m = new Monitor();
108 MonitorLocker ml(m); 108 MonitorLocker ml(m);
109 while (!func.HasOptimizedCode()) { 109 while (!func.HasOptimizedCode()) {
110 ml.WaitWithSafepointCheck(thread, 1); 110 ml.WaitWithSafepointCheck(thread, 1);
111 } 111 }
112 BackgroundCompiler::Stop(isolate->background_compiler()); 112 BackgroundCompiler::Stop(isolate);
113 } 113 }
114 114
115 115
116 TEST_CASE(RegenerateAllocStubs) { 116 TEST_CASE(RegenerateAllocStubs) {
117 const char* kScriptChars = 117 const char* kScriptChars =
118 "class A {\n" 118 "class A {\n"
119 "}\n" 119 "}\n"
120 "unOpt() => new A(); \n" 120 "unOpt() => new A(); \n"
121 "optIt() => new A(); \n" 121 "optIt() => new A(); \n"
122 "A main() {\n" 122 "A main() {\n"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 EXPECT(val.IsInteger()); 223 EXPECT(val.IsInteger());
224 EXPECT_EQ(7, Integer::Cast(val).AsInt64Value()); 224 EXPECT_EQ(7, Integer::Cast(val).AsInt64Value());
225 225
226 intptr_t final_class_table_size = 226 intptr_t final_class_table_size =
227 Isolate::Current()->class_table()->NumCids(); 227 Isolate::Current()->class_table()->NumCids();
228 // Eval should not eat into this non-renewable resource. 228 // Eval should not eat into this non-renewable resource.
229 EXPECT_EQ(initial_class_table_size, final_class_table_size); 229 EXPECT_EQ(initial_class_table_size, final_class_table_size);
230 } 230 }
231 231
232 } // namespace dart 232 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698