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 "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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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->background_compiler()); |
113 } | 113 } |
114 | 114 |
115 | 115 #if !defined(TARGET_ARCH_DBC) |
zra
2016/04/08 22:37:34
enable and mark in status file?
Vyacheslav Egorov (Google)
2016/04/11 10:49:10
Done.
| |
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" |
123 " return unOpt();\n" | 123 " return unOpt();\n" |
124 "}\n"; | 124 "}\n"; |
125 | 125 |
(...skipping 16 matching lines...) Expand all Loading... | |
142 EXPECT_VALID(result); | 142 EXPECT_VALID(result); |
143 | 143 |
144 owner.DisableAllocationStub(); | 144 owner.DisableAllocationStub(); |
145 result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 145 result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
146 EXPECT_VALID(result); | 146 EXPECT_VALID(result); |
147 | 147 |
148 owner.DisableAllocationStub(); | 148 owner.DisableAllocationStub(); |
149 result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 149 result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
150 EXPECT_VALID(result); | 150 EXPECT_VALID(result); |
151 } | 151 } |
152 #endif | |
152 | 153 |
153 | 154 |
154 TEST_CASE(EvalExpression) { | 155 TEST_CASE(EvalExpression) { |
155 const char* kScriptChars = | 156 const char* kScriptChars = |
156 "int ten = 2 * 5; \n" | 157 "int ten = 2 * 5; \n" |
157 "get dot => '.'; \n" | 158 "get dot => '.'; \n" |
158 "class A { \n" | 159 "class A { \n" |
159 " var apa = 'Herr Nilsson'; \n" | 160 " var apa = 'Herr Nilsson'; \n" |
160 " calc(x) => '${x*ten}'; \n" | 161 " calc(x) => '${x*ten}'; \n" |
161 "} \n" | 162 "} \n" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 EXPECT(val.IsInteger()); | 222 EXPECT(val.IsInteger()); |
222 EXPECT_EQ(7, Integer::Cast(val).AsInt64Value()); | 223 EXPECT_EQ(7, Integer::Cast(val).AsInt64Value()); |
223 | 224 |
224 intptr_t final_class_table_size = | 225 intptr_t final_class_table_size = |
225 Isolate::Current()->class_table()->NumCids(); | 226 Isolate::Current()->class_table()->NumCids(); |
226 // Eval should not eat into this non-renewable resource. | 227 // Eval should not eat into this non-renewable resource. |
227 EXPECT_EQ(initial_class_table_size, final_class_table_size); | 228 EXPECT_EQ(initial_class_table_size, final_class_table_size); |
228 } | 229 } |
229 | 230 |
230 } // namespace dart | 231 } // namespace dart |
OLD | NEW |