| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 // Use a scratch register here to have only one reloc info when unfolding | 989 // Use a scratch register here to have only one reloc info when unfolding |
| 990 // the loop. | 990 // the loop. |
| 991 __ mov(scratch3, factory->the_hole_value()); | 991 __ mov(scratch3, factory->the_hole_value()); |
| 992 for (int i = 0; i < initial_capacity; i++) { | 992 for (int i = 0; i < initial_capacity; i++) { |
| 993 __ mov(FieldOperand(scratch1, | 993 __ mov(FieldOperand(scratch1, |
| 994 FixedArray::kHeaderSize + i * kPointerSize), | 994 FixedArray::kHeaderSize + i * kPointerSize), |
| 995 scratch3); | 995 scratch3); |
| 996 } | 996 } |
| 997 } else { | 997 } else { |
| 998 Label loop, entry; | 998 Label loop, entry; |
| 999 __ mov(scratch2, Immediate(initial_capacity)); |
| 999 __ jmp(&entry); | 1000 __ jmp(&entry); |
| 1000 __ bind(&loop); | 1001 __ bind(&loop); |
| 1001 __ mov(Operand(scratch1, 0), factory->the_hole_value()); | 1002 __ mov(FieldOperand(scratch1, |
| 1002 __ add(scratch1, Immediate(kPointerSize)); | 1003 scratch2, |
| 1004 times_pointer_size, |
| 1005 FixedArray::kHeaderSize), |
| 1006 factory->the_hole_value()); |
| 1003 __ bind(&entry); | 1007 __ bind(&entry); |
| 1004 __ cmp(scratch1, scratch2); | 1008 __ dec(scratch2); |
| 1005 __ j(below, &loop); | 1009 __ j(not_sign, &loop); |
| 1006 } | 1010 } |
| 1007 } | 1011 } |
| 1008 | 1012 |
| 1009 | 1013 |
| 1010 // Allocate a JSArray with the number of elements stored in a register. The | 1014 // Allocate a JSArray with the number of elements stored in a register. The |
| 1011 // register array_function holds the built-in Array function and the register | 1015 // register array_function holds the built-in Array function and the register |
| 1012 // array_size holds the size of the array as a smi. The allocated array is put | 1016 // array_size holds the size of the array as a smi. The allocated array is put |
| 1013 // into the result register and beginning and end of the FixedArray elements | 1017 // into the result register and beginning and end of the FixedArray elements |
| 1014 // storage is put into registers elements_array and elements_array_end (see | 1018 // storage is put into registers elements_array and elements_array_end (see |
| 1015 // below for when that is not the case). If the parameter fill_with_holes is | 1019 // below for when that is not the case). If the parameter fill_with_holes is |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1676 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1673 generator.Generate(); | 1677 generator.Generate(); |
| 1674 } | 1678 } |
| 1675 | 1679 |
| 1676 | 1680 |
| 1677 #undef __ | 1681 #undef __ |
| 1678 } | 1682 } |
| 1679 } // namespace v8::internal | 1683 } // namespace v8::internal |
| 1680 | 1684 |
| 1681 #endif // V8_TARGET_ARCH_IA32 | 1685 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |