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

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 2073018: Reverting r4703. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 7 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/ia32/macro-assembler-ia32.cc ('k') | src/mark-compact.h » ('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-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 } else { 1166 } else {
1167 // Get the elements array of the object. 1167 // Get the elements array of the object.
1168 __ mov(ebx, FieldOperand(edx, JSArray::kElementsOffset)); 1168 __ mov(ebx, FieldOperand(edx, JSArray::kElementsOffset));
1169 1169
1170 // Check that the elements are in fast mode (not dictionary). 1170 // Check that the elements are in fast mode (not dictionary).
1171 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), 1171 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset),
1172 Immediate(Factory::fixed_array_map())); 1172 Immediate(Factory::fixed_array_map()));
1173 __ j(not_equal, &miss); 1173 __ j(not_equal, &miss);
1174 1174
1175 if (argc == 1) { // Otherwise fall through to call builtin. 1175 if (argc == 1) { // Otherwise fall through to call builtin.
1176 Label call_builtin, exit, with_write_barrier, attempt_to_grow_elements; 1176 Label call_builtin, exit, with_rset_update, attempt_to_grow_elements;
1177 1177
1178 // Get the array's length into eax and calculate new length. 1178 // Get the array's length into eax and calculate new length.
1179 __ mov(eax, FieldOperand(edx, JSArray::kLengthOffset)); 1179 __ mov(eax, FieldOperand(edx, JSArray::kLengthOffset));
1180 STATIC_ASSERT(kSmiTagSize == 1); 1180 STATIC_ASSERT(kSmiTagSize == 1);
1181 STATIC_ASSERT(kSmiTag == 0); 1181 STATIC_ASSERT(kSmiTag == 0);
1182 __ add(Operand(eax), Immediate(Smi::FromInt(argc))); 1182 __ add(Operand(eax), Immediate(Smi::FromInt(argc)));
1183 1183
1184 // Get the element's length into ecx. 1184 // Get the element's length into ecx.
1185 __ mov(ecx, FieldOperand(ebx, FixedArray::kLengthOffset)); 1185 __ mov(ecx, FieldOperand(ebx, FixedArray::kLengthOffset));
1186 __ SmiTag(ecx);
1186 1187
1187 // Check if we could survive without allocation. 1188 // Check if we could survive without allocation.
1188 __ cmp(eax, Operand(ecx)); 1189 __ cmp(eax, Operand(ecx));
1189 __ j(greater, &attempt_to_grow_elements); 1190 __ j(greater, &attempt_to_grow_elements);
1190 1191
1191 // Save new length. 1192 // Save new length.
1192 __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax); 1193 __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax);
1193 1194
1194 // Push the element. 1195 // Push the element.
1195 __ lea(edx, FieldOperand(ebx, 1196 __ lea(edx, FieldOperand(ebx,
1196 eax, times_half_pointer_size, 1197 eax, times_half_pointer_size,
1197 FixedArray::kHeaderSize - argc * kPointerSize)); 1198 FixedArray::kHeaderSize - argc * kPointerSize));
1198 __ mov(ecx, Operand(esp, argc * kPointerSize)); 1199 __ mov(ecx, Operand(esp, argc * kPointerSize));
1199 __ mov(Operand(edx, 0), ecx); 1200 __ mov(Operand(edx, 0), ecx);
1200 1201
1201 // Check if value is a smi. 1202 // Check if value is a smi.
1202 __ test(ecx, Immediate(kSmiTagMask)); 1203 __ test(ecx, Immediate(kSmiTagMask));
1203 __ j(not_zero, &with_write_barrier); 1204 __ j(not_zero, &with_rset_update);
1204 1205
1205 __ bind(&exit); 1206 __ bind(&exit);
1206 __ ret((argc + 1) * kPointerSize); 1207 __ ret((argc + 1) * kPointerSize);
1207 1208
1208 __ bind(&with_write_barrier); 1209 __ bind(&with_rset_update);
1209 1210
1210 __ InNewSpace(ebx, ecx, equal, &exit); 1211 __ InNewSpace(ebx, ecx, equal, &exit);
1211 1212
1212 __ RecordWriteHelper(ebx, edx, ecx); 1213 RecordWriteStub stub(ebx, edx, ecx);
1214 __ CallStub(&stub);
1213 __ ret((argc + 1) * kPointerSize); 1215 __ ret((argc + 1) * kPointerSize);
1214 1216
1215 __ bind(&attempt_to_grow_elements); 1217 __ bind(&attempt_to_grow_elements);
1216 ExternalReference new_space_allocation_top = 1218 ExternalReference new_space_allocation_top =
1217 ExternalReference::new_space_allocation_top_address(); 1219 ExternalReference::new_space_allocation_top_address();
1218 ExternalReference new_space_allocation_limit = 1220 ExternalReference new_space_allocation_limit =
1219 ExternalReference::new_space_allocation_limit_address(); 1221 ExternalReference::new_space_allocation_limit_address();
1220 1222
1221 const int kAllocationDelta = 4; 1223 const int kAllocationDelta = 4;
1222 // Load top. 1224 // Load top.
(...skipping 19 matching lines...) Expand all
1242 for (int i = 1; i < kAllocationDelta; i++) { 1244 for (int i = 1; i < kAllocationDelta; i++) {
1243 __ mov(Operand(edx, i * kPointerSize), 1245 __ mov(Operand(edx, i * kPointerSize),
1244 Immediate(Factory::the_hole_value())); 1246 Immediate(Factory::the_hole_value()));
1245 } 1247 }
1246 1248
1247 // Restore receiver to edx as finish sequence assumes it's here. 1249 // Restore receiver to edx as finish sequence assumes it's here.
1248 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); 1250 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize));
1249 1251
1250 // Increment element's and array's sizes. 1252 // Increment element's and array's sizes.
1251 __ add(FieldOperand(ebx, FixedArray::kLengthOffset), 1253 __ add(FieldOperand(ebx, FixedArray::kLengthOffset),
1252 Immediate(Smi::FromInt(kAllocationDelta))); 1254 Immediate(kAllocationDelta));
1253 __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax); 1255 __ mov(FieldOperand(edx, JSArray::kLengthOffset), eax);
1254 1256
1255 // Elements are in new space, so write barrier is not required. 1257 // Elements are in new space, so no remembered set updates are necessary.
1256 __ ret((argc + 1) * kPointerSize); 1258 __ ret((argc + 1) * kPointerSize);
1257 1259
1258 __ bind(&call_builtin); 1260 __ bind(&call_builtin);
1259 } 1261 }
1260 1262
1261 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush), 1263 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
1262 argc + 1, 1264 argc + 1,
1263 1); 1265 1);
1264 } 1266 }
1265 1267
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 // Return the generated code. 2384 // Return the generated code.
2383 return GetCode(); 2385 return GetCode();
2384 } 2386 }
2385 2387
2386 2388
2387 #undef __ 2389 #undef __
2388 2390
2389 } } // namespace v8::internal 2391 } } // namespace v8::internal
2390 2392
2391 #endif // V8_TARGET_ARCH_IA32 2393 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698