OLD | NEW |
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 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 bind(&same_contexts); | 899 bind(&same_contexts); |
900 } | 900 } |
901 | 901 |
902 | 902 |
903 void MacroAssembler::AllocateInNewSpace(int object_size, | 903 void MacroAssembler::AllocateInNewSpace(int object_size, |
904 Register result, | 904 Register result, |
905 Register scratch1, | 905 Register scratch1, |
906 Register scratch2, | 906 Register scratch2, |
907 Label* gc_required, | 907 Label* gc_required, |
908 AllocationFlags flags) { | 908 AllocationFlags flags) { |
| 909 if (!FLAG_inline_new) { |
| 910 if (FLAG_debug_code) { |
| 911 // Trash the registers to simulate an allocation failure. |
| 912 mov(result, Operand(0x7091)); |
| 913 mov(scratch1, Operand(0x7191)); |
| 914 mov(scratch2, Operand(0x7291)); |
| 915 } |
| 916 jmp(gc_required); |
| 917 return; |
| 918 } |
| 919 |
909 ASSERT(!result.is(scratch1)); | 920 ASSERT(!result.is(scratch1)); |
910 ASSERT(!scratch1.is(scratch2)); | 921 ASSERT(!scratch1.is(scratch2)); |
911 | 922 |
912 // Make object size into bytes. | 923 // Make object size into bytes. |
913 if ((flags & SIZE_IN_WORDS) != 0) { | 924 if ((flags & SIZE_IN_WORDS) != 0) { |
914 object_size *= kPointerSize; | 925 object_size *= kPointerSize; |
915 } | 926 } |
916 ASSERT_EQ(0, object_size & kObjectAlignmentMask); | 927 ASSERT_EQ(0, object_size & kObjectAlignmentMask); |
917 | 928 |
918 // Load address of new object into result and allocation top address into | 929 // Load address of new object into result and allocation top address into |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 } | 961 } |
951 } | 962 } |
952 | 963 |
953 | 964 |
954 void MacroAssembler::AllocateInNewSpace(Register object_size, | 965 void MacroAssembler::AllocateInNewSpace(Register object_size, |
955 Register result, | 966 Register result, |
956 Register scratch1, | 967 Register scratch1, |
957 Register scratch2, | 968 Register scratch2, |
958 Label* gc_required, | 969 Label* gc_required, |
959 AllocationFlags flags) { | 970 AllocationFlags flags) { |
| 971 if (!FLAG_inline_new) { |
| 972 if (FLAG_debug_code) { |
| 973 // Trash the registers to simulate an allocation failure. |
| 974 mov(result, Operand(0x7091)); |
| 975 mov(scratch1, Operand(0x7191)); |
| 976 mov(scratch2, Operand(0x7291)); |
| 977 } |
| 978 jmp(gc_required); |
| 979 return; |
| 980 } |
| 981 |
960 ASSERT(!result.is(scratch1)); | 982 ASSERT(!result.is(scratch1)); |
961 ASSERT(!scratch1.is(scratch2)); | 983 ASSERT(!scratch1.is(scratch2)); |
962 | 984 |
963 // Load address of new object into result and allocation top address into | 985 // Load address of new object into result and allocation top address into |
964 // scratch1. | 986 // scratch1. |
965 ExternalReference new_space_allocation_top = | 987 ExternalReference new_space_allocation_top = |
966 ExternalReference::new_space_allocation_top_address(); | 988 ExternalReference::new_space_allocation_top_address(); |
967 mov(scratch1, Operand(new_space_allocation_top)); | 989 mov(scratch1, Operand(new_space_allocation_top)); |
968 if ((flags & RESULT_CONTAINS_TOP) == 0) { | 990 if ((flags & RESULT_CONTAINS_TOP) == 0) { |
969 ldr(result, MemOperand(scratch1)); | 991 ldr(result, MemOperand(scratch1)); |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1847 | 1869 |
1848 void CodePatcher::Emit(Address addr) { | 1870 void CodePatcher::Emit(Address addr) { |
1849 masm()->emit(reinterpret_cast<Instr>(addr)); | 1871 masm()->emit(reinterpret_cast<Instr>(addr)); |
1850 } | 1872 } |
1851 #endif // ENABLE_DEBUGGER_SUPPORT | 1873 #endif // ENABLE_DEBUGGER_SUPPORT |
1852 | 1874 |
1853 | 1875 |
1854 } } // namespace v8::internal | 1876 } } // namespace v8::internal |
1855 | 1877 |
1856 #endif // V8_TARGET_ARCH_ARM | 1878 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |