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

Side by Side Diff: src/mips/full-codegen-mips.cc

Issue 10914025: MIPS: Use a special EnumLength field to indicate number of valid enum cache values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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
« no previous file with comments | « no previous file | src/mips/lithium-codegen-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 1134
1135 // Get the set of properties to enumerate. 1135 // Get the set of properties to enumerate.
1136 __ bind(&call_runtime); 1136 __ bind(&call_runtime);
1137 __ push(a0); // Duplicate the enumerable object on the stack. 1137 __ push(a0); // Duplicate the enumerable object on the stack.
1138 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); 1138 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1);
1139 1139
1140 // If we got a map from the runtime call, we can do a fast 1140 // If we got a map from the runtime call, we can do a fast
1141 // modification check. Otherwise, we got a fixed array, and we have 1141 // modification check. Otherwise, we got a fixed array, and we have
1142 // to do a slow check. 1142 // to do a slow check.
1143 Label fixed_array; 1143 Label fixed_array;
1144 __ mov(a2, v0); 1144 __ lw(a2, FieldMemOperand(v0, HeapObject::kMapOffset));
1145 __ lw(a1, FieldMemOperand(a2, HeapObject::kMapOffset));
1146 __ LoadRoot(at, Heap::kMetaMapRootIndex); 1145 __ LoadRoot(at, Heap::kMetaMapRootIndex);
1147 __ Branch(&fixed_array, ne, a1, Operand(at)); 1146 __ Branch(&fixed_array, ne, a2, Operand(at));
1148 1147
1149 // We got a map in register v0. Get the enumeration cache from it. 1148 // We got a map in register v0. Get the enumeration cache from it.
1149 Label no_descriptors;
1150 __ bind(&use_cache); 1150 __ bind(&use_cache);
1151 __ LoadInstanceDescriptors(v0, a1, a2); 1151
1152 __ lw(a1, FieldMemOperand(a1, DescriptorArray::kEnumCacheOffset)); 1152 __ EnumLength(a1, v0);
1153 __ lw(a2, FieldMemOperand(a1, DescriptorArray::kEnumCacheBridgeCacheOffset)); 1153 __ Branch(&no_descriptors, eq, a1, Operand(Smi::FromInt(0)));
1154
1155 __ LoadInstanceDescriptors(v0, a2, t0);
1156 __ lw(a2, FieldMemOperand(a2, DescriptorArray::kEnumCacheOffset));
1157 __ lw(a2, FieldMemOperand(a2, DescriptorArray::kEnumCacheBridgeCacheOffset));
1154 1158
1155 // Set up the four remaining stack slots. 1159 // Set up the four remaining stack slots.
1156 __ push(v0); // Map. 1160 __ push(v0); // Map.
1157 __ lw(a1, FieldMemOperand(a2, FixedArray::kLengthOffset));
1158 __ li(a0, Operand(Smi::FromInt(0))); 1161 __ li(a0, Operand(Smi::FromInt(0)));
1159 // Push enumeration cache, enumeration cache length (as smi) and zero. 1162 // Push enumeration cache, enumeration cache length (as smi) and zero.
1160 __ Push(a2, a1, a0); 1163 __ Push(a2, a1, a0);
1161 __ jmp(&loop); 1164 __ jmp(&loop);
1162 1165
1166 __ bind(&no_descriptors);
1167 __ Drop(1);
1168 __ jmp(&exit);
1169
1163 // We got a fixed array in register v0. Iterate through that. 1170 // We got a fixed array in register v0. Iterate through that.
1164 Label non_proxy; 1171 Label non_proxy;
1165 __ bind(&fixed_array); 1172 __ bind(&fixed_array);
1166 1173
1167 Handle<JSGlobalPropertyCell> cell = 1174 Handle<JSGlobalPropertyCell> cell =
1168 isolate()->factory()->NewJSGlobalPropertyCell( 1175 isolate()->factory()->NewJSGlobalPropertyCell(
1169 Handle<Object>( 1176 Handle<Object>(
1170 Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker))); 1177 Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker)));
1171 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); 1178 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell);
1172 __ LoadHeapObject(a1, cell); 1179 __ LoadHeapObject(a1, cell);
(...skipping 3439 matching lines...) Expand 10 before | Expand all | Expand 10 after
4612 *context_length = 0; 4619 *context_length = 0;
4613 return previous_; 4620 return previous_;
4614 } 4621 }
4615 4622
4616 4623
4617 #undef __ 4624 #undef __
4618 4625
4619 } } // namespace v8::internal 4626 } } // namespace v8::internal
4620 4627
4621 #endif // V8_TARGET_ARCH_MIPS 4628 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698