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 = is_generator_ |
rossberg
2013/04/11 13:05:20
Nit: it would be nice if this could be moved into
wingo
2013/04/11 14:38:45
Done.
| |
185 ? Context::FUNCTION_MAP_INDEX | 185 ? ((language_mode_ == CLASSIC_MODE) |
186 : Context::STRICT_MODE_FUNCTION_MAP_INDEX; | 186 ? Context::GENERATOR_FUNCTION_MAP_INDEX |
187 : Context::STRICT_MODE_GENERATOR_FUNCTION_MAP_INDEX) | |
188 : ((language_mode_ == CLASSIC_MODE) | |
189 ? Context::FUNCTION_MAP_INDEX | |
190 : Context::STRICT_MODE_FUNCTION_MAP_INDEX); | |
187 | 191 |
188 // Compute the function map in the current native context and set that | 192 // Compute the function map in the current native context and set that |
189 // as the map of the allocated object. | 193 // as the map of the allocated object. |
190 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 194 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
191 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset)); | 195 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset)); |
192 __ ldr(r5, MemOperand(r2, Context::SlotOffset(map_index))); | 196 __ ldr(r5, MemOperand(r2, Context::SlotOffset(map_index))); |
193 __ str(r5, FieldMemOperand(r0, HeapObject::kMapOffset)); | 197 __ str(r5, FieldMemOperand(r0, HeapObject::kMapOffset)); |
194 | 198 |
195 // Initialize the rest of the function. We don't have to update the | 199 // Initialize the rest of the function. We don't have to update the |
196 // write barrier because the allocated object is in new space. | 200 // write barrier because the allocated object is in new space. |
(...skipping 7832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8029 | 8033 |
8030 __ Pop(lr, r5, r1); | 8034 __ Pop(lr, r5, r1); |
8031 __ Ret(); | 8035 __ Ret(); |
8032 } | 8036 } |
8033 | 8037 |
8034 #undef __ | 8038 #undef __ |
8035 | 8039 |
8036 } } // namespace v8::internal | 8040 } } // namespace v8::internal |
8037 | 8041 |
8038 #endif // V8_TARGET_ARCH_ARM | 8042 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |