| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Create a new closure from the given function info in new | 121 // Create a new closure from the given function info in new |
| 122 // space. Set the context to the current context in cp. | 122 // space. Set the context to the current context in cp. |
| 123 Counters* counters = masm->isolate()->counters(); | 123 Counters* counters = masm->isolate()->counters(); |
| 124 | 124 |
| 125 Label gc; | 125 Label gc; |
| 126 | 126 |
| 127 // Pop the function info from the stack. | 127 // Pop the function info from the stack. |
| 128 __ pop(r3); | 128 __ pop(r3); |
| 129 | 129 |
| 130 // Attempt to allocate new JSFunction in new space. | 130 // Attempt to allocate new JSFunction in new space. |
| 131 __ AllocateInNewSpace(JSFunction::kSize, | 131 __ Allocate(JSFunction::kSize, r0, r1, r2, &gc, TAG_OBJECT, |
| 132 r0, | 132 MacroAssembler::NEW_SPACE); |
| 133 r1, | |
| 134 r2, | |
| 135 &gc, | |
| 136 TAG_OBJECT); | |
| 137 | 133 |
| 138 __ IncrementCounter(counters->fast_new_closure_total(), 1, r6, r7); | 134 __ IncrementCounter(counters->fast_new_closure_total(), 1, r6, r7); |
| 139 | 135 |
| 140 int map_index = (language_mode_ == CLASSIC_MODE) | 136 int map_index = (language_mode_ == CLASSIC_MODE) |
| 141 ? Context::FUNCTION_MAP_INDEX | 137 ? Context::FUNCTION_MAP_INDEX |
| 142 : Context::STRICT_MODE_FUNCTION_MAP_INDEX; | 138 : Context::STRICT_MODE_FUNCTION_MAP_INDEX; |
| 143 | 139 |
| 144 // Compute the function map in the current native context and set that | 140 // Compute the function map in the current native context and set that |
| 145 // as the map of the allocated object. | 141 // as the map of the allocated object. |
| 146 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 142 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 __ TailCallRuntime(Runtime::kNewClosure, 3, 1); | 249 __ TailCallRuntime(Runtime::kNewClosure, 3, 1); |
| 254 } | 250 } |
| 255 | 251 |
| 256 | 252 |
| 257 void FastNewContextStub::Generate(MacroAssembler* masm) { | 253 void FastNewContextStub::Generate(MacroAssembler* masm) { |
| 258 // Try to allocate the context in new space. | 254 // Try to allocate the context in new space. |
| 259 Label gc; | 255 Label gc; |
| 260 int length = slots_ + Context::MIN_CONTEXT_SLOTS; | 256 int length = slots_ + Context::MIN_CONTEXT_SLOTS; |
| 261 | 257 |
| 262 // Attempt to allocate the context in new space. | 258 // Attempt to allocate the context in new space. |
| 263 __ AllocateInNewSpace(FixedArray::SizeFor(length), | 259 __ Allocate(FixedArray::SizeFor(length), r0, r1, r2, &gc, TAG_OBJECT, |
| 264 r0, | 260 MacroAssembler::NEW_SPACE); |
| 265 r1, | |
| 266 r2, | |
| 267 &gc, | |
| 268 TAG_OBJECT); | |
| 269 | 261 |
| 270 // Load the function from the stack. | 262 // Load the function from the stack. |
| 271 __ ldr(r3, MemOperand(sp, 0)); | 263 __ ldr(r3, MemOperand(sp, 0)); |
| 272 | 264 |
| 273 // Set up the object header. | 265 // Set up the object header. |
| 274 __ LoadRoot(r1, Heap::kFunctionContextMapRootIndex); | 266 __ LoadRoot(r1, Heap::kFunctionContextMapRootIndex); |
| 275 __ mov(r2, Operand(Smi::FromInt(length))); | 267 __ mov(r2, Operand(Smi::FromInt(length))); |
| 276 __ str(r2, FieldMemOperand(r0, FixedArray::kLengthOffset)); | 268 __ str(r2, FieldMemOperand(r0, FixedArray::kLengthOffset)); |
| 277 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); | 269 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); |
| 278 | 270 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 303 | 295 |
| 304 void FastNewBlockContextStub::Generate(MacroAssembler* masm) { | 296 void FastNewBlockContextStub::Generate(MacroAssembler* masm) { |
| 305 // Stack layout on entry: | 297 // Stack layout on entry: |
| 306 // | 298 // |
| 307 // [sp]: function. | 299 // [sp]: function. |
| 308 // [sp + kPointerSize]: serialized scope info | 300 // [sp + kPointerSize]: serialized scope info |
| 309 | 301 |
| 310 // Try to allocate the context in new space. | 302 // Try to allocate the context in new space. |
| 311 Label gc; | 303 Label gc; |
| 312 int length = slots_ + Context::MIN_CONTEXT_SLOTS; | 304 int length = slots_ + Context::MIN_CONTEXT_SLOTS; |
| 313 __ AllocateInNewSpace(FixedArray::SizeFor(length), | 305 __ Allocate(FixedArray::SizeFor(length), r0, r1, r2, &gc, TAG_OBJECT, |
| 314 r0, r1, r2, &gc, TAG_OBJECT); | 306 MacroAssembler::NEW_SPACE); |
| 315 | 307 |
| 316 // Load the function from the stack. | 308 // Load the function from the stack. |
| 317 __ ldr(r3, MemOperand(sp, 0)); | 309 __ ldr(r3, MemOperand(sp, 0)); |
| 318 | 310 |
| 319 // Load the serialized scope info from the stack. | 311 // Load the serialized scope info from the stack. |
| 320 __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); | 312 __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); |
| 321 | 313 |
| 322 // Set up the object header. | 314 // Set up the object header. |
| 323 __ LoadRoot(r2, Heap::kBlockContextMapRootIndex); | 315 __ LoadRoot(r2, Heap::kBlockContextMapRootIndex); |
| 324 __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); | 316 __ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 size += AllocationSiteInfo::kSize; | 382 size += AllocationSiteInfo::kSize; |
| 391 } | 383 } |
| 392 size += elements_size; | 384 size += elements_size; |
| 393 | 385 |
| 394 // Allocate both the JS array and the elements array in one big | 386 // Allocate both the JS array and the elements array in one big |
| 395 // allocation. This avoids multiple limit checks. | 387 // allocation. This avoids multiple limit checks. |
| 396 AllocationFlags flags = TAG_OBJECT; | 388 AllocationFlags flags = TAG_OBJECT; |
| 397 if (mode == FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS) { | 389 if (mode == FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS) { |
| 398 flags = static_cast<AllocationFlags>(DOUBLE_ALIGNMENT | flags); | 390 flags = static_cast<AllocationFlags>(DOUBLE_ALIGNMENT | flags); |
| 399 } | 391 } |
| 400 __ AllocateInNewSpace(size, r0, r1, r2, fail, flags); | 392 __ Allocate(size, r0, r1, r2, fail, flags, MacroAssembler::NEW_SPACE); |
| 401 | 393 |
| 402 if (allocation_site_mode == TRACK_ALLOCATION_SITE) { | 394 if (allocation_site_mode == TRACK_ALLOCATION_SITE) { |
| 403 __ mov(r2, Operand(Handle<Map>(masm->isolate()->heap()-> | 395 __ mov(r2, Operand(Handle<Map>(masm->isolate()->heap()-> |
| 404 allocation_site_info_map()))); | 396 allocation_site_info_map()))); |
| 405 __ str(r2, FieldMemOperand(r0, allocation_info_start)); | 397 __ str(r2, FieldMemOperand(r0, allocation_info_start)); |
| 406 __ str(r3, FieldMemOperand(r0, allocation_info_start + kPointerSize)); | 398 __ str(r3, FieldMemOperand(r0, allocation_info_start + kPointerSize)); |
| 407 } | 399 } |
| 408 | 400 |
| 409 // Copy the JS array part. | 401 // Copy the JS array part. |
| 410 for (int i = 0; i < JSArray::kSize; i += kPointerSize) { | 402 for (int i = 0; i < JSArray::kSize; i += kPointerSize) { |
| (...skipping 7507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7918 | 7910 |
| 7919 __ Pop(lr, r5, r1); | 7911 __ Pop(lr, r5, r1); |
| 7920 __ Ret(); | 7912 __ Ret(); |
| 7921 } | 7913 } |
| 7922 | 7914 |
| 7923 #undef __ | 7915 #undef __ |
| 7924 | 7916 |
| 7925 } } // namespace v8::internal | 7917 } } // namespace v8::internal |
| 7926 | 7918 |
| 7927 #endif // V8_TARGET_ARCH_ARM | 7919 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |