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

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

Issue 8177005: Active smi-only optimizations for large array literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 2 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 | « src/arm/full-codegen-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('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 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 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 // Smi stores don't require further checks. 1373 // Smi stores don't require further checks.
1374 Label non_smi_value; 1374 Label non_smi_value;
1375 __ JumpIfNotSmi(value, &non_smi_value); 1375 __ JumpIfNotSmi(value, &non_smi_value);
1376 // It's irrelevant whether array is smi-only or not when writing a smi. 1376 // It's irrelevant whether array is smi-only or not when writing a smi.
1377 __ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 1377 __ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1378 __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize)); 1378 __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize));
1379 __ str(value, MemOperand(address)); 1379 __ str(value, MemOperand(address));
1380 __ Ret(); 1380 __ Ret();
1381 1381
1382 __ bind(&non_smi_value); 1382 __ bind(&non_smi_value);
1383 if (FLAG_smi_only_arrays) { 1383 // Escape to slow case when writing non-smi into smi-only array.
1384 // Escape to slow case when writing non-smi into smi-only array. 1384 __ CheckFastObjectElements(receiver_map, scratch_value, &slow);
1385 __ CheckFastObjectElements(receiver_map, scratch_value, &slow);
1386 }
1387 // Fast elements array, store the value to the elements backing store. 1385 // Fast elements array, store the value to the elements backing store.
1388 __ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 1386 __ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1389 __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize)); 1387 __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize));
1390 __ str(value, MemOperand(address)); 1388 __ str(value, MemOperand(address));
1391 // Update write barrier for the elements array address. 1389 // Update write barrier for the elements array address.
1392 __ mov(scratch_value, value); // Preserve the value which is returned. 1390 __ mov(scratch_value, value); // Preserve the value which is returned.
1393 __ RecordWrite(elements, 1391 __ RecordWrite(elements,
1394 address, 1392 address,
1395 scratch_value, 1393 scratch_value,
1396 kLRHasNotBeenSaved, 1394 kLRHasNotBeenSaved,
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 Register reg = Assembler::GetRn(instr_at_patch); 1666 Register reg = Assembler::GetRn(instr_at_patch);
1669 patcher.masm()->tst(reg, Operand(kSmiTagMask)); 1667 patcher.masm()->tst(reg, Operand(kSmiTagMask));
1670 patcher.EmitCondition(eq); 1668 patcher.EmitCondition(eq);
1671 } 1669 }
1672 } 1670 }
1673 1671
1674 1672
1675 } } // namespace v8::internal 1673 } } // namespace v8::internal
1676 1674
1677 #endif // V8_TARGET_ARCH_ARM 1675 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698