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

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

Issue 3053042: Modify polymorphic keyed load IC stub to load cached properties from the prop... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 4 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 | « no previous file | src/ia32/ic-ia32.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); 1098 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
1099 } 1099 }
1100 1100
1101 1101
1102 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { 1102 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
1103 // ---------- S t a t e -------------- 1103 // ---------- S t a t e --------------
1104 // -- lr : return address 1104 // -- lr : return address
1105 // -- r0 : key 1105 // -- r0 : key
1106 // -- r1 : receiver 1106 // -- r1 : receiver
1107 // ----------------------------------- 1107 // -----------------------------------
1108 Label slow, check_string, index_smi, index_string; 1108 Label slow, check_string, index_smi, index_string, property_array_property;
1109 Label check_pixel_array, probe_dictionary, check_number_dictionary; 1109 Label check_pixel_array, probe_dictionary, check_number_dictionary;
1110 1110
1111 Register key = r0; 1111 Register key = r0;
1112 Register receiver = r1; 1112 Register receiver = r1;
1113 1113
1114 // Check that the key is a smi. 1114 // Check that the key is a smi.
1115 __ BranchOnNotSmi(key, &check_string); 1115 __ BranchOnNotSmi(key, &check_string);
1116 __ bind(&index_smi); 1116 __ bind(&index_smi);
1117 // Now the key is known to be a smi. This place is also jumped to from below 1117 // Now the key is known to be a smi. This place is also jumped to from below
1118 // where a numeric string is converted to a smi. 1118 // where a numeric string is converted to a smi.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 ExternalReference cache_keys = ExternalReference::keyed_lookup_cache_keys(); 1186 ExternalReference cache_keys = ExternalReference::keyed_lookup_cache_keys();
1187 __ mov(r4, Operand(cache_keys)); 1187 __ mov(r4, Operand(cache_keys));
1188 __ add(r4, r4, Operand(r3, LSL, kPointerSizeLog2 + 1)); 1188 __ add(r4, r4, Operand(r3, LSL, kPointerSizeLog2 + 1));
1189 __ ldr(r5, MemOperand(r4, kPointerSize, PostIndex)); // Move r4 to symbol. 1189 __ ldr(r5, MemOperand(r4, kPointerSize, PostIndex)); // Move r4 to symbol.
1190 __ cmp(r2, r5); 1190 __ cmp(r2, r5);
1191 __ b(ne, &slow); 1191 __ b(ne, &slow);
1192 __ ldr(r5, MemOperand(r4)); 1192 __ ldr(r5, MemOperand(r4));
1193 __ cmp(r0, r5); 1193 __ cmp(r0, r5);
1194 __ b(ne, &slow); 1194 __ b(ne, &slow);
1195 1195
1196 // Get field offset and check that it is an in-object property. 1196 // Get field offset.
1197 // r0 : key 1197 // r0 : key
1198 // r1 : receiver 1198 // r1 : receiver
1199 // r2 : receiver's map 1199 // r2 : receiver's map
1200 // r3 : lookup cache index 1200 // r3 : lookup cache index
1201 ExternalReference cache_field_offsets 1201 ExternalReference cache_field_offsets
1202 = ExternalReference::keyed_lookup_cache_field_offsets(); 1202 = ExternalReference::keyed_lookup_cache_field_offsets();
1203 __ mov(r4, Operand(cache_field_offsets)); 1203 __ mov(r4, Operand(cache_field_offsets));
1204 __ ldr(r5, MemOperand(r4, r3, LSL, kPointerSizeLog2)); 1204 __ ldr(r5, MemOperand(r4, r3, LSL, kPointerSizeLog2));
1205 __ ldrb(r6, FieldMemOperand(r2, Map::kInObjectPropertiesOffset)); 1205 __ ldrb(r6, FieldMemOperand(r2, Map::kInObjectPropertiesOffset));
1206 __ cmp(r5, r6); 1206 __ sub(r5, r5, r6, SetCC);
1207 __ b(ge, &slow); 1207 __ b(ge, &property_array_property);
1208 1208
1209 // Load in-object property. 1209 // Load in-object property.
1210 __ sub(r5, r5, r6); // Index from end of object.
1211 __ ldrb(r6, FieldMemOperand(r2, Map::kInstanceSizeOffset)); 1210 __ ldrb(r6, FieldMemOperand(r2, Map::kInstanceSizeOffset));
1212 __ add(r6, r6, r5); // Index from start of object. 1211 __ add(r6, r6, r5); // Index from start of object.
1213 __ sub(r1, r1, Operand(kHeapObjectTag)); // Remove the heap tag. 1212 __ sub(r1, r1, Operand(kHeapObjectTag)); // Remove the heap tag.
1214 __ ldr(r0, MemOperand(r1, r6, LSL, kPointerSizeLog2)); 1213 __ ldr(r0, MemOperand(r1, r6, LSL, kPointerSizeLog2));
1215 __ IncrementCounter(&Counters::keyed_load_generic_lookup_cache, 1, r2, r3); 1214 __ IncrementCounter(&Counters::keyed_load_generic_lookup_cache, 1, r2, r3);
1216 __ Ret(); 1215 __ Ret();
1217 1216
1217 // Load property array property.
1218 __ bind(&property_array_property);
1219 __ ldr(r1, FieldMemOperand(r1, JSObject::kPropertiesOffset));
1220 __ add(r1, r1, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
1221 __ ldr(r0, MemOperand(r1, r5, LSL, kPointerSizeLog2));
1222 __ IncrementCounter(&Counters::keyed_load_generic_lookup_cache, 1, r2, r3);
1223 __ Ret();
1224
1218 // Do a quick inline probe of the receiver's dictionary, if it 1225 // Do a quick inline probe of the receiver's dictionary, if it
1219 // exists. 1226 // exists.
1220 __ bind(&probe_dictionary); 1227 __ bind(&probe_dictionary);
1221 // r1: receiver 1228 // r1: receiver
1222 // r0: key 1229 // r0: key
1223 // r3: elements 1230 // r3: elements
1224 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); 1231 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
1225 __ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); 1232 __ ldrb(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset));
1226 GenerateGlobalInstanceTypeCheck(masm, r2, &slow); 1233 GenerateGlobalInstanceTypeCheck(masm, r2, &slow);
1227 // Load the property to r0. 1234 // Load the property to r0.
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
2249 GenerateMiss(masm); 2256 GenerateMiss(masm);
2250 } 2257 }
2251 2258
2252 2259
2253 #undef __ 2260 #undef __
2254 2261
2255 2262
2256 } } // namespace v8::internal 2263 } } // namespace v8::internal
2257 2264
2258 #endif // V8_TARGET_ARCH_ARM 2265 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698