| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 __ pop(r3); | 84 __ pop(r3); |
| 85 | 85 |
| 86 // Attempt to allocate new JSFunction in new space. | 86 // Attempt to allocate new JSFunction in new space. |
| 87 __ AllocateInNewSpace(JSFunction::kSize, | 87 __ AllocateInNewSpace(JSFunction::kSize, |
| 88 r0, | 88 r0, |
| 89 r1, | 89 r1, |
| 90 r2, | 90 r2, |
| 91 &gc, | 91 &gc, |
| 92 TAG_OBJECT); | 92 TAG_OBJECT); |
| 93 | 93 |
| 94 int map_index = strict_mode_ == kStrictMode |
| 95 ? Context::FUNCTION_MAP_STRICT_INDEX |
| 96 : Context::FUNCTION_MAP_INDEX; |
| 97 |
| 94 // Compute the function map in the current global context and set that | 98 // Compute the function map in the current global context and set that |
| 95 // as the map of the allocated object. | 99 // as the map of the allocated object. |
| 96 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 100 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 97 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalContextOffset)); | 101 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalContextOffset)); |
| 98 __ ldr(r2, MemOperand(r2, Context::SlotOffset(Context::FUNCTION_MAP_INDEX))); | 102 __ ldr(r2, MemOperand(r2, Context::SlotOffset(map_index))); |
| 99 __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); | 103 __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); |
| 100 | 104 |
| 101 // Initialize the rest of the function. We don't have to update the | 105 // Initialize the rest of the function. We don't have to update the |
| 102 // write barrier because the allocated object is in new space. | 106 // write barrier because the allocated object is in new space. |
| 103 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex); | 107 __ LoadRoot(r1, Heap::kEmptyFixedArrayRootIndex); |
| 104 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex); | 108 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex); |
| 105 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); | 109 __ LoadRoot(r4, Heap::kUndefinedValueRootIndex); |
| 106 __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset)); | 110 __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
| 107 __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset)); | 111 __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset)); |
| 108 __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset)); | 112 __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset)); |
| (...skipping 6739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6848 __ str(pc, MemOperand(sp, 0)); | 6852 __ str(pc, MemOperand(sp, 0)); |
| 6849 __ Jump(target); // Call the C++ function. | 6853 __ Jump(target); // Call the C++ function. |
| 6850 } | 6854 } |
| 6851 | 6855 |
| 6852 | 6856 |
| 6853 #undef __ | 6857 #undef __ |
| 6854 | 6858 |
| 6855 } } // namespace v8::internal | 6859 } } // namespace v8::internal |
| 6856 | 6860 |
| 6857 #endif // V8_TARGET_ARCH_ARM | 6861 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |