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

Side by Side Diff: src/arm/ic-arm.cc

Issue 35413006: Correct handling of arrays with callbacks in the prototype chain. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ports. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | src/heap.h » ('J')
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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 // Fast case: Do the store, could be either Object or double. 1261 // Fast case: Do the store, could be either Object or double.
1262 __ bind(fast_object); 1262 __ bind(fast_object);
1263 Register scratch_value = r4; 1263 Register scratch_value = r4;
1264 Register address = r5; 1264 Register address = r5;
1265 if (check_map == kCheckMap) { 1265 if (check_map == kCheckMap) {
1266 __ ldr(elements_map, FieldMemOperand(elements, HeapObject::kMapOffset)); 1266 __ ldr(elements_map, FieldMemOperand(elements, HeapObject::kMapOffset));
1267 __ cmp(elements_map, 1267 __ cmp(elements_map,
1268 Operand(masm->isolate()->factory()->fixed_array_map())); 1268 Operand(masm->isolate()->factory()->fixed_array_map()));
1269 __ b(ne, fast_double); 1269 __ b(ne, fast_double);
1270 } 1270 }
1271
1272 // HOLECHECK: guards "A[i] = V"
1273 // We have to go to the runtime if the current value is the hole because
1274 // there may be a callback on the element
1275 Label holecheck_passed1;
1276 __ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1277 __ ldr(scratch_value,
1278 MemOperand::PointerAddressFromSmiKey(address, key, PreIndex));
1279 __ cmp(scratch_value, Operand(masm->isolate()->factory()->the_hole_value()));
1280 __ b(ne, &holecheck_passed1);
1281 __ HasDictionaryInPrototypeChain(receiver, elements, scratch_value, slow);
1282
1283 __ bind(&holecheck_passed1);
1284
1271 // Smi stores don't require further checks. 1285 // Smi stores don't require further checks.
1272 Label non_smi_value; 1286 Label non_smi_value;
1273 __ JumpIfNotSmi(value, &non_smi_value); 1287 __ JumpIfNotSmi(value, &non_smi_value);
1274 1288
1275 if (increment_length == kIncrementLength) { 1289 if (increment_length == kIncrementLength) {
1276 // Add 1 to receiver->length. 1290 // Add 1 to receiver->length.
1277 __ add(scratch_value, key, Operand(Smi::FromInt(1))); 1291 __ add(scratch_value, key, Operand(Smi::FromInt(1)));
1278 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); 1292 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset));
1279 } 1293 }
1280 // It's irrelevant whether array is smi-only or not when writing a smi. 1294 // It's irrelevant whether array is smi-only or not when writing a smi.
(...skipping 27 matching lines...) Expand all
1308 OMIT_SMI_CHECK); 1322 OMIT_SMI_CHECK);
1309 __ Ret(); 1323 __ Ret();
1310 1324
1311 __ bind(fast_double); 1325 __ bind(fast_double);
1312 if (check_map == kCheckMap) { 1326 if (check_map == kCheckMap) {
1313 // Check for fast double array case. If this fails, call through to the 1327 // Check for fast double array case. If this fails, call through to the
1314 // runtime. 1328 // runtime.
1315 __ CompareRoot(elements_map, Heap::kFixedDoubleArrayMapRootIndex); 1329 __ CompareRoot(elements_map, Heap::kFixedDoubleArrayMapRootIndex);
1316 __ b(ne, slow); 1330 __ b(ne, slow);
1317 } 1331 }
1332
1333 // HOLECHECK: guards "A[i] double hole?"
1334 // We have to see if the double version of the hole is present. If so
1335 // go to the runtime.
1336 __ add(address, elements,
1337 Operand((FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32))
1338 - kHeapObjectTag));
1339 __ ldr(scratch_value,
1340 MemOperand(address, key, LSL, kPointerSizeLog2, PreIndex));
1341 __ cmp(scratch_value, Operand(kHoleNanUpper32));
1342 __ b(ne, &fast_double_without_map_check);
1343 __ HasDictionaryInPrototypeChain(receiver, elements, scratch_value, slow);
1344
1318 __ bind(&fast_double_without_map_check); 1345 __ bind(&fast_double_without_map_check);
1319 __ StoreNumberToDoubleElements(value, key, elements, r3, d0, 1346 __ StoreNumberToDoubleElements(value, key, elements, r3, d0,
1320 &transition_double_elements); 1347 &transition_double_elements);
1321 if (increment_length == kIncrementLength) { 1348 if (increment_length == kIncrementLength) {
1322 // Add 1 to receiver->length. 1349 // Add 1 to receiver->length.
1323 __ add(scratch_value, key, Operand(Smi::FromInt(1))); 1350 __ add(scratch_value, key, Operand(Smi::FromInt(1)));
1324 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset)); 1351 __ str(scratch_value, FieldMemOperand(receiver, JSArray::kLengthOffset));
1325 } 1352 }
1326 __ Ret(); 1353 __ Ret();
1327 1354
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 } else { 1680 } else {
1654 ASSERT(Assembler::GetCondition(branch_instr) == ne); 1681 ASSERT(Assembler::GetCondition(branch_instr) == ne);
1655 patcher.EmitCondition(eq); 1682 patcher.EmitCondition(eq);
1656 } 1683 }
1657 } 1684 }
1658 1685
1659 1686
1660 } } // namespace v8::internal 1687 } } // namespace v8::internal
1661 1688
1662 #endif // V8_TARGET_ARCH_ARM 1689 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | src/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698