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

Side by Side Diff: test/mjsunit/allocation-site-info.js

Issue 146213004: A64: Synchronize with r16849. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « test/intl/intl.status ('k') | test/mjsunit/array-literal-feedback.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 17 matching lines...) Expand all
28 // Flags: --allow-natives-syntax --smi-only-arrays --expose-gc 28 // Flags: --allow-natives-syntax --smi-only-arrays --expose-gc
29 // Flags: --track-allocation-sites --noalways-opt 29 // Flags: --track-allocation-sites --noalways-opt
30 30
31 // Test element kind of objects. 31 // Test element kind of objects.
32 // Since --smi-only-arrays affects builtins, its default setting at compile 32 // Since --smi-only-arrays affects builtins, its default setting at compile
33 // time sticks if built with snapshot. If --smi-only-arrays is deactivated 33 // time sticks if built with snapshot. If --smi-only-arrays is deactivated
34 // by default, only a no-snapshot build actually has smi-only arrays enabled 34 // by default, only a no-snapshot build actually has smi-only arrays enabled
35 // in this test case. Depending on whether smi-only arrays are actually 35 // in this test case. Depending on whether smi-only arrays are actually
36 // enabled, this test takes the appropriate code path to check smi-only arrays. 36 // enabled, this test takes the appropriate code path to check smi-only arrays.
37 37
38 // Reset the GC stress mode to be off. Needed because AllocationMementos only
39 // live for one gc, so a gc that happens in certain fragile areas of the test
40 // can break assumptions.
41 %SetFlags("--gc-interval=-1")
42
38 // support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); 43 // support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8));
39 support_smi_only_arrays = true; 44 support_smi_only_arrays = true;
40 45
41 if (support_smi_only_arrays) { 46 if (support_smi_only_arrays) {
42 print("Tests include smi-only arrays."); 47 print("Tests include smi-only arrays.");
43 } else { 48 } else {
44 print("Tests do NOT include smi-only arrays."); 49 print("Tests do NOT include smi-only arrays.");
45 } 50 }
46 51
47 var elements_kind = { 52 var elements_kind = {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 assertKind(elements_kind.fast_double, obj); 148 assertKind(elements_kind.fast_double, obj);
144 obj = fastliteralcase([3, 6, 2], 1.5); 149 obj = fastliteralcase([3, 6, 2], 1.5);
145 assertKind(elements_kind.fast_double, obj); 150 assertKind(elements_kind.fast_double, obj);
146 obj = fastliteralcase([2, 6, 3], 2); 151 obj = fastliteralcase([2, 6, 3], 2);
147 assertKind(elements_kind.fast_smi_only, obj); 152 assertKind(elements_kind.fast_smi_only, obj);
148 } 153 }
149 154
150 // Verify that we will not pretransition the double->fast path. 155 // Verify that we will not pretransition the double->fast path.
151 obj = fastliteralcase(get_standard_literal(), "elliot"); 156 obj = fastliteralcase(get_standard_literal(), "elliot");
152 assertKind(elements_kind.fast, obj); 157 assertKind(elements_kind.fast, obj);
153 // This fails until we turn off optimistic transitions to the 158 obj = fastliteralcase(get_standard_literal(), 3);
154 // most general elements kind seen on keyed stores. It's a goal 159 assertKind(elements_kind.fast, obj);
155 // to turn it off, but for now we need it.
156 // obj = fastliteralcase(3);
157 // assertKind(elements_kind.fast_double, obj);
158 160
159 // Make sure this works in crankshafted code too. 161 // Make sure this works in crankshafted code too.
160 %OptimizeFunctionOnNextCall(get_standard_literal); 162 %OptimizeFunctionOnNextCall(get_standard_literal);
161 get_standard_literal(); 163 get_standard_literal();
162 obj = get_standard_literal(); 164 obj = get_standard_literal();
163 assertKind(elements_kind.fast_double, obj); 165 assertKind(elements_kind.fast, obj);
164 166
165 function fastliteralcase_smifast(value) { 167 function fastliteralcase_smifast(value) {
166 var literal = [1, 2, 3, 4]; 168 var literal = [1, 2, 3, 4];
167 literal[0] = value; 169 literal[0] = value;
168 return literal; 170 return literal;
169 } 171 }
170 172
171 obj = fastliteralcase_smifast(1); 173 obj = fastliteralcase_smifast(1);
172 assertKind(elements_kind.fast_smi_only, obj); 174 assertKind(elements_kind.fast_smi_only, obj);
173 obj = fastliteralcase_smifast("carter"); 175 obj = fastliteralcase_smifast("carter");
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 226 }
225 227
226 // Case: new Array(length) as allocation site 228 // Case: new Array(length) as allocation site
227 obj = newarraycase_length_smidouble(1); 229 obj = newarraycase_length_smidouble(1);
228 assertKind(elements_kind.fast_smi_only, obj); 230 assertKind(elements_kind.fast_smi_only, obj);
229 obj = newarraycase_length_smidouble(1.5); 231 obj = newarraycase_length_smidouble(1.5);
230 assertKind(elements_kind.fast_double, obj); 232 assertKind(elements_kind.fast_double, obj);
231 obj = newarraycase_length_smidouble(2); 233 obj = newarraycase_length_smidouble(2);
232 assertKind(elements_kind.fast_double, obj); 234 assertKind(elements_kind.fast_double, obj);
233 235
234 // Try to continue the transition to fast object, but 236 // Try to continue the transition to fast object. This won't work for
235 // we will not pretransition from double->fast, because 237 // constructed arrays because constructor dispatch is done on the
236 // it may hurt performance ("poisoning"). 238 // elements kind, and a DOUBLE array constructor won't create an allocation
239 // memento.
237 obj = newarraycase_length_smidouble("coates"); 240 obj = newarraycase_length_smidouble("coates");
238 assertKind(elements_kind.fast, obj); 241 assertKind(elements_kind.fast, obj);
239 obj = newarraycase_length_smidouble(2.5); 242 obj = newarraycase_length_smidouble(2);
240 // However, because of optimistic transitions, we will 243 assertKind(elements_kind.fast_double, obj);
241 // transition to the most general kind of elements kind found,
242 // therefore I can't count on this assert yet.
243 // assertKind(elements_kind.fast_double, obj);
244 244
245 function newarraycase_length_smiobj(value) { 245 function newarraycase_length_smiobj(value) {
246 var a = new Array(3); 246 var a = new Array(3);
247 a[0] = value; 247 a[0] = value;
248 return a; 248 return a;
249 } 249 }
250 250
251 // Case: new Array(<length>) as allocation site, smi->fast 251 // Case: new Array(<length>) as allocation site, smi->fast
252 obj = newarraycase_length_smiobj(1); 252 obj = newarraycase_length_smiobj(1);
253 assertKind(elements_kind.fast_smi_only, obj); 253 assertKind(elements_kind.fast_smi_only, obj);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 %ClearFunctionTypeFeedback(instanceof_check); 373 %ClearFunctionTypeFeedback(instanceof_check);
374 instanceof_check(Array); 374 instanceof_check(Array);
375 instanceof_check(Array); 375 instanceof_check(Array);
376 %OptimizeFunctionOnNextCall(instanceof_check); 376 %OptimizeFunctionOnNextCall(instanceof_check);
377 instanceof_check(Array); 377 instanceof_check(Array);
378 assertOptimized(instanceof_check); 378 assertOptimized(instanceof_check);
379 379
380 instanceof_check(realmBArray); 380 instanceof_check(realmBArray);
381 assertUnoptimized(instanceof_check); 381 assertUnoptimized(instanceof_check);
382 } 382 }
OLDNEW
« no previous file with comments | « test/intl/intl.status ('k') | test/mjsunit/array-literal-feedback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698