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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 Label gc; | 174 Label gc; |
175 | 175 |
176 // Pop the function info from the stack. | 176 // Pop the function info from the stack. |
177 __ pop(r3); | 177 __ pop(r3); |
178 | 178 |
179 // Attempt to allocate new JSFunction in new space. | 179 // Attempt to allocate new JSFunction in new space. |
180 __ Allocate(JSFunction::kSize, r0, r1, r2, &gc, TAG_OBJECT); | 180 __ Allocate(JSFunction::kSize, r0, r1, r2, &gc, TAG_OBJECT); |
181 | 181 |
182 __ IncrementCounter(counters->fast_new_closure_total(), 1, r6, r7); | 182 __ IncrementCounter(counters->fast_new_closure_total(), 1, r6, r7); |
183 | 183 |
184 int map_index = (language_mode_ == CLASSIC_MODE) | 184 int map_index = Context::FunctionMapIndex(language_mode_, is_generator_); |
185 ? Context::FUNCTION_MAP_INDEX | |
186 : Context::STRICT_MODE_FUNCTION_MAP_INDEX; | |
187 | 185 |
188 // Compute the function map in the current native context and set that | 186 // Compute the function map in the current native context and set that |
189 // as the map of the allocated object. | 187 // as the map of the allocated object. |
190 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 188 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
191 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset)); | 189 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset)); |
192 __ ldr(r5, MemOperand(r2, Context::SlotOffset(map_index))); | 190 __ ldr(r5, MemOperand(r2, Context::SlotOffset(map_index))); |
193 __ str(r5, FieldMemOperand(r0, HeapObject::kMapOffset)); | 191 __ str(r5, FieldMemOperand(r0, HeapObject::kMapOffset)); |
194 | 192 |
195 // Initialize the rest of the function. We don't have to update the | 193 // Initialize the rest of the function. We don't have to update the |
196 // write barrier because the allocated object is in new space. | 194 // write barrier because the allocated object is in new space. |
(...skipping 7832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8029 | 8027 |
8030 __ Pop(lr, r5, r1); | 8028 __ Pop(lr, r5, r1); |
8031 __ Ret(); | 8029 __ Ret(); |
8032 } | 8030 } |
8033 | 8031 |
8034 #undef __ | 8032 #undef __ |
8035 | 8033 |
8036 } } // namespace v8::internal | 8034 } } // namespace v8::internal |
8037 | 8035 |
8038 #endif // V8_TARGET_ARCH_ARM | 8036 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |