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

Side by Side Diff: test/mjsunit/opt-elements-kind.js

Issue 1262583002: Reland of "Remove ExternalArray, derived types, and element kinds" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 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
« no previous file with comments | « test/mjsunit/elements-kind.js ('k') | test/mjsunit/osr-elements-kind.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 15 matching lines...) Expand all
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 // Flags: --allow-natives-syntax --expose-gc 28 // Flags: --allow-natives-syntax --expose-gc
29 29
30 // Limit the number of stress runs to reduce polymorphism it defeats some of the 30 // Limit the number of stress runs to reduce polymorphism it defeats some of the
31 // assumptions made about how elements transitions work because transition stubs 31 // assumptions made about how elements transitions work because transition stubs
32 // end up going generic. 32 // end up going generic.
33 // Flags: --stress-runs=2 33 // Flags: --stress-runs=2
34 34
35 var elements_kind = { 35 var elements_kind = {
36 fast_smi_only : 'fast smi only elements', 36 fast_smi_only : 'fast smi only elements',
37 fast : 'fast elements', 37 fast : 'fast elements',
38 fast_double : 'fast double elements', 38 fast_double : 'fast double elements',
39 dictionary : 'dictionary elements', 39 dictionary : 'dictionary elements',
40 external_byte : 'external byte elements', 40 fixed_int32 : 'fixed int8 elements',
41 external_unsigned_byte : 'external unsigned byte elements', 41 fixed_uint8 : 'fixed uint8 elements',
42 external_short : 'external short elements', 42 fixed_int16 : 'fixed int16 elements',
43 external_unsigned_short : 'external unsigned short elements', 43 fixed_uint16 : 'fixed uint16 elements',
44 external_int : 'external int elements', 44 fixed_int32 : 'fixed int32 elements',
45 external_unsigned_int : 'external unsigned int elements', 45 fixed_uint32 : 'fixed uint32 elements',
46 external_float : 'external float elements', 46 fixed_float32 : 'fixed float32 elements',
47 external_double : 'external double elements', 47 fixed_float64 : 'fixed float64 elements',
48 external_pixel : 'external pixel elements' 48 fixed_uint8_clamped : 'fixed uint8_clamped elements'
49 } 49 }
50 50
51 function getKind(obj) { 51 function getKind(obj) {
52 if (%HasFastSmiElements(obj)) return elements_kind.fast_smi_only; 52 if (%HasFastSmiElements(obj)) return elements_kind.fast_smi_only;
53 if (%HasFastObjectElements(obj)) return elements_kind.fast; 53 if (%HasFastObjectElements(obj)) return elements_kind.fast;
54 if (%HasFastDoubleElements(obj)) return elements_kind.fast_double; 54 if (%HasFastDoubleElements(obj)) return elements_kind.fast_double;
55 if (%HasDictionaryElements(obj)) return elements_kind.dictionary; 55 if (%HasDictionaryElements(obj)) return elements_kind.dictionary;
56 // Every external kind is also an external array. 56
57 assertTrue(%HasExternalArrayElements(obj)); 57 if (%HasFixedInt8Elements(obj)) {
58 if (%HasExternalByteElements(obj)) { 58 return elements_kind.fixed_int8;
59 return elements_kind.external_byte;
60 } 59 }
61 if (%HasExternalUnsignedByteElements(obj)) { 60 if (%HasFixedUint8Elements(obj)) {
62 return elements_kind.external_unsigned_byte; 61 return elements_kind.fixed_uint8;
63 } 62 }
64 if (%HasExternalShortElements(obj)) { 63 if (%HasFixedInt16Elements(obj)) {
65 return elements_kind.external_short; 64 return elements_kind.fixed_int16;
66 } 65 }
67 if (%HasExternalUnsignedShortElements(obj)) { 66 if (%HasFixedUint16Elements(obj)) {
68 return elements_kind.external_unsigned_short; 67 return elements_kind.fixed_uint16;
69 } 68 }
70 if (%HasExternalIntElements(obj)) { 69 if (%HasFixedInt32Elements(obj)) {
71 return elements_kind.external_int; 70 return elements_kind.fixed_int32;
72 } 71 }
73 if (%HasExternalUnsignedIntElements(obj)) { 72 if (%HasFixedUint32Elements(obj)) {
74 return elements_kind.external_unsigned_int; 73 return elements_kind.fixed_uint32;
75 } 74 }
76 if (%HasExternalFloatElements(obj)) { 75 if (%HasFixedFloat32Elements(obj)) {
77 return elements_kind.external_float; 76 return elements_kind.fixed_float32;
78 } 77 }
79 if (%HasExternalDoubleElements(obj)) { 78 if (%HasFixedFloat64Elements(obj)) {
80 return elements_kind.external_double; 79 return elements_kind.fixed_float64;
81 } 80 }
82 if (%HasExternalPixelElements(obj)) { 81 if (%HasFixedUint8ClampedElements(obj)) {
83 return elements_kind.external_pixel; 82 return elements_kind.fixed_uint8_clamped;
84 } 83 }
85 } 84 }
86 85
87 function assertKind(expected, obj, name_opt) { 86 function assertKind(expected, obj, name_opt) {
88 assertEquals(expected, getKind(obj), name_opt); 87 assertEquals(expected, getKind(obj), name_opt);
89 } 88 }
90 89
91 %NeverOptimizeFunction(construct_smis); 90 %NeverOptimizeFunction(construct_smis);
92 91
93 // This code exists to eliminate the learning influence of AllocationSites 92 // This code exists to eliminate the learning influence of AllocationSites
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 %ClearFunctionTypeFeedback(convert_mixed); 147 %ClearFunctionTypeFeedback(convert_mixed);
149 } 148 }
150 149
151 test1(); 150 test1();
152 clear_ic_state(); 151 clear_ic_state();
153 test1(); 152 test1();
154 clear_ic_state(); 153 clear_ic_state();
155 %OptimizeFunctionOnNextCall(test1); 154 %OptimizeFunctionOnNextCall(test1);
156 test1(); 155 test1();
157 clear_ic_state(); 156 clear_ic_state();
OLDNEW
« no previous file with comments | « test/mjsunit/elements-kind.js ('k') | test/mjsunit/osr-elements-kind.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698