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

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

Issue 1447203002: Fix disassembly output for background compilation; modify some tests to run long enough for backgro… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/dart_api_impl.h" 5 #include "vm/dart_api_impl.h"
6 #include "vm/dart_api_state.h" 6 #include "vm/dart_api_state.h"
7 #include "vm/intermediate_language.h" 7 #include "vm/intermediate_language.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 " }\n" 47 " }\n"
48 "}\n" 48 "}\n"
49 "\n" 49 "\n"
50 "runBar() {\n" 50 "runBar() {\n"
51 " var a = new A();\n" 51 " var a = new A();\n"
52 " for (int i = 0; i < 2000; i++) {\n" 52 " for (int i = 0; i < 2000; i++) {\n"
53 " a.bar();\n" 53 " a.bar();\n"
54 " }\n" 54 " }\n"
55 "}\n" 55 "}\n"
56 "main() {\n" 56 "main() {\n"
57 " runFoo();\n" 57 " for (int i = 0; i < 100; i++) {\n"
58 " runBar();\n" 58 " runFoo();\n"
59 " runBar();\n"
60 " }\n"
59 "}\n"; 61 "}\n";
60 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL); 62 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL);
61 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); 63 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
62 EXPECT_VALID(result); 64 EXPECT_VALID(result);
63 Field& f1 = Field::ZoneHandle(LookupField(lib, "A", "f1")); 65 Field& f1 = Field::ZoneHandle(LookupField(lib, "A", "f1"));
64 Field& f2 = Field::ZoneHandle(LookupField(lib, "A", "f2")); 66 Field& f2 = Field::ZoneHandle(LookupField(lib, "A", "f2"));
65 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3")); 67 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3"));
66 const intptr_t no_length = Field::kNoFixedLength; 68 const intptr_t no_length = Field::kNoFixedLength;
67 EXPECT_EQ(no_length, f1.guarded_list_length()); 69 EXPECT_EQ(no_length, f1.guarded_list_length());
68 EXPECT_EQ(kDoubleCid, f1.guarded_cid()); 70 EXPECT_EQ(kDoubleCid, f1.guarded_cid());
(...skipping 27 matching lines...) Expand all
96 " }\n" 98 " }\n"
97 "}\n" 99 "}\n"
98 "\n" 100 "\n"
99 "runBar() {\n" 101 "runBar() {\n"
100 " var a = new A();\n" 102 " var a = new A();\n"
101 " for (int i = 0; i < 2000; i++) {\n" 103 " for (int i = 0; i < 2000; i++) {\n"
102 " a.bar();\n" 104 " a.bar();\n"
103 " }\n" 105 " }\n"
104 "}\n" 106 "}\n"
105 "main() {\n" 107 "main() {\n"
106 " runFoo();\n" 108 " for (int i = 0; i < 100; i++) {\n"
107 " runBar();\n" 109 " runFoo();\n"
110 " runBar();\n"
111 " }\n"
108 "}\n"; 112 "}\n";
109 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL); 113 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL);
110 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); 114 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
111 EXPECT_VALID(result); 115 EXPECT_VALID(result);
112 Field& f1 = Field::ZoneHandle(LookupField(lib, "A", "f1")); 116 Field& f1 = Field::ZoneHandle(LookupField(lib, "A", "f1"));
113 Field& f2 = Field::ZoneHandle(LookupField(lib, "A", "f2")); 117 Field& f2 = Field::ZoneHandle(LookupField(lib, "A", "f2"));
114 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3")); 118 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3"));
115 const intptr_t no_length = Field::kNoFixedLength; 119 const intptr_t no_length = Field::kNoFixedLength;
116 EXPECT_EQ(no_length, f1.guarded_list_length()); 120 EXPECT_EQ(no_length, f1.guarded_list_length());
117 EXPECT_EQ(kDoubleCid, f1.guarded_cid()); 121 EXPECT_EQ(kDoubleCid, f1.guarded_cid());
(...skipping 29 matching lines...) Expand all
147 " }\n" 151 " }\n"
148 "}\n" 152 "}\n"
149 "\n" 153 "\n"
150 "runBar() {\n" 154 "runBar() {\n"
151 " var a = new A();\n" 155 " var a = new A();\n"
152 " for (int i = 0; i < 2000; i++) {\n" 156 " for (int i = 0; i < 2000; i++) {\n"
153 " a.bar();\n" 157 " a.bar();\n"
154 " }\n" 158 " }\n"
155 "}\n" 159 "}\n"
156 "main() {\n" 160 "main() {\n"
157 " runFoo();\n" 161 " for (int i = 0; i < 100; i++) {\n"
158 " runBar();\n" 162 " runFoo();\n"
163 " runBar();\n"
164 " }\n"
159 "}\n"; 165 "}\n";
160 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL); 166 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL);
161 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); 167 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
162 EXPECT_VALID(result); 168 EXPECT_VALID(result);
163 Field& f1 = Field::ZoneHandle(LookupField(lib, "A", "f1")); 169 Field& f1 = Field::ZoneHandle(LookupField(lib, "A", "f1"));
164 Field& f2 = Field::ZoneHandle(LookupField(lib, "A", "f2")); 170 Field& f2 = Field::ZoneHandle(LookupField(lib, "A", "f2"));
165 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3")); 171 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3"));
166 const intptr_t no_length = Field::kNoFixedLength; 172 const intptr_t no_length = Field::kNoFixedLength;
167 EXPECT_EQ(no_length, f1.guarded_list_length()); 173 EXPECT_EQ(no_length, f1.guarded_list_length());
168 EXPECT_EQ(kDoubleCid, f1.guarded_cid()); 174 EXPECT_EQ(kDoubleCid, f1.guarded_cid());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 "}\n" 208 "}\n"
203 "\n" 209 "\n"
204 "runBar() {\n" 210 "runBar() {\n"
205 " var l = new Float32List(5);\n" 211 " var l = new Float32List(5);\n"
206 " var a = new A(l);\n" 212 " var a = new A(l);\n"
207 " for (int i = 0; i < 2000; i++) {\n" 213 " for (int i = 0; i < 2000; i++) {\n"
208 " a.bar();\n" 214 " a.bar();\n"
209 " }\n" 215 " }\n"
210 "}\n" 216 "}\n"
211 "main() {\n" 217 "main() {\n"
212 " runFoo();\n" 218 " for (int i = 0; i < 100; i++) {\n"
213 " runBar();\n" 219 " runFoo();\n"
220 " runBar();\n"
221 " }\n"
214 "}\n"; 222 "}\n";
215 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL); 223 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL);
216 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); 224 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
217 EXPECT_VALID(result); 225 EXPECT_VALID(result);
218 Field& f1 = Field::ZoneHandle(LookupField(lib, "A", "f1")); 226 Field& f1 = Field::ZoneHandle(LookupField(lib, "A", "f1"));
219 Field& f2 = Field::ZoneHandle(LookupField(lib, "A", "f2")); 227 Field& f2 = Field::ZoneHandle(LookupField(lib, "A", "f2"));
220 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3")); 228 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3"));
221 const intptr_t no_length = Field::kNoFixedLength; 229 const intptr_t no_length = Field::kNoFixedLength;
222 EXPECT_EQ(no_length, f1.guarded_list_length()); 230 EXPECT_EQ(no_length, f1.guarded_list_length());
223 EXPECT_EQ(kDoubleCid, f1.guarded_cid()); 231 EXPECT_EQ(kDoubleCid, f1.guarded_cid());
(...skipping 25 matching lines...) Expand all
249 " for (int i = 0; i < 2000; i++) {\n" 257 " for (int i = 0; i < 2000; i++) {\n"
250 " var a = new A(l);\n" 258 " var a = new A(l);\n"
251 " }\n" 259 " }\n"
252 "}\n" 260 "}\n"
253 "\n" 261 "\n"
254 "runBar() {\n" 262 "runBar() {\n"
255 " var l = new Float32List(99);\n" 263 " var l = new Float32List(99);\n"
256 " var a = new A(l);\n" 264 " var a = new A(l);\n"
257 "}\n" 265 "}\n"
258 "main() {\n" 266 "main() {\n"
259 " runFoo();\n" 267 " for (int i = 0; i < 100; i++) {\n"
260 " runBar();\n" 268 " runFoo();\n"
269 " runBar();\n"
270 " }\n"
261 "}\n"; 271 "}\n";
262 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL); 272 Dart_Handle lib = TestCase::LoadTestScript(script_chars, NULL);
263 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); 273 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
264 EXPECT_VALID(result); 274 EXPECT_VALID(result);
265 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3")); 275 Field& f3 = Field::ZoneHandle(LookupField(lib, "A", "f3"));
266 const intptr_t no_length = Field::kNoFixedLength; 276 const intptr_t no_length = Field::kNoFixedLength;
267 EXPECT_EQ(no_length, f3.guarded_list_length()); 277 EXPECT_EQ(no_length, f3.guarded_list_length());
268 EXPECT_EQ(kTypedDataFloat32ArrayCid, f3.guarded_cid()); 278 EXPECT_EQ(kTypedDataFloat32ArrayCid, f3.guarded_cid());
269 EXPECT_EQ(false, f3.is_nullable()); 279 EXPECT_EQ(false, f3.is_nullable());
270 } 280 }
271 281
272 } // namespace dart 282 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698