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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 Label gc; | 189 Label gc; |
190 | 190 |
191 // Pop the function info from the stack. | 191 // Pop the function info from the stack. |
192 __ pop(a3); | 192 __ pop(a3); |
193 | 193 |
194 // Attempt to allocate new JSFunction in new space. | 194 // Attempt to allocate new JSFunction in new space. |
195 __ Allocate(JSFunction::kSize, v0, a1, a2, &gc, TAG_OBJECT); | 195 __ Allocate(JSFunction::kSize, v0, a1, a2, &gc, TAG_OBJECT); |
196 | 196 |
197 __ IncrementCounter(counters->fast_new_closure_total(), 1, t2, t3); | 197 __ IncrementCounter(counters->fast_new_closure_total(), 1, t2, t3); |
198 | 198 |
199 int map_index = (language_mode_ == CLASSIC_MODE) | 199 int map_index = Context::FunctionMapIndex(language_mode_, is_generator_); |
200 ? Context::FUNCTION_MAP_INDEX | |
201 : Context::STRICT_MODE_FUNCTION_MAP_INDEX; | |
202 | 200 |
203 // Compute the function map in the current native context and set that | 201 // Compute the function map in the current native context and set that |
204 // as the map of the allocated object. | 202 // as the map of the allocated object. |
205 __ lw(a2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 203 __ lw(a2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
206 __ lw(a2, FieldMemOperand(a2, GlobalObject::kNativeContextOffset)); | 204 __ lw(a2, FieldMemOperand(a2, GlobalObject::kNativeContextOffset)); |
207 __ lw(t1, MemOperand(a2, Context::SlotOffset(map_index))); | 205 __ lw(t1, MemOperand(a2, Context::SlotOffset(map_index))); |
208 __ sw(t1, FieldMemOperand(v0, HeapObject::kMapOffset)); | 206 __ sw(t1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
209 | 207 |
210 // Initialize the rest of the function. We don't have to update the | 208 // Initialize the rest of the function. We don't have to update the |
211 // write barrier because the allocated object is in new space. | 209 // write barrier because the allocated object is in new space. |
(...skipping 7837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8049 __ Pop(ra, t1, a1); | 8047 __ Pop(ra, t1, a1); |
8050 __ Ret(); | 8048 __ Ret(); |
8051 } | 8049 } |
8052 | 8050 |
8053 | 8051 |
8054 #undef __ | 8052 #undef __ |
8055 | 8053 |
8056 } } // namespace v8::internal | 8054 } } // namespace v8::internal |
8057 | 8055 |
8058 #endif // V8_TARGET_ARCH_MIPS | 8056 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |