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

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

Issue 7995002: Porting r9392 to arm (smi-only arrays). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 1353
1354 // Check the key against the length in the array. 1354 // Check the key against the length in the array.
1355 __ ldr(ip, FieldMemOperand(receiver, JSArray::kLengthOffset)); 1355 __ ldr(ip, FieldMemOperand(receiver, JSArray::kLengthOffset));
1356 __ cmp(key, Operand(ip)); 1356 __ cmp(key, Operand(ip));
1357 __ b(hs, &extra); 1357 __ b(hs, &extra);
1358 // Fall through to fast case. 1358 // Fall through to fast case.
1359 1359
1360 __ bind(&fast); 1360 __ bind(&fast);
1361 Register scratch_value = r4; 1361 Register scratch_value = r4;
1362 Register address = r5; 1362 Register address = r5;
1363 if (FLAG_smi_only_arrays) {
1364 Label not_smi_only;
1365 // Make sure the elements are smi-only.
1366 __ ldr(scratch_value, FieldMemOperand(receiver, HeapObject::kMapOffset));
1367 __ CheckFastSmiOnlyElements(scratch_value, scratch_value, &not_smi_only);
1368 // Non-smis need to call into the runtime if the array is smi only.
1369 __ JumpIfNotSmi(value, &slow);
1370 __ add(address, elements,
1371 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1372 __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize));
1373 __ str(value, MemOperand(address));
1374 __ Ret();
1375 __ bind(&not_smi_only);
1376 }
1363 // Fast case, store the value to the elements backing store. 1377 // Fast case, store the value to the elements backing store.
1364 __ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 1378 __ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1365 __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize)); 1379 __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize));
1366 __ str(value, MemOperand(address)); 1380 __ str(value, MemOperand(address));
1367 // Skip write barrier if the written value is a smi. 1381 // Skip write barrier if the written value is a smi.
1368 __ tst(value, Operand(kSmiTagMask)); 1382 __ tst(value, Operand(kSmiTagMask));
1369 __ Ret(eq); 1383 __ Ret(eq);
1370 1384
1371 // Update write barrier for the elements array address. 1385 // Update write barrier for the elements array address.
1372 __ mov(scratch_value, value); // Preserve the value which is returned. 1386 __ mov(scratch_value, value); // Preserve the value which is returned.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 Register reg = Assembler::GetRn(instr_at_patch); 1645 Register reg = Assembler::GetRn(instr_at_patch);
1632 patcher.masm()->tst(reg, Operand(kSmiTagMask)); 1646 patcher.masm()->tst(reg, Operand(kSmiTagMask));
1633 patcher.EmitCondition(eq); 1647 patcher.EmitCondition(eq);
1634 } 1648 }
1635 } 1649 }
1636 1650
1637 1651
1638 } } // namespace v8::internal 1652 } } // namespace v8::internal
1639 1653
1640 #endif // V8_TARGET_ARCH_ARM 1654 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698