Lines Matching refs:obj
47 function getKind(obj) { argument
48 if (%HasFastSmiElements(obj)) return elements_kind.fast_smi_only;
49 if (%HasFastObjectElements(obj)) return elements_kind.fast;
50 if (%HasFastDoubleElements(obj)) return elements_kind.fast_double;
51 if (%HasDictionaryElements(obj)) return elements_kind.dictionary;
54 function isHoley(obj) { argument
55 if (%HasFastHoleyElements(obj)) return true;
59 function assertKind(expected, obj, name_opt) { argument
60 assertEquals(expected, getKind(obj), name_opt);
63 function assertHoley(obj, name_opt) { argument
64 assertEquals(true, isHoley(obj), name_opt);
67 function assertNotHoley(obj, name_opt) { argument
68 assertEquals(false, isHoley(obj), name_opt);
71 obj = [];
72 assertNotHoley(obj);
73 assertKind(elements_kind.fast_smi_only, obj);
75 obj = [1, 2, 3];
76 assertNotHoley(obj);
77 assertKind(elements_kind.fast_smi_only, obj);
79 obj = new Array(); variable
80 assertNotHoley(obj);
81 assertKind(elements_kind.fast_smi_only, obj);
83 obj = new Array(0); variable
84 assertNotHoley(obj);
85 assertKind(elements_kind.fast_smi_only, obj);
87 obj = new Array(2); variable
88 assertHoley(obj);
89 assertKind(elements_kind.fast_smi_only, obj);
91 obj = new Array(1,2,3); variable
92 assertNotHoley(obj);
93 assertKind(elements_kind.fast_smi_only, obj);
95 obj = new Array(1, "hi", 2, undefined); variable
96 assertNotHoley(obj);
97 assertKind(elements_kind.fast, obj);
110 obj = fastliteralcase(get_standard_literal(), 1);
111 assertKind(elements_kind.fast_smi_only, obj);
112 obj = fastliteralcase(get_standard_literal(), 1.5);
113 assertKind(elements_kind.fast_double, obj);
114 obj = fastliteralcase(get_standard_literal(), 2);
115 assertKind(elements_kind.fast_double, obj);
121 obj = fastliteralcase([5, 3, 2], 1.5);
122 assertKind(elements_kind.fast_double, obj);
123 obj = fastliteralcase([3, 6, 2], 1.5);
124 assertKind(elements_kind.fast_double, obj);
129 obj = fastliteralcase([2, 6, 3], 2);
130 assertKind(elements_kind.fast_double, obj);
134 obj = fastliteralcase(get_standard_literal(), "elliot");
135 assertKind(elements_kind.fast, obj);
136 obj = fastliteralcase(get_standard_literal(), 3);
137 assertKind(elements_kind.fast, obj);
142 obj = get_standard_literal();
143 assertKind(elements_kind.fast, obj);
151 obj = fastliteralcase_smifast(1);
152 assertKind(elements_kind.fast_smi_only, obj);
153 obj = fastliteralcase_smifast("carter");
154 assertKind(elements_kind.fast, obj);
155 obj = fastliteralcase_smifast(2);
156 assertKind(elements_kind.fast, obj);
165 obj = fastliteralcase_smiholey(5, 1);
166 assertKind(elements_kind.fast_smi_only, obj);
167 assertHoley(obj);
168 obj = fastliteralcase_smiholey(0, 1);
169 assertKind(elements_kind.fast_smi_only, obj);
170 assertHoley(obj);
179 obj = newarraycase_smidouble(1);
180 assertKind(elements_kind.fast_smi_only, obj);
181 obj = newarraycase_smidouble(1.5);
182 assertKind(elements_kind.fast_double, obj);
183 obj = newarraycase_smidouble(2);
184 assertKind(elements_kind.fast_double, obj);
193 obj = newarraycase_smiobj(1);
194 assertKind(elements_kind.fast_smi_only, obj);
195 obj = newarraycase_smiobj("gloria");
196 assertKind(elements_kind.fast, obj);
197 obj = newarraycase_smiobj(2);
198 assertKind(elements_kind.fast, obj);
207 obj = newarraycase_length_smidouble(1);
208 assertKind(elements_kind.fast_smi_only, obj);
209 obj = newarraycase_length_smidouble(1.5);
210 assertKind(elements_kind.fast_double, obj);
211 obj = newarraycase_length_smidouble(2);
212 assertKind(elements_kind.fast_double, obj);
217 obj = newarraycase_length_smidouble("coates");
218 assertKind(elements_kind.fast, obj);
219 obj = newarraycase_length_smidouble(2);
229 obj = newarraycase_length_smiobj(1);
230 assertKind(elements_kind.fast_smi_only, obj);
231 obj = newarraycase_length_smiobj("gloria");
232 assertKind(elements_kind.fast, obj);
233 obj = newarraycase_length_smiobj(2);
234 assertKind(elements_kind.fast, obj);
242 obj = newarraycase_list_smidouble(1);
243 assertKind(elements_kind.fast_smi_only, obj);
244 obj = newarraycase_list_smidouble(1.5);
245 assertKind(elements_kind.fast_double, obj);
246 obj = newarraycase_list_smidouble(2);
247 assertKind(elements_kind.fast_double, obj);
255 obj = newarraycase_list_smiobj(1);
256 assertKind(elements_kind.fast_smi_only, obj);
257 obj = newarraycase_list_smiobj("coates");
258 assertKind(elements_kind.fast, obj);
259 obj = newarraycase_list_smiobj(2);
260 assertKind(elements_kind.fast, obj);
294 obj = newarraycase_onearg(5, 3.5);
295 assertKind(elements_kind.fast_double, obj);
296 obj = newarraycase_onearg(10, 5);
297 assertKind(elements_kind.fast_double, obj);
298 obj = newarraycase_onearg(0, 5);
299 assertKind(elements_kind.fast_double, obj);
365 obj = get_nested_literal();
366 assertKind(elements_kind.fast, obj);
367 obj[0][0] = 3.5;
368 obj[2][0] = "hello";
369 obj = get_nested_literal();
370 assertKind(elements_kind.fast_double, obj[0]);
371 assertKind(elements_kind.fast_smi_only, obj[1]);
372 assertKind(elements_kind.fast, obj[2]);
380 obj = get_deep_nested_literal();
381 assertKind(elements_kind.fast_smi_only, obj[1][0]);
382 obj[0][0] = 3.5;
383 obj[1][0][0] = "goodbye";
384 assertKind(elements_kind.fast_double, obj[0]);
385 assertKind(elements_kind.fast, obj[1][0]);
387 obj = get_deep_nested_literal();
388 assertKind(elements_kind.fast_double, obj[0]);
389 assertKind(elements_kind.fast, obj[1][0]);
410 obj = get_object_literal();
411 assertKind(elements_kind.fast_smi_only, obj.array);
412 obj.array[1] = 3.5;
413 assertKind(elements_kind.fast_double, obj.array);
414 obj = get_object_literal();
415 assertKind(elements_kind.fast_double, obj.array);
425 obj = get_nested_object_literal();
426 assertKind(elements_kind.fast, obj.array);
427 assertKind(elements_kind.fast_smi_only, obj.array[1]);
428 obj.array[1][0] = 3.5;
429 assertKind(elements_kind.fast_double, obj.array[1]);
430 obj = get_nested_object_literal();
431 assertKind(elements_kind.fast_double, obj.array[1]);
435 obj = get_nested_object_literal();
436 assertKind(elements_kind.fast_double, obj.array[1]);
444 obj = get_nested_literal();
445 assertKind(elements_kind.fast, obj);
446 obj[0][0] = 3.5;
447 obj[2][0] = "hello";
448 obj = get_nested_literal();
449 assertKind(elements_kind.fast_double, obj[0]);
450 assertKind(elements_kind.fast_smi_only, obj[1]);
451 assertKind(elements_kind.fast, obj[2]);
459 obj = get_deep_nested_literal();
460 assertKind(elements_kind.fast_smi_only, obj[1][0]);
461 obj[0][0] = 3.5;
462 obj[1][0][0] = "goodbye";
463 assertKind(elements_kind.fast_double, obj[0]);
464 assertKind(elements_kind.fast, obj[1][0]);
466 obj = get_deep_nested_literal();
467 assertKind(elements_kind.fast_double, obj[0]);
468 assertKind(elements_kind.fast, obj[1][0]);