OLD | NEW |
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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 __ jmp(&entry); | 1231 __ jmp(&entry); |
1232 __ bind(&loop); | 1232 __ bind(&loop); |
1233 __ mov(eax, Operand(edi, ecx, times_pointer_size, 0)); | 1233 __ mov(eax, Operand(edi, ecx, times_pointer_size, 0)); |
1234 if (FLAG_smi_only_arrays) { | 1234 if (FLAG_smi_only_arrays) { |
1235 __ JumpIfNotSmi(eax, &has_non_smi_element); | 1235 __ JumpIfNotSmi(eax, &has_non_smi_element); |
1236 } | 1236 } |
1237 __ mov(Operand(edx, 0), eax); | 1237 __ mov(Operand(edx, 0), eax); |
1238 __ add(edx, Immediate(kPointerSize)); | 1238 __ add(edx, Immediate(kPointerSize)); |
1239 __ bind(&entry); | 1239 __ bind(&entry); |
1240 __ dec(ecx); | 1240 __ dec(ecx); |
1241 __ j(greater_equal, &loop, Label::kNear); | 1241 __ j(greater_equal, &loop); |
1242 | 1242 |
1243 // Remove caller arguments from the stack and return. | 1243 // Remove caller arguments from the stack and return. |
1244 // ebx: argc | 1244 // ebx: argc |
1245 // esp[0]: JSArray | 1245 // esp[0]: JSArray |
1246 // esp[4]: argc | 1246 // esp[4]: argc |
1247 // esp[8]: constructor (only if construct_call) | 1247 // esp[8]: constructor (only if construct_call) |
1248 // esp[12]: return address | 1248 // esp[12]: return address |
1249 // esp[16]: last argument | 1249 // esp[16]: last argument |
1250 __ bind(&finish); | 1250 __ bind(&finish); |
1251 __ mov(ecx, Operand(esp, last_arg_offset - kPointerSize)); | 1251 __ mov(ecx, Operand(esp, last_arg_offset - kPointerSize)); |
1252 __ pop(eax); | 1252 __ pop(eax); |
1253 __ pop(ebx); | 1253 __ pop(ebx); |
1254 __ lea(esp, Operand(esp, ebx, times_pointer_size, | 1254 __ lea(esp, Operand(esp, ebx, times_pointer_size, |
1255 last_arg_offset - kPointerSize)); | 1255 last_arg_offset - kPointerSize)); |
1256 __ jmp(ecx); | 1256 __ jmp(ecx); |
1257 | 1257 |
1258 __ bind(&has_non_smi_element); | 1258 __ bind(&has_non_smi_element); |
1259 // Double values are handled by the runtime. | 1259 // Double values are handled by the runtime. |
1260 __ CheckMap(eax, | 1260 __ CheckMap(eax, |
1261 masm->isolate()->factory()->heap_number_map(), | 1261 masm->isolate()->factory()->heap_number_map(), |
1262 ¬_double, | 1262 ¬_double, |
1263 DONT_DO_SMI_CHECK); | 1263 DONT_DO_SMI_CHECK); |
1264 __ bind(&cant_transition_map); | 1264 __ bind(&cant_transition_map); |
1265 // Throw away the array that's only been partially constructed. | 1265 // Throw away the array that's only been partially constructed. |
1266 __ pop(eax); | 1266 __ pop(eax); |
1267 __ UndoAllocationInNewSpace(eax); | 1267 __ UndoAllocationInNewSpace(eax); |
1268 __ jmp(&prepare_generic_code_call); | 1268 __ jmp(&prepare_generic_code_call); |
1269 | 1269 |
1270 __ bind(¬_double); | 1270 __ bind(¬_double); |
1271 // Transition FAST_SMI_ONLY_ELEMENTS to FAST_ELEMENTS | 1271 // Transition FAST_SMI_ONLY_ELEMENTS to FAST_ELEMENTS. |
1272 __ mov(ebx, Operand(esp, 0)); | 1272 __ mov(ebx, Operand(esp, 0)); |
1273 __ mov(edi, FieldOperand(ebx, HeapObject::kMapOffset)); | 1273 __ mov(edi, FieldOperand(ebx, HeapObject::kMapOffset)); |
1274 __ LoadTransitionedArrayMapConditional( | 1274 __ LoadTransitionedArrayMapConditional( |
1275 FAST_SMI_ONLY_ELEMENTS, | 1275 FAST_SMI_ONLY_ELEMENTS, |
1276 FAST_ELEMENTS, | 1276 FAST_ELEMENTS, |
1277 edi, | 1277 edi, |
1278 eax, | 1278 eax, |
1279 &cant_transition_map); | 1279 &cant_transition_map); |
1280 __ mov(FieldOperand(ebx, HeapObject::kMapOffset), edi); | 1280 __ mov(FieldOperand(ebx, HeapObject::kMapOffset), edi); |
1281 __ RecordWriteField(ebx, HeapObject::kMapOffset, edi, eax, | 1281 __ RecordWriteField(ebx, HeapObject::kMapOffset, edi, eax, |
1282 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 1282 kDontSaveFPRegs, OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
1283 | 1283 |
1284 // Prepare to re-enter the loop | 1284 // Prepare to re-enter the loop |
1285 __ lea(edi, Operand(esp, last_arg_offset)); | 1285 __ lea(edi, Operand(esp, last_arg_offset)); |
1286 | 1286 |
1287 // Finish the array initialization loop. | 1287 // Finish the array initialization loop. |
1288 Label loop2; | 1288 Label loop2; |
1289 __ bind(&loop2); | 1289 __ bind(&loop2); |
1290 __ mov(eax, Operand(edi, ecx, times_pointer_size, 0)); | 1290 __ mov(eax, Operand(edi, ecx, times_pointer_size, 0)); |
1291 __ mov(Operand(edx, 0), eax); | 1291 __ mov(Operand(edx, 0), eax); |
1292 __ add(edx, Immediate(kPointerSize)); | 1292 __ add(edx, Immediate(kPointerSize)); |
1293 __ dec(ecx); | 1293 __ dec(ecx); |
1294 __ j(greater_equal, &loop2, Label::kNear); | 1294 __ j(greater_equal, &loop2); |
1295 __ jmp(&finish); | 1295 __ jmp(&finish); |
1296 | 1296 |
1297 // Restore argc and constructor before running the generic code. | 1297 // Restore argc and constructor before running the generic code. |
1298 __ bind(&prepare_generic_code_call); | 1298 __ bind(&prepare_generic_code_call); |
1299 __ pop(eax); | 1299 __ pop(eax); |
1300 if (construct_call) { | 1300 if (construct_call) { |
1301 __ pop(edi); | 1301 __ pop(edi); |
1302 } | 1302 } |
1303 __ jmp(call_generic_code); | 1303 __ jmp(call_generic_code); |
1304 } | 1304 } |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1720 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1720 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1721 generator.Generate(); | 1721 generator.Generate(); |
1722 } | 1722 } |
1723 | 1723 |
1724 | 1724 |
1725 #undef __ | 1725 #undef __ |
1726 } | 1726 } |
1727 } // namespace v8::internal | 1727 } // namespace v8::internal |
1728 | 1728 |
1729 #endif // V8_TARGET_ARCH_IA32 | 1729 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |