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

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 2870018: Add "has fast elements" bit to maps and use it in inlined keyed loads. (Closed)
Patch Set: More ARM fixes. Created 10 years, 6 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 | « src/heap.cc ('k') | src/ic.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 8835 matching lines...) Expand 10 before | Expand all | Expand 10 after
8846 __ test(receiver.reg(), Immediate(kSmiTagMask)); 8846 __ test(receiver.reg(), Immediate(kSmiTagMask));
8847 deferred->Branch(zero); 8847 deferred->Branch(zero);
8848 8848
8849 // Check that the receiver has the expected map. 8849 // Check that the receiver has the expected map.
8850 // Initially, use an invalid map. The map is patched in the IC 8850 // Initially, use an invalid map. The map is patched in the IC
8851 // initialization code. 8851 // initialization code.
8852 __ bind(deferred->patch_site()); 8852 __ bind(deferred->patch_site());
8853 // Use masm-> here instead of the double underscore macro since extra 8853 // Use masm-> here instead of the double underscore macro since extra
8854 // coverage code can interfere with the patching. 8854 // coverage code can interfere with the patching.
8855 masm_->cmp(FieldOperand(receiver.reg(), HeapObject::kMapOffset), 8855 masm_->cmp(FieldOperand(receiver.reg(), HeapObject::kMapOffset),
8856 Immediate(Factory::null_value())); 8856 Immediate(Factory::null_value()));
8857 deferred->Branch(not_equal); 8857 deferred->Branch(not_equal);
8858 8858
8859 // Check that the key is a smi. 8859 // Check that the key is a smi.
8860 if (!key.is_smi()) { 8860 if (!key.is_smi()) {
8861 __ test(key.reg(), Immediate(kSmiTagMask)); 8861 __ test(key.reg(), Immediate(kSmiTagMask));
8862 deferred->Branch(not_zero); 8862 deferred->Branch(not_zero);
8863 } else { 8863 } else {
8864 if (FLAG_debug_code) __ AbortIfNotSmi(key.reg()); 8864 if (FLAG_debug_code) __ AbortIfNotSmi(key.reg());
8865 } 8865 }
8866 8866
8867 // Get the elements array from the receiver and check that it 8867 // Get the elements array from the receiver and check that it
8868 // is not a dictionary. 8868 // is not a dictionary.
8869 __ mov(elements.reg(), 8869 __ mov(elements.reg(),
8870 FieldOperand(receiver.reg(), JSObject::kElementsOffset)); 8870 FieldOperand(receiver.reg(), JSObject::kElementsOffset));
8871 __ cmp(FieldOperand(elements.reg(), HeapObject::kMapOffset), 8871 if (FLAG_debug_code) {
8872 Immediate(Factory::fixed_array_map())); 8872 __ cmp(FieldOperand(elements.reg(), HeapObject::kMapOffset),
8873 deferred->Branch(not_equal); 8873 Immediate(Factory::fixed_array_map()));
8874 __ Assert(equal, "JSObject with fast elements map has slow elements");
8875 }
8874 8876
8875 // Check that the key is within bounds. 8877 // Check that the key is within bounds.
8876 __ cmp(key.reg(), 8878 __ cmp(key.reg(),
8877 FieldOperand(elements.reg(), FixedArray::kLengthOffset)); 8879 FieldOperand(elements.reg(), FixedArray::kLengthOffset));
8878 deferred->Branch(above_equal); 8880 deferred->Branch(above_equal);
8879 8881
8880 // Load and check that the result is not the hole. 8882 // Load and check that the result is not the hole.
8881 // Key holds a smi. 8883 // Key holds a smi.
8882 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); 8884 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1));
8883 __ mov(elements.reg(), 8885 __ mov(elements.reg(),
(...skipping 4843 matching lines...) Expand 10 before | Expand all | Expand 10 after
13727 masm.GetCode(&desc); 13729 masm.GetCode(&desc);
13728 // Call the function from C++. 13730 // Call the function from C++.
13729 return FUNCTION_CAST<MemCopyFunction>(buffer); 13731 return FUNCTION_CAST<MemCopyFunction>(buffer);
13730 } 13732 }
13731 13733
13732 #undef __ 13734 #undef __
13733 13735
13734 } } // namespace v8::internal 13736 } } // namespace v8::internal
13735 13737
13736 #endif // V8_TARGET_ARCH_IA32 13738 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698