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

Side by Side Diff: src/arm/codegen-arm.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/arm/codegen-arm.h ('k') | src/arm/ic-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 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 6098 matching lines...) Expand 10 before | Expand all | Expand 10 after
6109 Label check_inlined_codesize; 6109 Label check_inlined_codesize;
6110 masm_->bind(&check_inlined_codesize); 6110 masm_->bind(&check_inlined_codesize);
6111 #endif 6111 #endif
6112 __ mov(scratch2, Operand(Factory::null_value())); 6112 __ mov(scratch2, Operand(Factory::null_value()));
6113 __ cmp(scratch1, scratch2); 6113 __ cmp(scratch1, scratch2);
6114 deferred->Branch(ne); 6114 deferred->Branch(ne);
6115 6115
6116 // Get the elements array from the receiver and check that it 6116 // Get the elements array from the receiver and check that it
6117 // is not a dictionary. 6117 // is not a dictionary.
6118 __ ldr(scratch1, FieldMemOperand(receiver, JSObject::kElementsOffset)); 6118 __ ldr(scratch1, FieldMemOperand(receiver, JSObject::kElementsOffset));
6119 __ ldr(scratch2, FieldMemOperand(scratch1, JSObject::kMapOffset)); 6119 if (FLAG_debug_code) {
6120 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); 6120 __ ldr(scratch2, FieldMemOperand(scratch1, JSObject::kMapOffset));
6121 __ cmp(scratch2, ip); 6121 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
6122 deferred->Branch(ne); 6122 __ cmp(scratch2, ip);
6123 __ Assert(eq, "JSObject with fast elements map has slow elements");
6124 }
6123 6125
6124 // Check that key is within bounds. Use unsigned comparison to handle 6126 // Check that key is within bounds. Use unsigned comparison to handle
6125 // negative keys. 6127 // negative keys.
6126 __ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); 6128 __ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset));
6127 __ cmp(scratch2, key); 6129 __ cmp(scratch2, key);
6128 deferred->Branch(ls); // Unsigned less equal. 6130 deferred->Branch(ls); // Unsigned less equal.
6129 6131
6130 // Load and check that the result is not the hole (key is a smi). 6132 // Load and check that the result is not the hole (key is a smi).
6131 __ LoadRoot(scratch2, Heap::kTheHoleValueRootIndex); 6133 __ LoadRoot(scratch2, Heap::kTheHoleValueRootIndex);
6132 __ add(scratch1, 6134 __ add(scratch1,
6133 scratch1, 6135 scratch1,
6134 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 6136 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
6135 __ ldr(scratch1, 6137 __ ldr(scratch1,
6136 MemOperand(scratch1, key, LSL, 6138 MemOperand(scratch1, key, LSL,
6137 kPointerSizeLog2 - (kSmiTagSize + kSmiShiftSize))); 6139 kPointerSizeLog2 - (kSmiTagSize + kSmiShiftSize)));
6138 __ cmp(scratch1, scratch2); 6140 __ cmp(scratch1, scratch2);
6139 deferred->Branch(eq); 6141 deferred->Branch(eq);
6140 6142
6141 __ mov(r0, scratch1); 6143 __ mov(r0, scratch1);
6142 // Make sure that the expected number of instructions are generated. 6144 // Make sure that the expected number of instructions are generated.
6143 ASSERT_EQ(kInlinedKeyedLoadInstructionsAfterPatch, 6145 ASSERT_EQ(GetInlinedKeyedLoadInstructionsAfterPatch(),
6144 masm_->InstructionsGeneratedSince(&check_inlined_codesize)); 6146 masm_->InstructionsGeneratedSince(&check_inlined_codesize));
6145 } 6147 }
6146 6148
6147 deferred->BindExit(); 6149 deferred->BindExit();
6148 } 6150 }
6149 } 6151 }
6150 6152
6151 6153
6152 void CodeGenerator::EmitKeyedStore(StaticType* key_type) { 6154 void CodeGenerator::EmitKeyedStore(StaticType* key_type) {
6153 // Generate inlined version of the keyed store if the code is in a loop 6155 // Generate inlined version of the keyed store if the code is in a loop
(...skipping 4542 matching lines...) Expand 10 before | Expand all | Expand 10 after
10696 __ bind(&string_add_runtime); 10698 __ bind(&string_add_runtime);
10697 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 10699 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
10698 } 10700 }
10699 10701
10700 10702
10701 #undef __ 10703 #undef __
10702 10704
10703 } } // namespace v8::internal 10705 } } // namespace v8::internal
10704 10706
10705 #endif // V8_TARGET_ARCH_ARM 10707 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.h ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698