Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 12440041: Generalizing remaining Allocate functions in the macro assemblers used in pretenuring. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3540 matching lines...) Expand 10 before | Expand all | Expand 10 after
3551 __ lea(ebx, Operand(ebx, times_2, kParameterMapHeaderSize)); 3551 __ lea(ebx, Operand(ebx, times_2, kParameterMapHeaderSize));
3552 __ bind(&no_parameter_map); 3552 __ bind(&no_parameter_map);
3553 3553
3554 // 2. Backing store. 3554 // 2. Backing store.
3555 __ lea(ebx, Operand(ebx, ecx, times_2, FixedArray::kHeaderSize)); 3555 __ lea(ebx, Operand(ebx, ecx, times_2, FixedArray::kHeaderSize));
3556 3556
3557 // 3. Arguments object. 3557 // 3. Arguments object.
3558 __ add(ebx, Immediate(Heap::kArgumentsObjectSize)); 3558 __ add(ebx, Immediate(Heap::kArgumentsObjectSize));
3559 3559
3560 // Do the allocation of all three objects in one go. 3560 // Do the allocation of all three objects in one go.
3561 __ AllocateInNewSpace(ebx, eax, edx, edi, &runtime, TAG_OBJECT); 3561 __ Allocate(ebx, eax, edx, edi, &runtime, TAG_OBJECT);
3562 3562
3563 // eax = address of new object(s) (tagged) 3563 // eax = address of new object(s) (tagged)
3564 // ecx = argument count (tagged) 3564 // ecx = argument count (tagged)
3565 // esp[0] = mapped parameter count (tagged) 3565 // esp[0] = mapped parameter count (tagged)
3566 // esp[8] = parameter count (tagged) 3566 // esp[8] = parameter count (tagged)
3567 // esp[12] = address of receiver argument 3567 // esp[12] = address of receiver argument
3568 // Get the arguments boilerplate from the current native context into edi. 3568 // Get the arguments boilerplate from the current native context into edi.
3569 Label has_mapped_parameters, copy; 3569 Label has_mapped_parameters, copy;
3570 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 3570 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
3571 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset)); 3571 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset));
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
3749 // the arguments object and the elements array. 3749 // the arguments object and the elements array.
3750 Label add_arguments_object; 3750 Label add_arguments_object;
3751 __ bind(&try_allocate); 3751 __ bind(&try_allocate);
3752 __ test(ecx, ecx); 3752 __ test(ecx, ecx);
3753 __ j(zero, &add_arguments_object, Label::kNear); 3753 __ j(zero, &add_arguments_object, Label::kNear);
3754 __ lea(ecx, Operand(ecx, times_2, FixedArray::kHeaderSize)); 3754 __ lea(ecx, Operand(ecx, times_2, FixedArray::kHeaderSize));
3755 __ bind(&add_arguments_object); 3755 __ bind(&add_arguments_object);
3756 __ add(ecx, Immediate(Heap::kArgumentsObjectSizeStrict)); 3756 __ add(ecx, Immediate(Heap::kArgumentsObjectSizeStrict));
3757 3757
3758 // Do the allocation of both objects in one go. 3758 // Do the allocation of both objects in one go.
3759 __ AllocateInNewSpace(ecx, eax, edx, ebx, &runtime, TAG_OBJECT); 3759 __ Allocate(ecx, eax, edx, ebx, &runtime, TAG_OBJECT);
3760 3760
3761 // Get the arguments boilerplate from the current native context. 3761 // Get the arguments boilerplate from the current native context.
3762 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 3762 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
3763 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset)); 3763 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset));
3764 const int offset = 3764 const int offset =
3765 Context::SlotOffset(Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX); 3765 Context::SlotOffset(Context::STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX);
3766 __ mov(edi, Operand(edi, offset)); 3766 __ mov(edi, Operand(edi, offset));
3767 3767
3768 // Copy the JS object part. 3768 // Copy the JS object part.
3769 for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) { 3769 for (int i = 0; i < JSObject::kHeaderSize; i += kPointerSize) {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
4273 __ mov(ebx, Operand(esp, kPointerSize * 3)); 4273 __ mov(ebx, Operand(esp, kPointerSize * 3));
4274 __ JumpIfNotSmi(ebx, &slowcase); 4274 __ JumpIfNotSmi(ebx, &slowcase);
4275 __ cmp(ebx, Immediate(Smi::FromInt(kMaxInlineLength))); 4275 __ cmp(ebx, Immediate(Smi::FromInt(kMaxInlineLength)));
4276 __ j(above, &slowcase); 4276 __ j(above, &slowcase);
4277 // Smi-tagging is equivalent to multiplying by 2. 4277 // Smi-tagging is equivalent to multiplying by 2.
4278 STATIC_ASSERT(kSmiTag == 0); 4278 STATIC_ASSERT(kSmiTag == 0);
4279 STATIC_ASSERT(kSmiTagSize == 1); 4279 STATIC_ASSERT(kSmiTagSize == 1);
4280 // Allocate RegExpResult followed by FixedArray with size in ebx. 4280 // Allocate RegExpResult followed by FixedArray with size in ebx.
4281 // JSArray: [Map][empty properties][Elements][Length-smi][index][input] 4281 // JSArray: [Map][empty properties][Elements][Length-smi][index][input]
4282 // Elements: [Map][Length][..elements..] 4282 // Elements: [Map][Length][..elements..]
4283 __ AllocateInNewSpace(JSRegExpResult::kSize + FixedArray::kHeaderSize, 4283 __ Allocate(JSRegExpResult::kSize + FixedArray::kHeaderSize,
4284 times_pointer_size, 4284 times_pointer_size,
4285 ebx, // In: Number of elements as a smi 4285 ebx, // In: Number of elements as a smi
4286 REGISTER_VALUE_IS_SMI, 4286 REGISTER_VALUE_IS_SMI,
4287 eax, // Out: Start of allocation (tagged). 4287 eax, // Out: Start of allocation (tagged).
4288 ecx, // Out: End of allocation. 4288 ecx, // Out: End of allocation.
4289 edx, // Scratch register 4289 edx, // Scratch register
4290 &slowcase, 4290 &slowcase,
4291 TAG_OBJECT); 4291 TAG_OBJECT);
4292 // eax: Start of allocated area, object-tagged. 4292 // eax: Start of allocated area, object-tagged.
4293 4293
4294 // Set JSArray map to global.regexp_result_map(). 4294 // Set JSArray map to global.regexp_result_map().
4295 // Set empty properties FixedArray. 4295 // Set empty properties FixedArray.
4296 // Set elements to point to FixedArray allocated right after the JSArray. 4296 // Set elements to point to FixedArray allocated right after the JSArray.
4297 // Interleave operations for better latency. 4297 // Interleave operations for better latency.
4298 __ mov(edx, ContextOperand(esi, Context::GLOBAL_OBJECT_INDEX)); 4298 __ mov(edx, ContextOperand(esi, Context::GLOBAL_OBJECT_INDEX));
4299 Factory* factory = masm->isolate()->factory(); 4299 Factory* factory = masm->isolate()->factory();
4300 __ mov(ecx, Immediate(factory->empty_fixed_array())); 4300 __ mov(ecx, Immediate(factory->empty_fixed_array()));
4301 __ lea(ebx, Operand(eax, JSRegExpResult::kSize)); 4301 __ lea(ebx, Operand(eax, JSRegExpResult::kSize));
(...skipping 3558 matching lines...) Expand 10 before | Expand all | Expand 10 after
7860 // Restore ecx. 7860 // Restore ecx.
7861 __ pop(ecx); 7861 __ pop(ecx);
7862 __ ret(0); 7862 __ ret(0);
7863 } 7863 }
7864 7864
7865 #undef __ 7865 #undef __
7866 7866
7867 } } // namespace v8::internal 7867 } } // namespace v8::internal
7868 7868
7869 #endif // V8_TARGET_ARCH_IA32 7869 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698